Client-side cross-site scripting

Open
#3 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Stale
Tech stack
javascript
Domain
security

Research direction

Start with the reported lines in examples/Xss.js and examples/Xss2.js, then inspect how user-provided values reach the DOM. Run the repository's CodeQL scan and consider the issue complete when the js/xss findings for both examples are resolved.

Written by the indexing model from the issue text.

Description

Rules

js/xss (severity: error)

Client-side cross-site scripting

Details
{
    "driver": {
        "name": "CodeQL command-line toolchain",
        "organization": "GitHub",
        "semanticVersion": "2.2.4",
        "rules": [
            {
                "id": "js/xss",
                "name": "js/xss",
                "shortDescription": {
                    "text": "Client-side cross-site scripting"
                },
                "fullDescription": {
                    "text": "Writing user input directly to the DOM allows for a cross-site scripting vulnerability."
                },
                "defaultConfiguration": {
                    "level": "error"
                },
                "properties": {
                    "tags": [
                        "security",
                        "external/cwe/cwe-079",
                        "external/cwe/cwe-116"
                    ],
                    "kind": "path-problem",
                    "precision": "high",
                    "name": "Client-side cross-site scripting",
                    "description": "Writing user input directly to the DOM allows for\n              a cross-site scripting vulnerability.",
                    "id": "js/xss",
                    "problem.severity": "error"
                }
            }
        ]
    }
}

Results

  • js/xss: Cross-site scripting vulnerability due to [user-provided value](1).

https://github.com/azu/codeql-scan-example/blob/356bd49080c765cf1d81c97e20e9c045cad28352/examples/Xss.js#L4

  • js/xss: Cross-site scripting vulnerability due to [user-provided value](1).

https://github.com/azu/codeql-scan-example/blob/356bd49080c765cf1d81c97e20e9c045cad28352/examples/Xss2.js#L4

Dominant language
CodeQL
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from azu/codeql-scan-example

All issues in azu/codeql-scan-example

Similar issues

More Security issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.