[CVE-2007-2423] XSS in action=AttachFile&do=...

Related Vulnerabilities: CVE-2007-2423  

Debian Bug report logs - #422408
[CVE-2007-2423] XSS in action=AttachFile&do=...

version graph

Reported by: Florian Weimer <fw@deneb.enyo.de>

Date: Sat, 5 May 2007 18:30:02 UTC

Severity: grave

Tags: security

Found in versions moin/1.5.7-2, moin/1.5.3-1.2

Fixed in version moin/1.5.7-3

Done: Jonas Smedegaard <dr@jones.dk>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Jonas Smedegaard <dr@jones.dk>:
Bug#422408; Package python-moinmoin. (full text, mbox, link).


Acknowledgement sent to Florian Weimer <fw@deneb.enyo.de>:
New Bug report received and forwarded. Copy sent to Jonas Smedegaard <dr@jones.dk>. (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Florian Weimer <fw@deneb.enyo.de>
To: submit@bugs.debian.org
Subject: [CVE-2007-2423] XSS in action=AttachFile&do=...
Date: Sat, 05 May 2007 20:26:57 +0200
Package: python-moinmoin
Version: 1.5.7-2
Tags: security
Severity: grave

Proof of concept:

http://moinmoin.wikiwikiweb.de/WikiSandBox?action=AttachFile&do=%3Cblink%3ETest%3C/blink%3E

This is CVE-2007-2423.  Please mention this name in the changelog when
you fix this bug.



Reply sent to Jonas Smedegaard <dr@jones.dk>:
You have taken responsibility. (full text, mbox, link).


Notification sent to Florian Weimer <fw@deneb.enyo.de>:
Bug acknowledged by developer. (full text, mbox, link).


Message #10 received at 422408-close@bugs.debian.org (full text, mbox, reply):

From: Jonas Smedegaard <dr@jones.dk>
To: 422408-close@bugs.debian.org
Subject: Bug#422408: fixed in moin 1.5.7-3
Date: Sun, 06 May 2007 12:32:03 +0000
Source: moin
Source-Version: 1.5.7-3

We believe that the bug you reported is fixed in the latest version of
moin, which is due to be installed in the Debian FTP archive:

moin_1.5.7-3.diff.gz
  to pool/main/m/moin/moin_1.5.7-3.diff.gz
moin_1.5.7-3.dsc
  to pool/main/m/moin/moin_1.5.7-3.dsc
moinmoin-common_1.5.7-3_all.deb
  to pool/main/m/moin/moinmoin-common_1.5.7-3_all.deb
python-moinmoin_1.5.7-3_all.deb
  to pool/main/m/moin/python-moinmoin_1.5.7-3_all.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 422408@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Jonas Smedegaard <dr@jones.dk> (supplier of updated moin package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.7
Date: Sun, 06 May 2007 10:01:44 +0200
Source: moin
Binary: moinmoin-common python-moinmoin
Architecture: source all
Version: 1.5.7-3
Distribution: unstable
Urgency: high
Maintainer: Jonas Smedegaard <dr@jones.dk>
Changed-By: Jonas Smedegaard <dr@jones.dk>
Description: 
 moinmoin-common - Python clone of WikiWiki - common data
 python-moinmoin - Python clone of WikiWiki - library
Closes: 422408
Changes: 
 moin (1.5.7-3) unstable; urgency=high
 .
   * Sync with upstream HG development source, including a security fix:
     + XSS fix for AttachFile 'do' parameter.
     CVE-2007-2423. Closes: bug#422408, thanks to EN Douli for discovery
     and to Florian Weimer for reporting to Debian BTS.
   * Update local cdbs tweaks:
     + Improved upstream-tarball handling.
     + Minor updates to debain/README.cdbs-tweaks.
   * Cleanup duplicate build-dependencies.
   * Set urgency=high due to the upstream security fix.
Files: 
 0f1fe9b11948066da586606b434b09cc 695 net optional moin_1.5.7-3.dsc
 c39c755898c880042c2ba02100e4712f 53002 net optional moin_1.5.7-3.diff.gz
 5723feb21876a0f0e4e279eb1b478afd 1668904 net optional moinmoin-common_1.5.7-3_all.deb
 49cc84d41a06f8efd1f75c2c7e805b78 1017874 python optional python-moinmoin_1.5.7-3_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGPchyn7DbMsAkQLgRAma/AKClLBAoHyhTIcbL/LDztg6q/Nxa7ACfQCw+
rhYG19OoLAu2JJepQU+fmqM=
=9bNh
-----END PGP SIGNATURE-----




Information forwarded to debian-bugs-dist@lists.debian.org:
Bug#422408; Package python-moinmoin. (full text, mbox, link).


Acknowledgement sent to Jonas Smedegaard <dr@jones.dk>:
Extra info received and forwarded to list. (full text, mbox, link).


Message #15 received at 422408@bugs.debian.org (full text, mbox, reply):

From: Jonas Smedegaard <dr@jones.dk>
To: Florian Weimer <fw@deneb.enyo.de>, 422408@bugs.debian.org, team@security.debian.org
Subject: Re: Bug#422408: [CVE-2007-2423] XSS in action=AttachFile&do=...
Date: Sun, 06 May 2007 18:03:14 +0200
[Message part 1 (text/plain, inline)]
Florian Weimer skrev:
> Package: python-moinmoin
> Version: 1.5.7-2
> Tags: security
> Severity: grave
> 
> Proof of concept:
> 
> http://moinmoin.wikiwikiweb.de/WikiSandBox?action=AttachFile&do=%3Cblink%3ETest%3C/blink%3E
> 
> This is CVE-2007-2423.  Please mention this name in the changelog when
> you fix this bug.

Thanks for the report.

A fixed package has been uploaded to unstable with urgency=high.


For the security team:

Unfortunately I do not have access to an etch machine (with development
tools installed and not contaminated by non-Debian stuff).

Attached is the upstream fix adjusted to moin-1.5.3 in stable (patch
00829..). Simply adding the patch to debian/patches and rebuilding
should work.

I have not tested if the patch works, but upstream has, and the
adjustments were minor so I doubt bugs could have crept in. I also have
not checked if the bug is also in the much older version in oldstable.



Attached is also a couple of other security-related patches (00821.. and
00825..) that I am uncertain if is relevant to include as well.


Kind regards,

 - Jonas

-- 
* Jonas Smedegaard - idealist og Internet-arkitekt
* Tlf.: +45 40843136  Website: http://dr.jones.dk/

 - Enden er nær: http://www.shibumi.org/eoti.htm
[00829_SECURITY_FIX_XSS_in_AttachFile_do_parameter.patch (text/x-patch, inline)]
# HG changeset patch
# User Thomas Waldmann <tw AT waldmann-edv DOT de>
# Date 1178406230 -7200
# Node ID 288694f8dfde086358ca18f107cfb48cced03558
# Parent fe2e3e78c269f5f0024491fb9b6041970f4e7a1a
XSS fix for AttachFile 'do' parameter
(ajdusted for use with 1.5.3)

--- moin-1.5.3.orig/MoinMoin/action/AttachFile.py	2006-04-05 20:58:07.000000000 +0200
+++ moin-1.5.3/MoinMoin/action/AttachFile.py	2007-05-06 17:25:34.000000000 +0200
@@ -443,6 +443,9 @@
     _ = request.getText
 
     msg = None
+    do = request.form.get('do')
+    if do is not None:
+        do = do[0]
     if action_name in request.cfg.actions_excluded:
         msg = _('File attachments are not allowed in this wiki!')
     elif request.form.has_key('filepath'):
@@ -452,9 +455,9 @@
             request.write("OK")
         else:
             msg = _('You are not allowed to save a drawing on this page.')
-    elif not request.form.has_key('do'):
+    elif do is None:
         upload_form(pagename, request)
-    elif request.form['do'][0] == 'upload':
+    elif do == 'upload':
         if request.user.may.write(pagename):
             if request.form.has_key('file'):
                 do_upload(pagename, request)
@@ -464,33 +467,33 @@
                 msg = _("No file content. Delete non ASCII characters from the file name and try again.")
         else:
             msg = _('You are not allowed to attach a file to this page.')
-    elif request.form['do'][0] == 'del':
+    elif do == 'del':
         if request.user.may.delete(pagename):
             del_file(pagename, request)
         else:
             msg = _('You are not allowed to delete attachments on this page.')
-    elif request.form['do'][0] == 'get':
+    elif do == 'get':
         if request.user.may.read(pagename):
             get_file(pagename, request)
         else:
             msg = _('You are not allowed to get attachments from this page.')
-    elif request.form['do'][0] == 'unzip':
+    elif do == 'unzip':
          if request.user.may.delete(pagename) and request.user.may.read(pagename) and request.user.may.write(pagename):
             unzip_file(pagename, request)
          else:
             msg = _('You are not allowed to unzip attachments of this page.')
-    elif request.form['do'][0] == 'install':
+    elif do == 'install':
          if request.user.isSuperUser():
             install_package(pagename, request)
          else:
             msg = _('You are not allowed to install files.')
-    elif request.form['do'][0] == 'view':
+    elif do == 'view':
         if request.user.may.read(pagename):
             view_file(pagename, request)
         else:
             msg = _('You are not allowed to view attachments of this page.')
     else:
-        msg = _('Unsupported upload action: %s') % (request.form['do'][0],)
+        msg = _('Unsupported upload action: %s') % (wikiutil.escape(do),)
 
     if msg:
         error_msg(pagename, request, msg)

[00821_SECURITY_FIX_use_ACL_in_include_directive.patch (text/x-patch, inline)]
# HG changeset patch
# User Alexander Schremmer <alex AT alexanderweb DOT de>
# Date Sun Feb 25 11:01:57 2007 +0100
# Node ID 4949ad88af4e2fce70f2170bf6d09f337b7b83bb
# parent: efdb7eef6c61ba7c2ea97992269ff51a0b96e3bf
Actually check the ACL for the include directive. Fixes a severe security issue.
(ajdusted for use with 1.5.3)

--- a/MoinMoin/parser/rst.py	Fri Feb 23 19:24:52 2007 +0100
+++ b/MoinMoin/parser/rst.py	Sun Feb 25 11:01:57 2007 +0100
@@ -553,15 +553,19 @@ class MoinDirectives:
             return
 
         if len(content):
-            page = Page(page_name = content[0], request = self.request)
-            if page.exists():
-                text = page.get_raw_body()
-                lines = text.split('\n')
-                # Remove the "#format rst" line
-                if lines[0].startswith("#format"):
-                    del lines[0]
+            pagename = content[0]
+            page = Page(page_name=pagename, request=self.request)
+            if not self.request.user.may.read(pagename):
+                lines = [_("**You are not allowed to read the page: %s**") % (pagename, )]
             else:
-                lines = [_("**Could not find the referenced page: %s**") % (content[0],)]
+                if page.exists():
+                    text = page.get_raw_body()
+                    lines = text.split('\n')
+                    # Remove the "#format rst" line
+                    if lines[0].startswith("#format"):
+                        del lines[0]
+                else:
+                    lines = [_("**Could not find the referenced page: %s**") % (pagename, )]
             # Insert the text from the included document and then continue
             # parsing
             state_machine.insert_input(lines, 'MoinDirectives')

[00825_SECURITY-fix_MonthCalendar_respect_ACLs.patch (text/x-patch, inline)]
# HG changeset patch
# User Thomas Waldmann <tw AT waldmann-edv DOT de>
# Date Mon Apr 02 23:05:14 2007 +0200
# Node ID 0e41a0429ee13f5bba8bca418bc5898df91c91f7
# parent: 5e758e78e32797bb9625bb210572881ac3841f23
MonthCalendar: ACL security fix
(ajdusted for use with 1.5.3)

--- a/MoinMoin/macro/MonthCalendar.py	Sun Mar 18 23:14:08 2007 +0100
+++ b/MoinMoin/macro/MonthCalendar.py	Mon Apr 02 23:05:14 2007 +0200
@@ -389,7 +389,7 @@ def execute(macro, text):
                 else:
                     link = "%s/%4d-%02d-%02d" % (page, year, month, day)
                 daypage = Page(request, link)
-                if daypage.exists():
+                if daypage.exists() and request.user.may.read(link):
                     csslink = "cal-usedday"
                     query = {}
                     r, g, b, u = (255, 0, 0, 1)


Bug marked as found in version 1.5.3-1.2. Request was from Sam Morris <sam@robots.org.uk> to control@bugs.debian.org. (Tue, 08 May 2007 18:42:02 GMT) (full text, mbox, link).


Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Sun, 24 Jun 2007 13:07:43 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Wed Jun 19 14:42:20 2019; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.