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

Firing Range: Fix All Reverse ClickJacking results #7125

Open
psiinon opened this issue Mar 7, 2022 · 6 comments · May be fixed by zaproxy/zap-extensions#4924
Open

Firing Range: Fix All Reverse ClickJacking results #7125

psiinon opened this issue Mar 7, 2022 · 6 comments · May be fixed by zaproxy/zap-extensions#4924
Assignees
Labels
add-on bounty Issues eligible for a bounty - detailed in the issue FalseNegative

Comments

@psiinon
Copy link
Member

psiinon commented Mar 7, 2022

We run ZAP against Google Firing Range (FR) using a scheduled task and publish the results on https://www.zaproxy.org/docs/scans/firingrange/

There are currently 4 False Negatives, and it looks like they are all closely related and so hopefully one code change will fix all of them.

For more information about improving scan rules see https://www.zaproxy.org/docs/contribute/scan-rules/
In this case the relevant scan rule is linked to from each test.
As always all PRs should include full unit tests.

It is possible that some of the FR tests are no longer valid due to browser security improvements. If you believe this to be the case then please let us know and we will do our best to confirm that.

@psiinon psiinon removed the tracker label Mar 17, 2022
@psiinon psiinon changed the title Firing Range: Improve Reverse ClickJacking results Firing Range: Fix All Reverse ClickJacking results Mar 17, 2022
@psiinon psiinon added the bounty Issues eligible for a bounty - detailed in the issue label Mar 18, 2022
@karthikuj
Copy link
Contributor

If anyone else is not already working on this can I pick this up?

@kingthorin
Copy link
Member

It's all yours 👍

@karthikuj
Copy link
Contributor

I researched about this and I don't think this will be possible in the already existing scan rule Anti-clickjacking Header, I think we can create another ascanrule called Universal Reverse ClickJacking or Same Origin Method Execution.

Here are the POCs for firing range:

  1. In fragment in callback
  2. In fragment in other param
  3. In query in callback
  4. In query in other param

Here's the approach:

  1. Create an ascan rule which will check if the request is a javascript request.
  2. If yes, then check if there is a parameter which is getting reflected and can be exploited for reverse clickjacking by manipulating function names or even creating entire functions.

Let me know if this sounds good or if anyone else has any ideas.
Thank you 😄

@psiinon
Copy link
Member Author

psiinon commented Jul 31, 2023

Sounds good to me.
Out of interest - how are you detecting the fragments like #q in order to attack them?

@karthikuj
Copy link
Contributor

Sounds good to me. Out of interest - how are you detecting the fragments like #q in order to attack them?

No we won't be attacking that request, let me explain:

When you open this link we have a fragmented parameter #q, even if we attack that using an active scan we won't be able to identify the vulnerability since it is creating the <script> element with the JSONP endpoint as src using JS, for that we will have to parse the DOM. Instead of that I'm planning to attack the JSONP endpoint directly and check if there is a parameter which influences the function structure, in this case the JSON endpoint is https://public-firing-range.appspot.com/reverseclickjacking/jsonpendpoint?q=alert&callback=alert whose callback parameter can be modified to run limited JS.

@psiinon
Copy link
Member Author

psiinon commented Aug 3, 2023

Oh nice - look forward to your PR 😁

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
add-on bounty Issues eligible for a bounty - detailed in the issue FalseNegative
Development

Successfully merging a pull request may close this issue.

3 participants