GHSA-f7ph-p5rv-phw2

Suggest an improvement
Source
https://github.com/advisories/GHSA-f7ph-p5rv-phw2
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-f7ph-p5rv-phw2/GHSA-f7ph-p5rv-phw2.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-f7ph-p5rv-phw2
Aliases
Published
2018-11-06T23:13:37Z
Modified
2023-11-08T03:58:11Z
Summary
Cross-Site Scripting in nunjucks
Details

Affected versions of nunjucks do not properly escape specially structured user input in template vars when in auto-escape mode, resulting in a cross-site scripting vulnerability.

Proof of Concept

By using an array for the keys in a template var, escaping is bypassed.

name[]=<script>alert(1)</script>

A full PoC is available in the references section.

Recommendation

Update to version 2.4.3 or later.

Database specific
{
    "cwe_ids":  [
        "CWE-79"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2020-06-16T21:34:04Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

npm / nunjucks

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.4.3

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2018/11/GHSA-f7ph-p5rv-phw2/GHSA-f7ph-p5rv-phw2.json"