Description

If IE6 / IE7 sends an HTTP POST request containing non-rfc compliant extra data to the builtin "standalone" server of moin, the server will reset the connection, making Internet Explorer unhappy and behaving weirdly.

Steps to reproduce

  1. Run a MoinMoin standalone server (aka. wikiserver.py) on localhost:8080.

  2. On Windows XP, visit a large wiki page through Internet Explorer 6 (and 7).
  3. Click the Edit link, and then press Preview button on the editing page.

  4. IE will refresh when the preview page displays in the middle, and finally jump to the original page itself.
  5. If it looks normal after you press Preview, try to do it several times. You will see the weird behavior sooner or later.

Example

URL: http://localhost:8080/WikiSandBox

Component selection

Details

MoinMoin Version

1.9.4

OS and Version

Windows XP SP3, IE 7.0.5730

Python Version

2.7.3

Server Setup

Standalone

Server Details

moin.py script

Language you are using the wiki in (set in the browser/UserPreferences)

English

Workarounds and Fix

Discussion

I captured the network traffic during editing a huge page (80k) last week. The traffic shows 4 parts:

  1. initial HTTP GET request
  2. first HTTP POST request
  3. RESET package sent by the server
  4. second HTTP POST request
  5. RESET package sent by the server
  6. final HTTP GET Request

/!\ Analysis / Solution:

This would fit to my bug. I checked the details with wireshark and a good text editor. The POST request starts with action=edit and ends with CRLF. The content length of 114046 fits to the "action" line without CRLF. This bug has elements of a race condition to, because the reset packages are too late for small pages.

May you could extend MoinMoin to read (and drop) the garbage after the content. Possibly werkzeug.contrib.fixers is an good way for such an implementation.

The patch has some indenting failures from a first quick look (!) just a general note, it is much easier to review on http://codereview.appspot.com/

The indention failures ware caused by tabs. I've fixed the attached patch.

Plan


CategoryMoinMoinNoBug

MoinMoin: MoinMoinBugs/IE7BugWithPostMakesStandaloneServerResetConnection (last edited 2012-05-15 05:43:01 by CarstenGrohmann)