This is an advisory for TWiki Administrators: A specially crafted URL parameter to the WebSearch topic may expose a cross-site scripting vulnerability.
TWiki ( http://twiki.org ) is an Open Source Enterprise Wiki and Web Application Platform used by millions of people.
* Vulnerable Software Version
* Attack Vectors
* Impact
* Severity Level
* MITRE Name for this Vulnerability
* Details
* Countermeasures
* Hotfix for TWiki Production Release
* Verify Hotfix
* Authors and Credits
* Action Plan with Timeline
* External Links
* Feedback
---++ Vulnerable Software Version
* TWiki-6.0.0 and TWiki-6.0.1 [2]
---++ Attack Vectors
Attack can be done by viewing wiki pages or by logging in by issuing HTTP GET requests towards the TWiki server (usually port 80/TCP).
---++ Impact
Specially crafted parameters open up XSS (Cross-Site Scripting) attacks.
---++ Severity Level
The TWiki SecurityTeam triaged this issue as documented in TWikiSecurityAlertProcess [1] and assigned the following severity level:
* Severity 3 issue: TWiki content or browser is compromised.
---++ MITRE Name for this Vulnerability
The Common Vulnerabilities and Exposures project has assigned the name CVE-2014-9367 [7] to this vulnerability.
---++ Details
A malicious person can use specially crafted URL parameters to TWiki's WebSearch topic that execute arbitrary JavaScript code in the browser. Examples:
Specially crafted parameter to the view script of TWiki's WebSearch topic:
GET /do/view/TWiki/WebSearch?search=Search&scope='"-->
TWiki decodes the URL parameters and pops up a !JavaScript alert box showing "CVE-2014-9367 vulnarable!"
---++ Countermeasures
* Apply hotfix (see patch below).
* Use the web server software to restrict access to the web pages served by TWiki.
---++ Hotfix for TWiki Production Release
No TWiki patch release will be done to address this issue. Instead, apply the patches below.
---+++ Patch lib/TWiki.pm
Affected file: =twiki/lib/TWiki.pm=
The patch removes the single quote (') from the regular expression set in sub urlEncode of TWiki.pm:
=======( 8>< CUT )===============================================
--- lib/TWiki.pm (revision 28490)
+++ lib/TWiki.pm (working copy)
@@ -3178,7 +3178,7 @@
sub urlEncode {
my $text = shift;
- $text =~ s/([^0-9a-zA-Z-_.:~!*'\/])/'%'.sprintf('%02x',ord($1))/ge;
+ $text =~ s/([^0-9a-zA-Z-_.:~!*\/])/'%'.sprintf('%02x',ord($1))/ge;
return $text;
}
=======( 8>< CUT )===============================================
The patch might be managed in the e-mail. Get this patch from http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item7596 [8]
---+++ Patch TWiki system topics
Affected topics:
* TWiki.SearchResultsPagination - source:
http://develop.twiki.org/~twiki4/cgi-bin/view/TWiki/SearchResultsPagination?raw=on
* TWiki.WebSearch - source:
http://develop.twiki.org/~twiki4/cgi-bin/view/TWiki/WebSearch?raw=on
* TWiki.WebSearchAdvanced - source:
http://develop.twiki.org/~twiki4/cgi-bin/view/TWiki/WebSearchAdvanced?raw=on
To patch, copy the source of these topics, and do a "Raw Edit" on your topics to replace their content.
__Notes:__
* Learn how to apply patches: http://twiki.org/cgi-bin/view/Codev/HowToApplyPatch
* This issue is tracked at: http://develop.twiki.org/~twiki4/cgi-bin/view/Bugs/Item7596
---++ Verify Hotfix
To verify the patch add the following parameter to TWiki's WebSearch topic:
http://twiki.example.com/do/view/TWiki/WebSearch?search=Search&scope='"-->