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

False positive Enforcement #130

Open
yeln4ts opened this issue Nov 18, 2024 · 4 comments
Open

False positive Enforcement #130

yeln4ts opened this issue Nov 18, 2024 · 4 comments

Comments

@yeln4ts
Copy link

yeln4ts commented Nov 18, 2024

There is a specific case of false positive in the check_bypass function.

I encountered a web application which returns a 302 and redirect to / but also returns the privileged data in the body. So it's categorized as "Enforced" but actual sensitive data is still returned.

I understand that it's there so that it works out of the box without having to define enforcement filters, but it would be great to have an option to just bypass this check and only use enforcement filters.

@Quitten
Copy link
Owner

Quitten commented Nov 24, 2024

Interesting point, Ill make some research and see what is the ideal solution, will keep you posted, thanks for reporting this

@sule01u
Copy link

sule01u commented Nov 28, 2024

authorization/authorization.py

allowed_status_codes = ["200", "302", "301", "303", "307", "308"]
if newStatusCode not in allowed_status_codes:
return self.ENFORCED_STR

What about adding this logic? (other status codes do not seem to need to be checked)

@Quitten
Copy link
Owner

Quitten commented Dec 2, 2024

But if the new status code is still 302, it will return True and will be marked as enforced, im not sure how it helps

@sule01u
Copy link

sule01u commented Dec 2, 2024

But if the new status code is still 302, it will return True and will be marked as enforced, im not sure how it helps

Here's what I think:
Remove the judgment that the response code is equal, and then the response status code is not within the range of the list definition, directly marked as enforced. That is, the bypass in the list is identified by matching the user-defined enforced rule or matching the response body

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

No branches or pull requests

3 participants