Home    |    View Topics    |    Search    |    Contact Us    |   



Category:   Application (Forum/Board/Portal)  >   TWiki Vendors:
TWiki Input Validation Flaw in 'viewfile' Script Lets Remote Users Traverse the Directory
SecurityTracker Alert ID:  1016805
SecurityTracker URL:
CVE Reference:   CVE-2006-4294   (Links to External Site)
Date:  Sep 7 2006
Impact:   Disclosure of system information, Disclosure of user information
Fix Available:  Yes  Vendor Confirmed:  Yes  Exploit Included:  Yes  
Version(s): 4.0.0 - 4.0.4
Description:   A vulnerability was reported in TWiki. A remote user can view files on the target system.

The viewfile script does not properly validate user-supplied input in the 'filename' parameter. A remote user can supply a specially crafted HTTP POST request to view arbitrary files on target system with the privileges of the web service.

A demonstration exploit URL is provided:


TWiki:Main.MinsungChoi and TWiki:Main.KoenMartens reported this vulnerability to the vendor.

Impact:   A remote user can view files on the target system with the privileges of the target web service.
Solution:   The vendor plans to issue Hotfix 3 for TWiki-4.0.4, to be available at:

The TWiki advisory is available at:

Vendor URL: (Links to External Site)
Cause:   Input validation error
Underlying OS:  Linux (Any), UNIX (Any), Windows (Any)

Message History:   None.

 Source Message Contents

Subject:  TWiki Security Alert: Viewfile script allows view of arbitrary files

This is a security advisory for TWiki installations:

Unauthorized users may view arbitrary files of the server
file system with the viewfile script.

     * Vulnerable Software Version
     * Attack Vectors
     * Impact
     * Severity Level
     * MITRE Name for this Vulnerability
     * Details
     * Countermeasures
     * Hotfix
     * Authors and Credits
     * Action Plan with Timeline
     * Feedback
     * External Links

---++ Vulnerable Software Version

     * TWikiRelease04x00x04 --
     * TWikiRelease04x00x03 --
     * TWikiRelease04x00x02 --
     * TWikiRelease04x00x01 --
     * TWikiRelease04x00x00 --

---++ 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 [2] triaged this issue as documented
in TWikiSecurityAlertProcess [3] 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 [4] 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,;filename=../../../../../etc/passwd
dispays the content of the =/etc/passwd= file in the

---++ 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 3 for TWiki-4.0.4 contains an
improved version of the module, fixing the known
vulnerability. Hotfix 3 will be available at in
a few days.

If you prefer to fix your TWiki installation immediately,
add the line with "die" to the twiki/lib/TWiki/UI/

---     (revision 11339)
+++     (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

    * Credit to TWiki:Main.MinsungChoi and
      TWiki:Main.KoenMartens for disclosing the issue to
      the twiki-security mailing list
    * TWiki:Main.CrawfordCurrie for creating a fix
    * TWiki:Main.KennethLavrsen for creating Hotfix 3 for
      TWiki release 4.0.4
    * TWiki:Main.PeterThoeny and TWiki:Main.KennethLavrsen
      for creating the advisory

---++ Action Plan with Timeline

    * 2006-08-20 and 08-28: User discloses vulnerability to
    * 2006-08-22: Developer verifies issue
    * 2006-08-22: Developer creates fix
    * 2006-08-31: Security team creates advisory
    * 2006-09-05: Send alert to twiki-announce mailing list
                  and twiki-dev mailing list
    * 2006-09-06: Developer creates Hotfix 3
    * 2006-09-07: Publish advisory on
    * 2006-09-07: Issue a public security advisory

---++ Feedback

Please provide feedback at the security alert topic [1],

---++ External Links


-- Contributors: Peter Thoeny, Crawford Currie,
Kenneth Lavrsen - 07 Sep 2006

     * Peter Thoeny             
     * - bringing wikis to the workplace
     * - is your team already TWiki enabled?
     * Knowledge cannot be managed, it can be discovered and shared
     * This e-mail is:   (_) private    (_) ask first    (x) public

Go to the Top of This SecurityTracker Archive Page

Home   |    View Topics   |    Search   |    Contact Us

This web site uses cookies for web analytics. Learn More

Copyright 2021, LLC