Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Too many false positives ins "CRLF Injection" #189

Closed
Hipapheralkus opened this issue Mar 6, 2024 · 1 comment · Fixed by #191
Closed

[BUG] Too many false positives ins "CRLF Injection" #189

Hipapheralkus opened this issue Mar 6, 2024 · 1 comment · Fixed by #191
Labels
bug Something isn't working template Issue in BCheck template

Comments

@Hipapheralkus
Copy link
Contributor

Current behavior

A the moment, this BCheck does not take into account that searched value can be occuring in header values, which introduces many false positives as new header is not injected per-se.
For example:

HTTP/2 302 Found
Date: Wed, 06 Mar 2024 08:49:00 GMT
Content-Length: 0
Location: https://127.0.0.1/login/login?redirectAfterLogin=https://127.0.0.1/listview.jsp%0d%0aX-TEST-Header:%20a4k9m24nsdqmq%0d%0a%3FlogicQuery%3Dfalse
X-Xss-Protection: 1; mode=block

This will trigger CRLF Injection, hence it has too many false positives since it simply searches for string in all headers, not only in header names.
I think this BCheck line should be tuned a little:
if "x-test-header" in {to_lower({crlf.response.headers})} then

Expected behavior

It should check if a new header exists with the name + value; not all headers for this string.

Motivation for change

Too many false positive issues on some environments.

@Hipapheralkus Hipapheralkus added the bug Something isn't working label Mar 6, 2024
@PortSwiggerWiener PortSwiggerWiener added the template Issue in BCheck template label Mar 6, 2024
@Hannah-PortSwigger Hannah-PortSwigger linked a pull request Mar 7, 2024 that will close this issue
6 tasks
@Hannah-PortSwigger
Copy link
Contributor

Hi @Hipapheralkus, we've made some adjustments to the script in the linked pull request. Please let us know if you still experience too many false positives with the updated script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working template Issue in BCheck template
Development

Successfully merging a pull request may close this issue.

3 participants