From 5580988f02fc677560bfe405d903cbe1fc07de4b Mon Sep 17 00:00:00 2001 From: Eric Covener Date: Fri, 13 Nov 2026 13:13:14 -0500 Subject: [PATCH] clarify what UnsafeAllow3F covers it is about path truncation, not the presence of %3F [skip CI] --- docs/manual/rewrite/flags.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/manual/rewrite/flags.xml b/docs/manual/rewrite/flags.xml index f4557960b87..cd0307c4b8a 100644 --- a/docs/manual/rewrite/flags.xml +++ b/docs/manual/rewrite/flags.xml @@ -1160,15 +1160,15 @@ The L flag can be useful in this context to end the
UnsafeAllow3F

Setting this flag is required to allow a rewrite to continue If the HTTP request being written has an encoded question mark, '%3f', and the - rewritten result has a '?' in the substitution. This protects from a malicious + rewritten result has a '?' in cases where the first question mark + would be interpreted as separating the substituted path from the substituted + query. This protects from a malicious URL taking advantage of a capture and re-substitution of the encoded - question mark.

+ question mark to truncate the path.

-# A PHP front controller that routes all requests via a query parameter. -# Without UnsafeAllow3F, a request like /page%3Fname=test would return -# 403 Forbidden because the rewritten substitution contains '?' while -# the original request contains an encoded '%3F'. +# Without UnsafeAllow3F, a request like /page%3Fname=test would be +# rejected because the path would be truncated. RewriteCond "%{REQUEST_FILENAME}" !-f RewriteCond "%{REQUEST_FILENAME}" !-d RewriteRule "(.+)" "index.php?route=$1" [L,QSA,UnsafeAllow3F]