Bug#1079172: CVE-2024-38474/CVE-2024-38475 Regression

Bastien Roucariès <[email protected]>
Newsgroups gmane.linux.debian.devel.apache
Message-ID <7954159.18r7X0emyO__34481.4792553493$1724187089$gmane$org@portable-bastien>
Package: apache2
Version: 2.4.61-1~deb12u1
Severity: important
Forwarded: https://bz.apache.org/bugzilla/show_bug.cgi?id=69197
Control: tags -1 + bullseye
Control: tags -1 + bookworm
Control: tags -1 + upstream
Control: Found -1 2.4.61-1~deb11u1

Dear Maintainer,

A tracking bug for a regression

> The SSRF fix in mod_rewrite introduced in r1918561 produces a "403
> Forbidden" response not only when an encoded question mark is introduced
> through a backreference but also when an existing query string appended via
> the QSA flag contains %3F.
> 
> 
> Steps to Reproduce:
> 
> 1) Prepare a webroot with an index.html file.
> 
> 2) Setup a vhost with the following rewrite rules
> 
>    (or add them to a .htaccess file):
>   RewriteEngine On
>   RewriteRule ^.*$ index.html?_path=$1 [L,QSA]
> 
> 3) Access /test?url=https%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar in a web
> browser
> 
> 
> Actual Results:
> 
> The HTTP server produces a "403 Forbidden" response.
> 
> Only when the the flag UnsafeAllow3F is added to the RewriteRule the results
> are as expected.
> 
> 
> Expected Results:
> 
> The URL should have been rewritten to /index.html?_path=%2Ftest&foo=bar and
> the contents of index.html should have been delivered to the web browser.
> 
> 
> Additional Information:
> 
> Rewrite rules similar to the one used in step 2 above are common in htaccess
> files delivered with PHP applications. To e.g. prevent issues with
> mod_cache, the original path is passed to the target script via the query
> string and all query string parameters from the original URL are appended
> via QSA flag.
> 
> This issue affects all URLs for these applications which contain a %3F
> somewhere in the query string. This commonly happens e.g. for search forms
> (the user may enter a question mark as part of the search query) and for
> scripts that send an URL in a query string (for example
> ?referer=https%3A%2F%2Fexample.com%2F%3Ffoo%3Dbar).
> 
> Thanks

Bastien
signature.asc (application/pgp-signature, 833 B)
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEXQGHuUCiRbrXsPVqADoaLapBCF8FAmbFARgACgkQADoaLapB
CF9dXQ/+NYieyKT35BN0qMy8XdHYlXEe0MmSfox/zZrT1VxP7k5qGCW9Ntsjm3fK
M0A8GIP8bGfWlkmX18RADhTQyum3TfuUeGShH9N8ClF/1ti/tmkWD9RW9zKOidhA
nXJf6A/4x8ceq9wiSl2vjvEGZg/uiR5X+p+DsWQkc5OW1mC7c+15F9L4DH8nZCfy
YSlULQXSqRMM+X0ctPj7qZPsfBFjjPD0ZHqcK7HYCsS3uxel6R+hmtz9iPgI8Ffc
RJFWlBj9hKm77QJdk9iYVFh9GQ+lsillRZ51sPoT/W6TSn9NtoWkl8aDX8RXx7YW
Dx7l58yKLn6Ju633R7Q9NWpPt/4ZKlCzUW9WeZLPK2yF6CWGoQF644TMuKD3ujOv
l9Pym/CP1DZWaVO0wW7MR54+Kpq0QN9302tvL6CjpS7I9xIPeTRGOq4uX+sLDZVC
1gBPwZebzqY86Vkmhu476r72S60jMD6eoIs3yQFmnwlJfSV1vVrx3Bo0NRNggZHJ
TM/jbRrKH/1pcvvCMDMcKruX1blWLFg5AhNscEaLJrd2+XWqwkHrXis1P3XjbA34
qCiqRdytCoYBL7AXlmHZrsjTUjNB4UxsKFDloRn0tTEGPVqoUF3bf8PskqdfTKYy
qWVP0SB/jQRLRMU9l3dwrwSI2lMV4bgAyJ8Da87mjVQTFJGR0Ic=
=AyuP
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.