-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[FALSE-NEGATIVE] cookies-without-httponly.yaml does not find cookies missing HttpOnly attribute if there are any cookies with HttpOnly set #11288
Comments
Hi @rjcoleman-tg, Thank you for taking the time to create this issue and for contributing to this project 🍻 We are currently rewriting this template using our JavaScript protocol to print all cookies without the HttpOnly flag, and we will apply the same to the cookies without secure attribute template |
Hey @princechaddha Ah thank you! I think I have a working template for this problem, but am looking forward to seeing what you ultimately ship! Here is what I've been using:
|
Update above, changed the regex in the extractor and modified the js to find cookies with case insensitive search:
This same pattern works for
|
@rjcoleman-tg The templates you shared look great and function well. We will update our existing templates with the ones you provided. Thank you for making these updates. |
Template IDs or paths
https://github.com/projectdiscovery/nuclei-templates/blob/main/http/misconfiguration/cookies-without-httponly.yaml
Environment
Steps To Reproduce
Expected results
This template should return findings if any cookies set by a target are missing
HttpOnly
.Actual results:
This template only works if none of the cookies set by a target have
HttpOnly
set.If there are any cookies with
HttpOnly
set, even if there are also cookies withoutHttpOnly
set, this template does not return any results.If there are no cookies with
HttpOnly
set, it returns results, although not the correct number of results.Run
nuclei -t http/misconfiguration/cookies-without-httponly.yaml -u https://www.target.com/ --debug
.observe no cookies with
HttpOnly
observe findings (there should be 5, not sure why there are only 2):
Run
nuclei -t http/misconfiguration/cookies-without-httponly.yaml -u https://heinztohome.co.uk/ --debug
observe several cookies without
HttpOnly
observe findings
[INF] No results found. Better luck next time!
Relevant dumped responses
Anything else?
I tried to write a template to do this correctly, but got as far as finding out Go does not support negative look aheads in regular expressions. Here is the template I am currently working with:
the last extractor is commented out because it fails.
The text was updated successfully, but these errors were encountered: