[UNIX] TWiki Command Execution Vulnerability

SecuriTeam <[email protected]> 29 Sep 2005 15:23:15 +0200
Newsgroups gmane.comp.security.securiteam
Message-ID <[email protected]>
The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html 

- - - - - - - - -



  TWiki Command Execution Vulnerability
------------------------------------------------------------------------


SUMMARY

 <http://www.twiki.org/> TWiki - "A flexible, powerful, and easy to use 
enterprise collaboration platform. It is a Structured Wiki, typically used 
to run a project development space, a document management system, a 
knowledge base, or any other groupware tool, on an intranet or on the 
internet."

A potential security issue discovered in, TWiki: The TWiki history, 
function that allows arbitrary shell command execution.

DETAILS

Vulnerable Systems:
 * TWiki Release 02Sep2004[2]
 * TWiki Release 01Sep2004[3]
 * TWiki Release 01Feb2003[4]
 * TWiki Release 01Dec2001[5]
 * TWiki Release 01Dec2000[6]

Immune Systems:
 * Recent Dakar Releases[7] (upcoming production release, soon)
 * TWiki Release 01Sep2004 patched with Florian Weimer's 
UncoordinatedSecurityAlert23Feb2005[8]

The TWiki revision control function uses a user supplied URL parameter to 
compose a command line executed by the Perl backtick (``) operator.

The URL parameter is not checked properly for shell metacharacters and is 
thus vulnerable to revision numbers containing pipes and shell commands. 
Exploit is possible on topics with two or more revisions.

Example URL path with exploited rev parameter:
/cgi-bin/view/Main/TWikiUsers?rev=2%20%7Cless%20/etc/passwd

If access to TWiki is not restricted by other means, attackers can use the 
revision function without prior authentication.
See Also: SecurityAlertExecuteCommandsWithSearch[9] and 
UncoordinatedSecurityAlert23Feb2005[8]

Fix:
 * Apply hotfix (see patches below)
 * Upgrade to the latest patched production TWikiRelease03Sep2004[1]
 * Apply patch of UncoordinatedSecurityAlert23Feb2005[6] (but see known 
issues of that patch)
 * Filter access to the web server
 * Use the web server software to restrict access to the web pages served 
by TWiki

CVE Information:
 <http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2005-2877> 
CAN-2005-2877


ADDITIONAL INFORMATION

The original article can be found at:  
<http://twiki.org/cgi-bin/view/Codev/SecurityAlertExecuteCommandsWithRev> 
http://twiki.org/cgi-bin/view/Codev/SecurityAlertExecuteCommandsWithRev



======================================== 


This bulletin is sent to members of the SecuriTeam mailing list. 
To unsubscribe from the list, send mail with an empty subject line and body to: [email protected] 
In order to subscribe to the mailing list, simply forward this email to: [email protected] 


==================== 
==================== 

DISCLAIMER: 
The information in this bulletin is provided "AS IS" without warranty of any kind. 
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.