Skip to main content

Velocity.js CVE-2026-44966

CRITICAL
Improperly Controlled Modification of Object Prototype Attributes (Prototype Pollution) (CWE-1321)
2026-05-09 https://github.com/shepherdwind/velocity.js GHSA-j658-c2gf-x6pq
9.8
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint rendering user-supplied template
  2. Delivery
    Submit template with #set($__proto__...) directive
  3. Exploit
    Engine assigns key onto Object.prototype
  4. Execution
    Global prototype polluted process-wide
  5. Impact
    Trigger DoS or chain gadget to RCE

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V3 - Web Frontend Security Prototype pollution prevention
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the application pass attacker-influenced content into the Velocity template body (the template string itself), not merely into the data context - the injected #set directive must be parsed by the engine. The specific trigger is a #set directive referencing a prototype-chain key such as $__proto__, constructor, or prototype (e.g. #set($__proto__.polluted = "hacked")). Full RCE/confidentiality impact is further gated on a suitable prototype-pollution gadget existing in the surrounding server environment ('depending on the server environment'); without such a gadget the realistic outcome is DoS and integrity/security-control corruption. The key limiting factor is deployment shape: applications that only render developer-authored, static templates and keep untrusted input in the data context are not exposed. The library itself requires no authentication (CVSS PR:N), but any application-level auth guarding the template-submission surface further restricts reach.

Impact

The signals conflict and warrant tempering the headline CVSS 9.8. The provided vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H reflects worst-case library misuse where a remote unauthenticated attacker fully controls template input and full C/I/A impact (RCE) is realized. However, that C:H/I:H/A:H rests on the advisory's own hedge - RCE is only possible 'depending on the server environment' and typically requires chaining with a gadget - so confidentiality/RCE impact is conditional rather than guaranteed. The concrete, always-available impact is prototype corruption leading to DoS and integrity/security-control bypass. EPSS is 0.08% (23rd percentile), the CVE is NOT in CISA KEV, and no vendor-released patch exists, but a reliable PoC is public. Net: a legitimate high-severity library flaw for any app that renders untrusted Velocity templates, but real-world priority is bounded by the significant precondition - attacker-controlled template content, which is not the default deployment for most consumers. Prioritize highly only where template bodies can be influenced by untrusted users.

Exploit ScenarioDerived

An attacker submits a crafted Velocity template string (for example via a form field, saved report template, or API parameter that a Node.js app later renders with velocityjs) containing #set($__proto__.polluted = "hacked"). When the server renders it, Object.prototype is polluted globally, crashing or destabilizing the application (DoS) or, if a suitable gadget exists in the server environment, enabling code execution. A working PoC is published in the GHSA advisory, so reproduction is low-effort.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
No patch listed yet 0.1% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – Jul 23, 2026

Prototype pollution in the velocityjs npm package (Velocity.js <= 2.1.5) lets an attacker who controls template content poison Object.prototype through the #set directive, enabling denial of service and, depending on server-side gadgets, remote code execution. The flaw stems from unvalidated path-key assignment in /src/compile/set.ts, which writes attacker-supplied keys directly onto the target object. Publicly available exploit code exists (a working PoC is published in the GHSA advisory); there is no evidence of active exploitation, and the EPSS score is very low at 0.08% (23rd percentile).

Earlier versions of this analysis (1)
v1 May 09, 2026 - 01:16 CVSS 8.3

Prototype pollution in Velocity.js npm package versions <=2.1.5 allows remote attackers to modify Object.prototype through malicious #set directives in templates, enabling denial of service or potential remote code execution when template content is attacker-controlled. Publicly available exploit code exists. EPSS data unavailable, but the low attack complexity (CVSS AC:L), network attack vector (AV:N), and no authentication requirement (PR:N) combined with published POC code indicate elevated risk for applications rendering untrusted Velocity templates.

RemediationAI

No vendor-released patch identified at time of analysis - the advisory records 'fixed in: None', so a version-based upgrade is not yet available; monitor GHSA-j658-c2gf-x6pq (https://github.com/shepherdwind/velocity.js/security/advisories/GHSA-j658-c2gf-x6pq) and the upstream repo https://github.com/shepherdwind/velocity.js for a fixed release. As the primary compensating control, do not render Velocity templates whose content originates from or can be influenced by untrusted users; treat template bodies as code and pass user input only through the data context object rather than the template string. Where rendering of semi-trusted template input is unavoidable, sanitize or reject #set directives and block the literal keys __proto__, constructor, and prototype before rendering, accepting that this breaks any template legitimately using those names. As process-level hardening, run rendering with a frozen prototype (Object.freeze(Object.prototype)) so pollution attempts throw rather than mutate global state - note this can break libraries that rely on a writable prototype and must be tested. Isolating rendering in a separate process or worker limits the blast radius of a successful DoS/pollution.

Affected Packages

npm velocityjs no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Velocity.js is a pure-JavaScript reimplementation of the Apache Velocity templating engine, distributed as the npm package velocityjs (pkg:npm/velocityjs) and used to render server-side templates in Node.js applications. The vulnerability is CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes, i.e. prototype pollution). When the engine processes a #set directive, it resolves the assignment target and writes with the pattern (baseRef as Record<string, unknown>)[key] = val in set.ts without denylisting or filtering dangerous keys such as __proto__, constructor, or prototype. Because JavaScript property access on __proto__ traverses to the shared Object.prototype, a directive like #set($__proto__.polluted = "hacked") mutates the prototype inherited by every object in the process, corrupting global application state.

Know when Prototype Pollution gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 7.7 HIGH

AV:N/PR:N since a remote unauthenticated attacker supplying template content triggers it, but AC:H because meaningful impact depends on attacker-controlled template surface and an environment gadget; guaranteed impact is integrity/DoS, so C:L.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:L/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Analysis Updated
Jul 23, 2026 - 11:38 vuln.today
v2 - CVSS changed
Severity Changed
Jul 23, 2026 - 11:22 NVD
HIGH CRITICAL
CVSS changed
Jul 23, 2026 - 11:22 NVD
8.3 (HIGH) 9.8 (CRITICAL)
CVE Published
May 09, 2026 - 00:40 nvd
HIGH 8.3

DescriptionNVD

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

javascript
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.

Executive ViewAI

Why It Matters

The velocityjs npm package (Velocity.js ≤2.1.5) contains a critical prototype pollution vulnerability enabling remote code execution in applications that process untrusted templates. Although public exploit code is available, active exploitation likelihood remains minimal (EPSS 0.08%), but the absence of a vendor patch forces organizations to implement alternative mitigations immediately rather than applying a standard security update.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: restricting all template processing to verified trusted sources (architectural control), implementing strict input validation and sanitization of all template inputs, isolating Velocity.js processes in containerized or sandboxed environments with minimal privilege, establishing real-time alerting on template compilation errors as exploitation signals, and conducting urgent evaluation of upgrade paths to the latest Velocity.js version or migration to actively maintained alternatives.

Threat Intelligence Overview

EPSS Score
0.1%
Top 77% exploitable
Prevalence
Low
niche npm templating library, limited production deployment footprint
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity CRITICAL
CISA KEV No
Public POC No
EPSS 0.1%
Patch available No
Active threat No
Deciding rule
CRITICAL severity
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

49
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +49
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)NVD

pkg:npm/velocityjs
CVE-2026-34621 HIGH POC
8.6 Apr 11

Prototype pollution in Adobe Acrobat Reader versions 24.001.30356, 26.001.21367 and earlier enables arbitrary code execu

CVE-2021-23450 CRITICAL POC
9.8 Dec 17

All versions of package dojo are vulnerable to Prototype Pollution via the setObject function. Rated critical severity (

CVE-2024-56059 CRITICAL
9.8 Dec 18

Prototype pollution in the farinspace Partners WordPress plugin (versions up to and including 0.2.0) enables remote unau

CVE-2021-23383 CRITICAL POC
9.8 May 04

The package handlebars before 4.7.7 are vulnerable to Prototype Pollution when selecting certain compiling options to co

CVE-2020-7788 CRITICAL POC
9.8 Dec 11

This affects the package ini before 1.3.6. Rated critical severity (CVSS 9.8), this vulnerability is remotely exploitabl

CVE-2020-28271 CRITICAL POC
9.8 Nov 12

Prototype pollution vulnerability in 'deephas' versions 1.0.0 through 1.0.5 allows attacker to cause a denial of service

CVE-2023-38894 CRITICAL POC
9.8 Aug 16

A Prototype Pollution issue in Cronvel Tree-kit v.0.7.4 and before allows a remote attacker to execute arbitrary code vi

CVE-2024-24292 CRITICAL POC
9.8 Mar 28

A Prototype Pollution issue in Aliconnect /sdk v.0.0.6 allows an attacker to execute arbitrary code via the aim function

CVE-2023-26121 CRITICAL POC
10.0 Apr 11

All versions of the package safe-eval are vulnerable to Prototype Pollution via the safeEval function, due to improper s

CVE-2021-23449 CRITICAL POC
10.0 Oct 18

This affects the package vm2 before 3.9.4 via a Prototype Pollution attack vector, which can lead to execution of arbitr

CVE-2024-39011 CRITICAL POC
9.8 Jul 30

Prototype Pollution in chargeover redoc v2.0.9-rc.69 allows attackers to execute arbitrary code or cause a Denial of Ser

CVE-2024-38988 CRITICAL POC
9.8 Mar 28

alizeait unflatto <= 1.0.2 was discovered to contain a prototype pollution via the method exports.unflatto at /dist/inde

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy