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

Reduce false-positives in Open Redirect regexes #6815

Merged
merged 2 commits into from
Mar 3, 2023
Merged

Reduce false-positives in Open Redirect regexes #6815

merged 2 commits into from
Mar 3, 2023

Conversation

JorianWoltjer
Copy link
Contributor

Template / PR Information

I noticed a large number of false positives in a large-scale scan I did with the nuclei templates. This was primarily due to most regexes counting a Location header like the following as an open redirect:

Location: interact.sh

But this actually redirects to the relative path /interact.sh instead of being an open redirect. In the original regex, the protocol prefix was optional, but it should actually be required.

The change is simply as follows (regex101):

Before: (?m)^(?:Location\s*?:\s*?)(?:https?:\/\/|\/\/|\/\\\\|\/\\)?(?:[a-zA-Z0-9\-_\.@]*)interact\.sh\/?(\/|[^.].*)?$
After:  (?m)^(?:Location\s*?:\s*?)(?:https?:\/\/|\/\/|\/\\\\|\/\\)(?:[a-zA-Z0-9\-_\.@]*)interact\.sh\/?(\/|[^.].*)?$

In the commits, I made the change to all regexes that used the optional protocol because they are all incorrect. See the files changed for all templates that are affected.

Template Validation

I've validated this template locally?

  • YES
  • NO

@auto-assign auto-assign bot requested a review from pussycat0x March 1, 2023 21:03
@pussycat0x pussycat0x requested review from DhiyaneshGeek and removed request for pussycat0x March 3, 2023 11:19
@DhiyaneshGeek DhiyaneshGeek added the Done Ready to merge label Mar 3, 2023
@DhiyaneshGeek DhiyaneshGeek merged commit 73bdedf into projectdiscovery:main Mar 3, 2023
@DhiyaneshGeek
Copy link
Member

Hi @JorianWoltjer Thank you so much for updating the template and fixing the false positive

Cheers 🍻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done Ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants