8.3high
Velocity.js: Prototype Pollution in #set path assignment
- Severity
- 8.3high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.61% (higher than 43% of CVEs)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-j658-c2gf-x6pq
Description
Velocity.js is a JavaScript implementation of the Apache Velocity template engine. In 2.1.5 and earlier, a prototype pollution vulnerability was discovered in velocityjs. This issue occurs during the processing of #set directives in Velocity templates. If an application renders a template controlled by an attacker, it is possible to modify Object.prototype, potentially leading to Denial of Service (DoS) or Remote Code Execution (RCE) depending on the server environment.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| shepherdwind velocity.js | <= 2.1.5, up to 2.1.5 | CVE List, NVD |
| velocityjs (npm) | up to 2.1.5 | GitHub Advisory Database |
All scores
| GitHub_M | 8.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L |
| GitHub | 8.3high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L |
| NVD | 9.8critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.
What each source says
CVE List
Velocity.js is a JavaScript implementation of the Apache Velocity template engine. In 2.1.5 and earlier, a prototype pollution vulnerability was discovered in velocityjs. This issue occurs during the processing of #set directives in Velocity templates. If an application renders a template controlled by an attacker, it is possible to modify Object.prototype, potentially leading to Denial of Service (DoS) or Remote Code Execution (RCE) depending on the server environment.
GitHub Advisory Database
Summary
A prototype pollution vulnerability was discovered in Velocity.js <= 2.1.5. This issue occurs during the processing of #set directives in Velocity templates. If an application renders a template controlled by an attacker, it is possible to modify Object.prototype, potentially leading to Denial of Service (DoS) or Remote Code Execution (RCE) depending on the server environment.
Details
The root cause is located in the #set path assignment logic within the source code:
- File: /src/compile/set.ts
- Issue: The engine accepts arbitrary path keys and performs assignments using the logic
(baseRef as Record<string, unknown>)[key] = val.
Because there is no validation or filtering to block sensitive keys such as __proto__, constructor, or prototype, an attacker can traverse the prototype chain and pollute the global Object.prototype.
PoC
const {render} = require('velocityjs');
delete Object.prototype.polluted;
console.log({}.polluted); // ""
render('#set($__proto__.polluted = "hacked")', {});
console.log({}.polluted); // "hacked"
delete Object.prototype.polluted;
Impact
- Vulnerability Type: Prototype Pollution
- Who is impacted: Any application that renders Velocity templates where the template content can be influenced or controlled by untrusted users.
- Severity: High. Prototype pollution can often be used to bypass security controls, cause application crashes (DoS), or be chained with other vulnerabilities to achieve code execution.
NVD (es)
Velocity.js es una implementación JavaScript del motor de plantillas Apache Velocity. En 2.1.5 y versiones anteriores, se descubrió una vulnerabilidad de contaminación de prototipos en velocityjs. Este problema ocurre durante el procesamiento de las directivas #set en las plantillas Velocity. Si una aplicación renderiza una plantilla controlada por un atacante, es posible modificar Object.prototype, lo que podría llevar a una denegación de servicio (DoS) o a una ejecución remota de código (RCE) dependiendo del entorno del servidor.
References
| https://github.com/shepherdwind/velocity.js/security/advisories/GHSA-j658-c2gf-x6pq | exploit, vendor-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-44966 | advisory | |
| https://github.com/shepherdwind/velocity.js | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-44966 changed 2026-06-01 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-j658-c2gf-x6pq changed 2026-06-08 | CC-BY-4.0 |
| NVD | CVE-2026-44966 changed 2026-07-24 | Public domain |