Skip to content

JS: split request forgery query into server-side and client-side variants#8054

Merged
kaeluka merged 12 commits into
github:mainfrom
asgerf:js/split-request-forgery
Feb 23, 2022
Merged

JS: split request forgery query into server-side and client-side variants#8054
kaeluka merged 12 commits into
github:mainfrom
asgerf:js/split-request-forgery

Conversation

@asgerf

@asgerf asgerf commented Feb 16, 2022

Copy link
Copy Markdown
Contributor

The RequestForgery query was previously @precision medium and I'd like to raise this to high.

However, it flags both server-side request forgery (SSRF) and client-side request forgery (which is the same, except the browser/client is sending the request) and I only want to promote the actual SSRF variant.

The client-side variant tends to be much less severe than SSRF, and as far as I can tell, it doesn't have a dedicated CWE number like SSRF. Even the name is something I had to make up.

Note that what I call "client-side request forgery" should not to be confused with cross-site request forgery, which is what CSRF and XSRF typically stand for. We could also call it FrontendRequestForgery if we want to avoid confusion with CSRF. 🤷

The query has been split as follows:

  • js/request-forgery is now specific to SSRF and promoted to @precision high, which means being shown by default.
  • To avoid regressing on overall coverage, a new query js/client-side-request-forgery covers the client-side cases, and remains in security-extended.
  • The new query has a security-severity of 5.0. There's no real CWE number to derive this from, so I chose it to be 1 point below XSS, as it can sometimes lead to XSS, and it is unlikely to escalate to anything worse than that.

The old qhelp and metadata was a bit unclear on what exactly causes request forgery to happen. I rewrote parts of it to emphasize how the different parts of the the URL play a role in request forgery.

The metadata changes were also ported to other languages, and involve a full @name change to Server-side request forgery. The only non-JS changes are in 38afb0c. Other language teams: please review and let me know what you think.

Evaluation looks fine. 5 results were moved from js/request-forgery to js/client-side-request-forgery.

@asgerf asgerf force-pushed the js/split-request-forgery branch 2 times, most recently from 4c719b7 to a73b2fc Compare February 17, 2022 07:55
@asgerf asgerf force-pushed the js/split-request-forgery branch from a73b2fc to 69995d5 Compare February 17, 2022 08:07
@asgerf asgerf marked this pull request as ready for review February 17, 2022 12:05
@asgerf asgerf requested review from a team as code owners February 17, 2022 12:05
michaelnebel
michaelnebel previously approved these changes Feb 17, 2022

@michaelnebel michaelnebel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C#. LGTM.

@erik-krogh erik-krogh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍
I just got a few minor comments.

Co-authored-by: Erik Krogh Kristensen <erik-krogh@github.com>
@erik-krogh erik-krogh added the ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. label Feb 22, 2022
</p>

<p>
In example below, the input has been restricted to a number so the endpoint cannot be altered:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In example below, the input has been restricted to a number so the endpoint cannot be altered:
In example below, the input has been restricted to a number so that the endpoint cannot be altered:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the PR was merged a bit early. I'll open a new PR with this change

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opened in #8186

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C# documentation JS ready-for-doc-review This PR requires and is ready for review from the GitHub docs team. Ruby

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants