apache: allow #":" in rewrite_arg type release_20190105-4
authorClinton Ebadi <clinton@unknownlamer.org>
Sat, 5 Jan 2019 23:37:57 +0000 (18:37 -0500)
committerClinton Ebadi <clinton@unknownlamer.org>
Sat, 5 Jan 2019 23:37:57 +0000 (18:37 -0500)
We really should be escaping this in the [E=VAR:VAL] construct, but
since the results of a user using #":" in the VAR aren't fatal or
insecure (just surprising), allow it since otherwise you can't use
constructs like "%{HTTP:header}".

src/plugins/apache.sml

index 524321c..3a446f6 100644 (file)
@@ -97,7 +97,8 @@ val _ = Env.type_one "proxy_reverse_target"
 
 val _ = Env.type_one "rewrite_arg"
        Env.string
 
 val _ = Env.type_one "rewrite_arg"
        Env.string
-       (CharVector.all (fn ch => (Char.isGraph ch) andalso not (List.exists (fn c => ch = c) [ #"[", #"]", #",", #"\"", #"'", #"=", #":", #"\\" ])))
+       (* #":" is permitted here, but really ought to be disallowed or escaped for E=VAR:VAL *)
+       (CharVector.all (fn ch => (Char.isGraph ch) andalso not (List.exists (fn c => ch = c) [ #"[", #"]", #",", #"\"", #"'", #"=", #"\\" ])))
 
 val _ = Env.type_one "suexec_flag"
        Env.bool
 
 val _ = Env.type_one "suexec_flag"
        Env.bool