ports/64544: mod_rewrite RewriteCond bug

Brian Szymanski ski at indymedia.org
Sun Mar 21 19:00:40 UTC 2004


>Number:         64544
>Category:       ports
>Synopsis:       mod_rewrite RewriteCond bug
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 21 11:00:39 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Brian Szymanski
>Release:        4.9
>Organization:
Indymedia
>Environment:
FreeBSD atotarho.wuhjuhbuh.afraid.org 4.9-STABLE FreeBSD 4.9-STABLE #0: Fri Feb 13 20:48:12 EST 2004 toor at atotarho.wuhjuhbuh.afraid.org:/usr/obj/usr/src/sys/ATOTARHO  i386
>Description:
      
Mod_rewrite: RewriteCond:
( Syntax: RewriteCond TestString CondPattern )

inconsistent expansion of environment variables in TestString depending on CondPattern. In particular, a CondPattern of ="" reveals different (and correct) results as compared to any other test.

>How-To-Repeat:
      In httpd.conf:

   RewriteEngine on
   RewriteCond %{QUERY_STRING} PHPSESSID.+
   RewriteRule ^.* whatever1
   RewriteCond %{QUERY_STRING} =""
   RewriteRule ^.* whatever2
Use a http client to pass in http://this_host/foobar.php?PHPSESSID=foo

Look in rewrite.log and note that:
..RewriteCond: input='PHPSESSID=abc' pattern='=""' => not-matched
..RewriteCond: input='' pattern='PHPSESSID.+' => not-matched


>Fix:
      
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list