Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXczdzgtMzdqdi0yYzU4

Cross-Site Scripting in mustache

Versions of mustache prior to 2.2.1 are affected by a cross-site scripting vulnerability when attributes in mustache templates are not quoted.

Example

Template:
<a href={{foo}}/>

Input:
{ 'foo' : 'test.com onload=alert(1)'}

Rendered result:
<a href=test.com onload=alert(1)/>

Recommendation

Update to version 2.2.1 or later.
Alternatively, ensure that all attributes in hmustache templates are encapsulated with quotes.

Permalink: https://github.com/advisories/GHSA-w3w8-37jv-2c58
JSON: https://advisories.ecosyste.ms/api/v1/advisories/MDE2OlNlY3VyaXR5QWR2aXNvcnlHSFNBLXczdzgtMzdqdi0yYzU4
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: over 6 years ago
Updated: over 1 year ago


CVSS Score: 6.1
CVSS vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Identifiers: GHSA-w3w8-37jv-2c58, CVE-2015-8862
References: Repository: https://github.com/janl/mustache.js
Blast Radius: 32.6

Affected Packages

npm:mustache
Dependent packages: 5,281
Dependent repositories: 224,460
Downloads: 19,160,441 last month
Affected Version Ranges: < 2.2.1
Fixed in: 2.2.1
All affected versions: 0.4.0, 0.5.2, 0.6.0, 0.7.0, 0.7.1, 0.7.2, 0.7.3, 0.8.0, 0.8.1, 0.8.2, 1.0.0, 1.1.0, 1.2.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.2.0
All unaffected versions: 2.2.1, 2.3.0, 2.3.1, 2.3.2, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.1.0, 3.2.0, 3.2.1, 4.0.0, 4.0.1, 4.1.0, 4.2.0