CVE-2021-23369:
Remote code execution in handlebars when compiling templates
9.8
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.88393%
CWE
Published
5/6/2021
Updated
11/29/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
handlebars | npm | < 4.7.7 | 4.7.7 |
org.webjars:handlebars | maven | < 4.7.7 | 4.7.7 |
org.webjars.npm:handlebars | maven | < 4.7.7 | 4.7.7 |
org.webjars.bowergithub.wycats:handlebars.js | maven | < 4.7.7 | 4.7.7 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from two key issues: 1) Insecure property access in template runtime that allowed prototype pollution via direct obj[name] access, and 2) Unsafe code generation in the compiler that didn't properly escape property names. The fixes in commits b6d3de7 and f058970 address these by introducing container.lookupProperty (which checks own properties) and JSON.stringify escaping respectively. The Snyk PoC demonstrates exploitation through prototype manipulation in strict mode, which would leverage these vulnerable code paths.