Prototype Pollution in handlebars

handlebars Updated 02 Oct 2025

Summary

04/09/2020
HIGH
Yes i
High
Not published

GHSA-g9r4-xpmj-mj65: Prototype Pollution in handlebars. Affects handlebars across 2 version ranges.

< 3.0.8 >= 4.0.0, < 4.5.3

Fixed in 3.0.8 or 4.5.3, depending on the release line you run. 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 Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

Handlebars is a popular templating engine for JavaScript that allows developers to create dynamic HTML templates. It is widely used in web development frameworks and applications. However, versions of handlebars prior to 3.0.8 or 4.5.3 are vulnerable to prototype pollution. This means that an attacker can manipulate the Object prototype through a malicious template, potentially leading to application crashes or the execution of arbitrary code.

Vulnerability Detail

The vulnerability in handlebars arises from its handling of templates. By crafting a malicious template, an attacker can modify or add properties to the Object prototype. This can have severe consequences, as it allows the attacker to manipulate the behavior of the entire application. They can crash the application by modifying critical properties or execute arbitrary code by adding malicious functions to the prototype. This vulnerability poses a significant risk to the security and stability of applications that use vulnerable versions of handlebars.

How To Fix

Latest published version: 4.7.10 as of 22 Oct 2026

npm install handlebars@4.7.10

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 3.0.8 3.0.8
    npm install handlebars@3.0.8
  • >= 4.0.0, < 4.5.3 4.5.3
    npm install handlebars@4.5.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Conclusion

Prototype pollution in handlebars is a critical vulnerability that allows attackers to manipulate the Object prototype through malicious templates. This can lead to application crashes or the execution of arbitrary code. To protect your application, it is essential to upgrade to version 3.0.8, 4.5.3, or any later release. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for handlebars →

Share this vulnerability

FAQ

Handlebars is a templating engine for JavaScript that allows developers to create dynamic HTML templates. It is widely used in web development frameworks and applications.

Prototype pollution is a vulnerability that allows an attacker to modify the behavior of JavaScript objects by manipulating their prototypes. In the case of handlebars, it allows an attacker to modify or add properties to the Object prototype, potentially leading to application crashes or the execution of arbitrary code.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply provide your package-lock.json file, and Vulert will analyze it for any open-source vulnerabilities, including this handlebars prototype pollution issue.

No, there are no known workarounds for this vulnerability. It is recommended to upgrade to a secure version of handlebars to mitigate the risk.

There are no known public exploits for this vulnerability at the moment. However, it is crucial to update to a secure version of handlebars as soon as possible to prevent any potential attacks.

Related vulnerabilities

Recent vulnerabilities recorded for handlebars.

How To Fix

Latest published version: 4.7.10 as of 22 Oct 2026

npm install handlebars@4.7.10

Upgrading to it may include breaking changes; the versions below are the minimum fixed release for this vulnerability.

If you can't move to the latest

The minimum fixed version depends on the release line you run.

  • < 3.0.8 3.0.8
    npm install handlebars@3.0.8
  • >= 4.0.0, < 4.5.3 4.5.3
    npm install handlebars@4.5.3

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. 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