Return-Path: X-Original-To: apmail-httpd-bugs-archive@www.apache.org Delivered-To: apmail-httpd-bugs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E5B2310586 for ; Sun, 9 Mar 2014 13:33:05 +0000 (UTC) Received: (qmail 7558 invoked by uid 500); 9 Mar 2014 13:33:05 -0000 Delivered-To: apmail-httpd-bugs-archive@httpd.apache.org Received: (qmail 7196 invoked by uid 500); 9 Mar 2014 13:33:04 -0000 Mailing-List: contact bugs-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: Reply-To: "Apache HTTPD Bugs Notification List" List-Id: Delivered-To: mailing list bugs@httpd.apache.org Received: (qmail 7186 invoked by uid 99); 9 Mar 2014 13:33:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Mar 2014 13:33:01 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.115] (HELO eir.zones.apache.org) (140.211.11.115) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 09 Mar 2014 13:33:00 +0000 Received: by eir.zones.apache.org (Postfix, from userid 80) id 94BEF1C3C8; Sun, 9 Mar 2014 13:32:38 +0000 (UTC) From: bugzilla@apache.org To: bugs@httpd.apache.org Subject: [Bug 49642] mod_rewrite mistakes encoded question mark as path/query string separator Date: Sun, 09 Mar 2014 13:32:38 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Apache httpd-2 X-Bugzilla-Component: mod_rewrite X-Bugzilla-Version: 2.2.15 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: andersk@mit.edu X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: bugs@httpd.apache.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://issues.apache.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org https://issues.apache.org/bugzilla/show_bug.cgi?id=3D49642 --- Comment #6 from Anders Kaseorg --- I tried passing every unescaped and escaped character through mod_rewrite i= n a loop, and came up with this list of escaping problems. RewriteRule ^page/(.*)$ page.cgi/$1 page.cgi/foo%0abar: PATH_INFO=3D"/foo\nbar" page/foo%0abar: 404 page.cgi/foo%23bar: PATH_INFO=3D"/foo#bar" page/foo%23bar: PATH_INFO=3D"/foo" page.cgi/foo%25bar: PATH_INFO=3D"/foo%bar" page/foo%25bar: PATH_INFO=3D"/foo\x{BA}r" page.cgi/foo%3fbar: PATH_INFO=3D"/foo?bar" page/foo%3fbar: PATH_INFO=3D"/foo" QUERY_STRING=3D"bar" (%0a is the regex=E2=80=99s fault in this case, since . doesn=E2=80=99t mat= ch newline by default, but the problem doesn=E2=80=99t go away with a more careful regex = like (?s)\Apage/(.*)\z .) I=E2=80=99ve seen some people recommend the [B] flag as a solution, so I tr= ied that too. That comes with its own set of problems: RewriteRule ^page/(.*)$ page.cgi/$1 [B] page.cgi/foo%0abar: PATH_INFO=3D"/foo\nbar" page/foo%0abar: 404 page.cgi/foo%20bar: PATH_INFO=3D"/foo bar" page/foo%20bar: PATH_INFO=3D"/foo+bar" page.cgi/foo/bar: PATH_INFO=3D"/foo/bar" page/foo/bar: 404 I=E2=80=99m running apache2 2.4.7-1ubuntu1 on Ubuntu trusty amd64. --=20 You are receiving this mail because: You are the assignee for the bug.= --------------------------------------------------------------------- To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org For additional commands, e-mail: bugs-help@httpd.apache.org