Security Alert: Viewfile script allows view of arbitrary files (CVE-2006-4294)
Please join the twiki-announce list: |
To get immediate alerts of high priority security issues, please join the low-volume twiki-announce list - details at TWikiAnnounceMailingList |
This advisory alerts you of a potential security issue with your TWiki installation: Unauthorized users may view arbitrary files of the server file system with the viewfile script.
Vulnerable Software Version
Attack Vectors
Supply a specially crafted HTTP POST request on the TWiki viewfile script.
Impact
An intruder is able to view arbitrary files on the server file system that are readable by the webserver user, such as user nobody or wwwrun. The server can potentially be exploited by reading system files such as /etc/passwd.
Severity Level
The TWiki
SecurityTeam triaged this issue as documented in
TWikiSecurityAlertProcess and assigned the following severity level:
- Severity 1 issue: The web server can be compromised
MITRE Name for this Vulnerability
The Common Vulnerabilities and Exposures project has assigned the name
CVE-2006-4294
to this vulnerability.
Details
All TWiki 4.0.x releases do not sanitize the filename parameter of the viewfile script. This can used to read arbitrary files on the server. For example,
http://example.com/bin/viewfile/TWiki/TWikiDocGraphics?rev=1;filename=../../../../../etc/passwd dispays the content of the
/etc/passwd file in the browser.
Countermeasures
- Restrict access to the TWiki installation.
- Apply the hotfix indicated below.
- NOTE: The hotfix is known to prevent the current attacks, but it might not be a complete fix
Hotfix
The accumulated Hotfix 4 for TWiki-4.0.4 contains an improved version of the
View.pm module, fixing the known vulnerability. Hotfix 4 is available at
TWiki:Codev.HotFix04x00x04x04
. (Fix was actually released in Hotfix 3 but because of a major bug we now recommend hotfix 4)
If you prefer to fix your TWiki installation immediately, add the line with
die to the
twiki/lib/TWiki/UI/View.pm file:
Index: View.pm
===================================================================
--- View.pm (revision 11339)
+++ View.pm (working copy)
@@ -356,6 +356,7 @@
my $topic = $session->{topicName};
my $fileName = $query->param( 'filename' );
+ die "Illegal attachment name" if $fileName =~ m#[/\\]#;
my $rev = $session->{store}->cleanUpRevID( $query->param( 'rev' ) );
Authors and Credits
Action Plan with Timeline
External Links
--
Contributors: PeterThoeny,
CrawfordCurrie,
KennethLavrsen - 31 Aug 2006
Discussions