mustache@0.8.2

Vulnerabilities 1 via 1 paths
Dependencies
Source npm
Package mustache

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
Status
  • 1
  • 0
  • 0
medium severity

Content Injection due to quoteless attributes

  • Vulnerable module: mustache
  • Introduced through: mustache@0.8.2

Detailed paths

  • Introduced through: mustache@0.8.2
    Remediation: Upgrade to mustache@2.2.1.

Overview

When using attributes without quotes in a mustache template, an attacker can manipulate the input to introduce additional attributes, potentially executing code. This may lead to a Cross-site Scripting (XSS) vulnerability, assuming an attacker can influence the value entered into the template. If the mustache template is used to render user-generated content, this vulnerability may escalate to a persistent XSS vulnerability.

Example

For example, assume mustache was used to display user comments, using the following template: <a href={{email}}>{{name}}</a><pre>{{comment}}</pre>

If an attacker spoofed his email address and provided the following value: jane@evil.org onload=alert(document.cookie)

The resulting HTML would be: <a href=wizard@evil.org onload=alert(document.cookie)>Evil Wizard</a><pre>Busted!</pre>

References