Skip to content

JavaScript: Add some new XSS sinks and sources of Next.js (and some extra improvements) #747

Closed
@tyage

Description

@tyage

Query PR

github/codeql#10984
github/codeql#12787
github/codeql#12963
github/codeql#12975

Language

JavaScript

CVE(s) ID list

CVE-2022-0087

CWE

CWE-79

Report

  1. What is the vulnerability?
    Reflected XSS

  2. How does the vulnerability work?
    When a victim visits the URL which contains malicious script, it will be evaluated on victim's browser.

  3. What strategy do you use in your query to find the vulnerability?
    I added Next.js router's query and some args in getServerSideProps function, which is commonly used to receive query/path parameter in URL, as sources.
    JS: Add Next.js parameters as source codeql#10984
    I also added Next.js router's query.push as a sink for XSS.
    JS: Add New XSS sink - Next.js router.push/replace codeql#12787
    I also made some improvements to enable CodeQL detect when the application require submodule package and useRouter comes from other modules.
    JS: Track interfile useRouter codeql#12963
    JS: Support sub modules codeql#12975

  4. How have you reduced the number of false positives?
    I think we won't see any false positives.

Are you planning to discuss this vulnerability submission publicly? (Blog Post, social networks, etc).

  • Yes
  • No

Blog post link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    All For OneSubmissions to the All for One, One for All bounty

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions