Cross-Site Scripting Vulnerability in mustache.js: CVE-2015-8861

mustache.js Updated 02 Oct 2025

Summary

23/01/2017
N/A
No i
Unrated
Not published

DEBIAN-CVE-2015-8861: The handlebars package before 4.0.0 for Node.js allows remote attackers to conduct cross-site scripting (XSS) attacks by leveraging a template with an attribute that is not quoted. Affects mustache.js versions 2.3.2-2 – 3.0.1-1. No fix is published. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

mustache.js is a logic-less template syntax that allows developers to create dynamic HTML content in web applications. It is widely used in Node.js environments for rendering templates. However, prior to version 4.0.0, mustache.js was vulnerable to cross-site scripting (XSS) attacks due to improper handling of unquoted attributes in templates, which could allow attackers to inject malicious scripts.

Vulnerability Detail

The vulnerability identified as CVE-2015-8861 affects the handlebars package, which is a dependency of mustache.js. It allows remote attackers to conduct XSS attacks by leveraging a template that contains an attribute not enclosed in quotes. This oversight can lead to the execution of arbitrary JavaScript in the context of the user's browser, potentially compromising sensitive information and user sessions.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a temporary workaround, ensure that all attributes in your templates are properly quoted. For example, instead of writing: <div data-attribute=someValue>, use <div data-attribute='someValue'>. This practice can help mitigate the risk of XSS attacks until the package is updated.

Conclusion

The CVE-2015-8861 vulnerability in mustache.js poses a significant risk due to its potential for XSS attacks. It is crucial for developers to update to the latest version of the package and implement best practices in template syntax to safeguard their applications.

See every vulnerability recorded for mustache.js →

Share this vulnerability

FAQ

CVE-2015-8861 is a security vulnerability in the handlebars package used by mustache.js that allows for cross-site scripting (XSS) attacks.

You can check if your application is affected by using the Vulert playground at Vulert Scanner, which analyzes your manifest file for vulnerabilities.

The primary risk is that attackers can execute arbitrary JavaScript in the user's browser, potentially leading to data theft, session hijacking, or other malicious actions.

Yes, updating mustache.js to the latest version will apply the necessary patches to fix this vulnerability.

If an immediate update is not possible, ensure that all template attributes are quoted to reduce the risk of XSS attacks.

Related vulnerabilities

Recent vulnerabilities recorded for mustache.js.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback