What is TWiki?
A leading open source enterprise wiki and web application platform used by 50,000 small businesses, many Fortune 500 companies, and millions of people.
Learn more.
Security Alert CVE-2011-1838: XSS Vulnerability with origurl parameter of login script
Get Alerted: |
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 two potential security issues with your TWiki installation: The login script may expose a cross-site scripting vulnerability when using the origurl parameter.
Vulnerable Software Version
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 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-2011-1838
to this vulnerability.
Details
A malicious person can use specially crafted URL parameters to TWiki view and login scripts that execute arbitrary Javascript code in the browser. Examples:
Specially crafted origurl parameter to the login script of TWiki:
GET /twiki/bin/login/Sandbox/WebHome?%27%221=;origurl=1%27%22--%3E%3C/style%3E%3C/script%3E%3Cscript%3Ealert%280x00039C%29%3C/script%3E
GET /twiki/bin/login/Sandbox/WebHome?sudo=sudo;origurl=http://10.1.10.128/bin/view/Main/TWikiAdminUser%00%27%22--%3E%3C%2Fstyle%3E%3C%2Fscript%3E%3Cscript%3Ealert%280x00044C%29%3C%2Fscript%3E
TWiki decodes the URL parameter and pops up a Javascript alert box showing "924"
Countermeasures
- Apply hotfix (see patch below).
- Upgrade to the latest patched production TWiki-5.0.2, TWikiRelease05x00x02.
- Use the web server software to restrict access to the web pages served by TWiki.
Hotfix for TWiki Production Releases
It is recommended to upgrade to the latest TWiki version. If an immediate upgrade is not feasible you can apply this patch for Production Release TWiki-5.0.x, TWiki-4.3.x and TWiki-4.2.x. There is no hotfix for earlier TWiki releases; take the hotfix as a guideline (line numbers may vary). The patch sanitizes the origurl parameter.
Patch for TWiki-5.0.1, TWiki-5.0.0 and TWiki-4.3.x
Affected file: twiki/lib/TWiki/LoginManager/TemplateLogin.pm
Patch:
--- TemplateLogin.pm.orig 2011-04-28 21:48:34.000000000 -0700
+++ TemplateLogin.pm 2011-05-01 17:15:10.000000000 -0700
@@ -139,6 +139,9 @@
my $loginPass = $query->param( 'password' );
my $remember = $query->param( 'remember' );
+ # Item6673: Cleanup origurl parameter
+ $origurl =~ s/[^a-zA-Z0-9_\-\.\:\/\?\;\&]//g;
+
# Eat these so there's no risk of accidental passthrough
$query->delete( 'origurl', 'username', 'password' );
Patch for TWiki-4.2.x
Affected file: twiki/lib/TWiki/Client/TemplateLogin.pm
Patch:
--- TemplateLogin.pm.save1 2007-03-03 06:45:57.000000000 -0800
+++ TemplateLogin.pm 2011-05-13 15:21:41.000000000 -0700
@@ -107,6 +107,9 @@
my $loginName = $query->param( 'username' );
my $loginPass = $query->param( 'password' );
+ # Item6673: Cleanup origurl parameter
+ $origurl =~ s/[^a-zA-Z0-9_\-\.\:\/\?\;\&]//g;
+
# Eat these so there's no risk of accidental passthrough
$query->delete('origurl', 'username', 'password');
Authors and Credits
Action Plan with Timeline
- 2011-05-03: Developer releases TWiki-5.0.2 with fix (George Trubisky)
- 2011-05-15: Security team creates advisory with hotfix (Peter Thoeny)
- 2011-05-16: Send alert to TWikiAnnounceMailingList and TWikiDevMailingList (Peter Thoeny)
- 2011-05-18: Publish advisory in Codev web and update all related topics (Peter Thoeny)
- 2011-05-18: Issue a public security advisory to full-disclosure@lists.netsys.com, cert@cert.org, vuln@secunia.com, bugs@securitytracker.com (Peter Thoeny)
External Links
--
PeterThoeny - 2011-05-18
Discussions