Active
Project:
Flag
Version:
5.x-dev
Component:
Flag core
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
25 Jul 2024 at 13:53 UTC
Updated:
5 Feb 2026 at 07:37 UTC
Jump to comment: Most recent
The flag link URL "destination" query argument includes the entity URL, but also the same URL unnecessarily repeated as a "?q=" query argument.
This breaks in mod_rewrite in Apache HTTP Server 2.4.60 and later that take exception to having "?" encoded as %3F in a query argument that is being rewritten. Security issue description: https://www.cve.org/CVERecord?id=CVE-2024-38474
Adding "UnsafeAllow3F" to the Drupal main rewrite rule works around this security limitation:
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA,UnsafeAllow3F]
This works around the problem, but ideally the URL created by Flag should not include the "?q=" part.
Will investigate further when I get time.
Comments
Comment #2
fonant commentedComment #3
fonant commentedComment #4
johns996 commentedI noticed a similar issue with the UnsafeAllow3F Apache update that was added to repos around July 1, 2024. I'm running a Drupal multisite and each site runs in a subdirectory of the main domain. Each of these sites has its own block of rewrites in the main .htaccess. For any of the admin URLs to function after this Apache update, I needed to add the new flag like the example below.
Comment #5
ivnish