__________________________________________________________ The U.S. Department of Energy Computer Incident Advisory Capability ___ __ __ _ ___ / | /_\ / \___ __|__ / \ \___ __________________________________________________________ INFORMATION BULLETIN TWiki Rdiff and Preview Scripts Ignore Access Control Settings TWiki Security Alert March 30, 2006 20:00 GMT Number Q-160 ______________________________________________________________________________ PROBLEM: It is possible to view restricted content using rdiff and preview scripts. PLATFORM: TWiki-4.0.1 TWiki-4.0.0 DAMAGE: An unautorized user can view access restricted areas and gain access to confidential content in TWiki topics. SOLUTION: Apply updated patches. ______________________________________________________________________________ VULNERABILITY The risk is MEDIUM - An unautorized user can view access ASSESSMENT: restricted areas and gain access to confidential content in TWiki topics. ______________________________________________________________________________ LINKS: CIAC BULLETIN: http://www.ciac.org/ciac/bulletins/q-160.shtml ORIGINAL BULLETIN: http://twiki.org/cgi-bin/view/Codev/SecurityAlert TWiki4RdiffPreviewAccess?skin=print.pattern CVE: http://www.cve.mitre.org/cgi-bin/cvename.cgi?name= CVE-2006-1386 ______________________________________________________________________________ [****** Start Bulletin Goes Here ******] Security Alert: TWiki Rdiff and Preview Scripts Ignore Access Control Settings (CVE-2006-1386) 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 4.0 installation: The rdiff and preview scripts ignore access control settings, allowing unautorized users to view restricted content. Vulnerable Software Version Attack Vectors Impact Severity Level MITRE Name for this Vulnerability Details Countermeasures Authors and Credits Hotfix for TWiki 4.0.0 and TWiki 4.0.1 Action Plan with Timeline External Links Discussions Vulnerable Software Version TWikiRelease04x00x01 -- TWiki-4.0.1.zip TWikiRelease04x00x00 -- TWiki-4.0.0.zip Attack Vectors With obscure use of the rdiff and preview scripts it is possible to view access restricted content. Impact An unautorized user can view access restricted areas and gain access to confidential content in TWiki topics. Severity Level The TWiki SecurityTeam triaged this issue as documented in TWikiSecurityAlertProcess and assigned the following severity level: Severity 2 issue: The TWiki installation is compromised MITRE Name for this Vulnerability The Common Vulnerabilities and Exposures project has assigned the name CVE-2006-1386 to this vulnerability. Details To reproduce the rdiff vulnerability: Add this to an existing topic: Set DENYTOPICVIEW = Main.YourWikiName View the topic. You will be denied view. Now edit the URL and replace view with rdiff. Now you can see the most recent changes, even those done after the DENYTOPICVIEW was added. To reproduce the preview vulnerability: An unauthorized user can access a restricted web by using the preview script instead of the view script. Example URL to access the restricted web called Secret: http://wiki.example.com/bin/preview/Secret/WebHome?action=foo Countermeasures Apply hotfix Upgrade to TWiki 4.0.2 (to be released in a few days) Authors and Credits Credit to TWiki:Main.SergejZagursky for disclosing the issue to the bug tracker Credit to TWiki:Main.SteffenPoulsen for disclosing the issue to the bug tracker TWiki:Main.CrawfordCurrie for providing a fix in TWiki 4.0.2 and the hotfix description TWiki:Main.JasonHill for providing the patch files TWiki:Main.PeterThoeny for creating the advisory Hotfix for TWiki 4.0.0 and TWiki 4.0.1 Hotfix for rdiff script: In file twiki/lib/TWiki/UI/RDiff.pm, find sub diff. 10 lines lower in the file you will find the following line: TWiki::UI::checkTopicExists( $session, $webName, $topic, 'diff' ); Add the following line immediately after it: TWiki::UI::checkAccess( $session, $webName, $topic, 'view', $session->{user} ); CVE-2006-1386_UI_RDiff_pm.diff: Patch for twiki/lib/TWiki/UI/RDiff.pm, TWiki 4.0.1 (See HowToApplyPatch) Hotfix for preview script: In file twiki/lib/TWiki/UI/Save.pm find the following lines: if( $topicExists ) { ( $prevMeta, $prevText ) = $store->readTopic( undef, $webName, $topic, undef ); if( $prevMeta ) { foreach my $k ( keys %$prevMeta ) { Change the call to 'readTopic' to: $store->readTopic( $user, $webName, $topic, undef ); CVE-2006-1386_UI_Save_pm.diff: Patch file for twiki/lib/TWiki/UI/Save.pm, TWiki 4.0.1 (See HowToApplyPatch) Action Plan with Timeline # Action Date Status Who 1. User discloses rdiff issue publicly to TWiki bug tracker 2006-03-21 Done SergejZagursky 2. Developer verifies rdiff issue and creates a fix 2006-03-21 Done CrawfordCurrie 4. Developer discloses preview issue publicly to TWiki bug tracker 2006-03-22 Done SteffenPoulsen 5. Developer verifies preview issue and creates a fix 2006-03-22 Done CrawfordCurrie 6. Developer creates hotfix 2006-03-24 Done CrawfordCurrie 7. Send alert to TWikiAnnounceMailingList and TWikiDevMailingList 2006-03-24 Done PeterThoeny 8. Publish advisory in Codev web and update all related topics 2006-03-25 Done PeterThoeny 9. Issue a public security advisory (vuln@secunia.com, cert@cert.org, bugs@securitytracker.com, full-disclosure@lists.netsys.com, vulnwatch@vulnwatch.org) 2006-03-25 Done PeterThoeny Note: A silent alert was not done because the vulerabilities were already made public in the TWiki bug database at Bugs:WebHome on 2006-03-21 and 2006-03-23, respectively. External Links http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2006-1386 http://secunia.com/advisories/19410/ http://www.frsirt.com/english/advisories/2006/1116 http://www.heise.de/security/news/meldung/71386 -- Contributors: PeterThoeny, CrawfordCurrie, SteffenPoulsen, JasonHill - 24 Mar 2006 Discussions Attachment Action Size Date Who Comment CVE-2006-1386_UI_RDiff_pm.diff manage 0.5 K 25 Mar 2006 - 07:30 PeterThoeny Hotfix for twiki/lib/TWiki/UI/RDiff.pm, TWiki 4.0.1 CVE-2006-1386_UI_Save_pm.diff manage 0.5 K 25 Mar 2006 - 07:31 PeterThoeny Hotfix for twiki/lib/TWiki/UI/Save.pm, TWiki 4.0.1 Revision: r1.9 - 30 Mar 2006 - 19:20 - PeterThoeny Codev > SecurityAlertTWiki4RdiffPreviewAccess Copyright © 1999-2006 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. [****** End Bulletin Goes Here ******] _______________________________________________________________________________ CIAC wishes to acknowledge the contributions of Twiki Security Alert for the information contained in this bulletin. _______________________________________________________________________________ CIAC, the Computer Incident Advisory Capability, is the computer security incident response team for the U.S. Department of Energy (DOE) and the emergency backup response team for the National Institutes of Health (NIH). CIAC is located at the Lawrence Livermore National Laboratory in Livermore, California. CIAC is also a founding member of FIRST, the Forum of Incident Response and Security Teams, a global organization established to foster cooperation and coordination among computer security teams worldwide. CIAC services are available to DOE, DOE contractors, and the NIH. CIAC can be contacted at: Voice: +1 925-422-8193 (7x24) FAX: +1 925-423-8002 STU-III: +1 925-423-2604 E-mail: ciac@ciac.org Previous CIAC notices, anti-virus software, and other information are available from the CIAC Computer Security Archive. World Wide Web: http://www.ciac.org/ Anonymous FTP: ftp.ciac.org PLEASE NOTE: Many users outside of the DOE, ESnet, and NIH computing communities receive CIAC bulletins. If you are not part of these communities, please contact your agency's response team to report incidents. Your agency's team will coordinate with CIAC. The Forum of Incident Response and Security Teams (FIRST) is a world-wide organization. A list of FIRST member organizations and their constituencies can be obtained via WWW at http://www.first.org/. This document was prepared as an account of work sponsored by an agency of the United States Government. Neither the United States Government nor the University of California nor any of their employees, makes any warranty, express or implied, or assumes any legal liability or responsibility for the accuracy, completeness, or usefulness of any information, apparatus, product, or process disclosed, or represents that its use would not infringe privately owned rights. Reference herein to any specific commercial products, process, or service by trade name, trademark, manufacturer, or otherwise, does not necessarily constitute or imply its endorsement, recommendation or favoring by the United States Government or the University of California. The views and opinions of authors expressed herein do not necessarily state or reflect those of the United States Government or the University of California, and shall not be used for advertising or product endorsement purposes. LAST 10 CIAC BULLETINS ISSUED (Previous bulletins available from CIAC) Q-151: sendmail Security Update Q-152: snmptrapfmt Q-153: RealPlayer Security Update Q-154: Vulnerability in the way HTML Objects Handle Unexpected Method Calls Q-155: kernel-source-2.6.8 Q-156: kernel-source-2.6.8 G-157: Flex -- buffer overflow Q-158: kernel-source-2.6.8 Q-159: Exposure of machine account credentials in winbind log files