Skip to content

Reject NUL paths in static file routing - #2600

Open
kyoungbinkim wants to merge 1 commit into
drogonframework:masterfrom
kyoungbinkim:codex/2591-reject-nul-static-path
Open

kyoungbinkim wants to merge 1 commit into
drogonframework:masterfrom
kyoungbinkim:codex/2591-reject-nul-static-path

Conversation

@kyoungbinkim

Copy link
Copy Markdown
Contributor

Summary

  • Reject decoded paths containing NUL before static-file extension checks or filesystem access.
  • Add a raw HTTP integration regression test so %00 is not re-encoded by HttpClient.

Reproduction and verification

  • Without the guard, GET /main.cc%00.html returned HTTP 200 and the body contained int main from the non-allowlisted source file.
  • With the guard, the same raw request returns HTTP 403 with an empty body; /index.html still returns HTTP 200.
  • integration_test_client -r StaticFileRejectsNulPath: 3 assertions passed.
  • Full MSVC build and CTest: 66/66 passed.

Fixes #2591

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Security] Null-byte (%00) truncation in StaticFileRouter defeats the file-type allowlist (file disclosure)

1 participant