Fix NGINX HTTP response splitting in multisite subdirectory rewrite - #1640
Conversation
Use $request_uri instead of $uri in the wp-admin rewrite rule to prevent HTTP response splitting via CRLF injection. Closes #1548 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
CI failure here is expected: this is an The test is still marked Cleanup is tracked in #1648, which removes the |
Local verificationBranch tested: Multisite setupConfigured Bedrock for multisite subdirectory mode per Trellis docs:
Config diffBefore (master): After ( Runtime: CRLF injection testBefore (master) — vulnerable, response is split into two: After (fix) — single response, Runtime: site2 wp-admin redirect (sanity check)Normal redirect behavior preserved after fix. Summary
Conclusion: Verified locally — |
Summary
$request_uriinstead of$uriin the multisite subdirectory wp-admin rewrite rule to prevent HTTP response splitting via CRLF injection$uriis decoded by nginx, allowing injected%0d%0asequences to become raw CRLF characters in theLocationheader$request_uripreserves the original encoded request, preventing the injectionCloses #1548
🤖 Generated with Claude Code