Bug #1720
closedRewrite/redirect rules and URL encoding
Description
Dear lighty community,
I am using lighty to serve a wiki; to have nice urls, i use the following in my lighttpd.conf:
url.rewrite-once = ( "^/wiki/(.*)$" => "/wiki/awki.cgi/$1" )
and so i was hoping that everything going through /wiki/ would be interpreted by the script 'awki.cgi'. However, if I url-encode a part of the url, the above rewrite rule does not apply: if I ask my browser to access /wik%69/, lighty does not execute the script and gives me a
listing of files in that directory!
Is there a way to avoid that?
I asked in the forum last week but, as I had no answer, I decided to open a ticket; I apologize if this is unapropriate.
-- gaetan.bisson
Added by stbuehler over 16 years ago
Added by stbuehler over 16 years ago
Use decoded url for matching in mod_redirect (#1720)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2309 152afb58-edef-0310-8abb-c4023f1b3aa9
Added by stbuehler almost 16 years ago
Revert url decoding+simplifying before matching of mod_rewrite/mod_redirect (#1720)
Added by gstrauss over 6 years ago
[core] server.http-parseopts URL normalization opt (fixes #1720)
server.http-parseopts = ( ... ) URL normalization options
Note: not applied to CONNECT method
Note: In a future release, URL normalization likely enabled by default
(normalize URL, reject control chars, remove . and .. path segments)
To prepare for this change, lighttpd.conf configurations should
explicitly select desired behavior by enabling or disabling:
server.http-parseopts = ( "url-normalize" => "enable", ... )
server.http-parseopts = ( "url-normalize" => "disable" )
x-ref:
"lighttpd ... compares URIs to patterns in the (1) url.redirect and (2) url.rewrite configuration settings before performing URL decoding, which might allow remote attackers to bypass intended access restrictions, and obtain sensitive information or possibly modify data."
https://www.cvedetails.com/cve/CVE-2008-4359/
"Rewrite/redirect rules and URL encoding"
https://redmine.lighttpd.net/issues/1720
Also available in: Atom
Decode url before matching in mod_rewrite (#1720)
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2278 152afb58-edef-0310-8abb-c4023f1b3aa9