Prevent authenticated scans from setting canonicalized headers #6478
Replies: 1 comment
-
Thanks for raising this. What you’re seeing is the Go As a practical workaround today, you can avoid canonicalization by using raw/unsafe HTTP in your template so Nuclei uses the
Example sketch: id: case-sensitive-header-check
info:
name: Case sensitive header test
severity: info
requests:
- raw:
- |
POST /test HTTP/1.1
Host: {{Hostname}}
barAuthToken: {{some_token}}
Content-Type: application/json
Content-Length: 22
{"hello":"world"}
unsafe: true # use rawhttp
matchers:
- type: status
status:
- 200 This path keeps the exact casing (barAuthToken) for non-compliant targets that break otherwise. That said, I like your proposal in PR #6479 to prevent canonicalization for authenticated scans specifically. Even if HTTP header names are case-insensitive by spec, real-world targets aren’t always compliant, and having a first-class knob to opt out (without switching the whole request to raw mode) would be helpful. Happy to test a build or share more examples if needed. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Description
Authenticated scans will set headers with their canonical names (ie,
Authtoken
rather thanauthToken
). This makes it challenging to test web apps and APIs that are not compliant with the case-insensitive requirement of the HTTP standard.I propose a fix in PR 6479. I'm open to a better fix here, but it worked for me to finish an assessment.
Example config:
The token from
.bar
is found and set:The header
barAuthToken
is transformed toBarauthtoken
:This looks looks much nicer, and shouldn't pose an issue. But, it will fail against non-compliant servers that expect
barAuthToken
as-is.Beta Was this translation helpful? Give feedback.
All reactions