Skip to main content

Velocity.js CVE-2026-73649

| EUVDEUVD-2026-58192 CRITICAL
Code Injection (CWE-94)
2026-08-13 security-advisories@github.com GHSA-7gfh-x38p-prh3
9.8
CVSS 3.1 · Vendor: github
View

Attack ChainAIDerived

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

  1. Access
    Reach template-render endpoint
  2. Delivery
    Submit crafted Velocity template
  3. Exploit
    Traverse $x.constructor.constructor to Function
  4. Execution
    Compile attacker string as function
  5. Persist
    Invoke function via #set
  6. Impact
    Execute shell command in server process

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
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

The one hard prerequisite is that the target application must render attacker-controlled Velocity.js template source through velocityjs <= 2.1.6 (e.g., velocity.render() on untrusted input); given that, exploitation needs no authentication, no user interaction, and works against default library behavior (AV:N/AC:L/PR:N/UI:N). The exploit primitive is a property-read chain ($x.constructor.constructor) reaching the Function constructor, so no special engine configuration is required - the vulnerable code path is on by default. What LIMITS exploitation: applications that only render trusted, developer-authored templates are not exploitable, and deployments already on 2.1.7+ are fixed; note that having applied the earlier CVE-2026-44966 fix does NOT limit exposure because that patch only guarded the #set assignment target, not property reads.

Impact

This is a genuine high-priority issue rather than a paper-high CVSS. The CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N, C:H/I:H/A:H, score 9.8) is consistent with the description: any server rendering attacker-controlled templates gets unauthenticated remote code execution with no user interaction. That signal is reinforced by a published, vendor-verified PoC and a clear, deterministic exploit primitive (Function constructor), which typically drives real-world exploitation probability up over time. The key mitigating caveat is the exploitation precondition - the application must actually pass untrusted input into Velocity.js templates; deployments that only render trusted, developer-authored templates are not exposed, so the true blast radius depends on how each app uses the library. No EPSS score and no SSVC decision data were provided in the input, and the CVE is not listed in CISA KEV, so 'automatable/technical impact' framing is inferred from the CVSS vector and PoC rather than confirmed by a scoring authority. Net: treat as urgent for any app rendering user-supplied templates; lower urgency where template sources are fully trusted.

Exploit ScenarioDerived

An application exposes a feature that renders user-submitted Velocity templates (e.g., customizable email/notification templates or a reporting layout). An unauthenticated attacker submits a template like '#set($f=$x.constructor.constructor("return process.mainModule.require('child_process').execSync('whoami').toString()"))#set($r=$f())$r', which resolves to the Function constructor and executes a shell command in the server process. A working PoC exists in the GHSA advisory (vendor-verified on v2.1.6, Node.js v24.15.0), and with AV:N/AC:L/PR:N/UI:N the attack is a single unauthenticated request against a vulnerable rendering endpoint.

Act Now Prioritize within 24-48h. Why: CRITICAL severity + public POC available.
Patch available 0.5% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Aug 13, 2026

Remote code execution in Velocity.js (npm 'velocityjs') versions <= 2.1.6 lets an attacker who controls template content reach the JavaScript Function constructor and run arbitrary code in the server process. The earlier CVE-2026-44966/GHSA-j658-c2gf-x6pq fix only filtered constructor/__proto__/prototype in the #set assignment target, leaving property-read expressions in references.ts unguarded, so this is a straightforward bypass. Publicly available exploit code exists (a working PoC is published in the GHSA advisory and was vendor-verified on v2.1.6); no confirmed active exploitation (not in CISA KEV).

RemediationAI

Vendor-released patch: upgrade velocityjs to 2.1.7 or later (npm install velocityjs@^2.1.7 and rebuild/redeploy), which centralizes prototype-key filtering in src/compile/prototype-guard.ts and applies it to both #set targets and property-read expressions; see GHSA-7gfh-x38p-prh3, PR #192, and release v2.1.7. If you cannot upgrade immediately, the highest-value compensating control is to stop rendering attacker-controlled template source entirely - treat templates as trusted code and never build them from user input (side effect: removes any user-templating feature). Where user templating must remain, sandbox rendering in a separate least-privilege worker/process or container with no filesystem, network egress, or cloud-credential access (side effect: added deployment complexity and latency), and/or pre-filter template input to reject references containing 'constructor', '__proto__', or 'prototype' (side effect: fragile blocklisting that can be bypassed and may break legitimate templates). These are stopgaps; upgrading to 2.1.7 is the reliable fix.

Affected VersionsENISA

velocity.js < 2.1.7

Affected Packages

npm velocityjs fix: 2.1.7
euvd velocity_js fix: 2.1.7

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 2 packages in npm, euvd

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 template engine, commonly embedded in Node.js applications to render VTL templates. The root cause is a classic CWE-94 Code Injection through JavaScript prototype-chain traversal: the getReferences() evaluation path calls getAttributes(), which performs raw property access (baseRef[property.id]) with no key filtering. An attacker-supplied reference such as $x.constructor.constructor walks {} → Object → Function, obtaining the Function constructor, which compiles and executes an arbitrary string as code. Per the CPE/package data the affected component is npm 'velocityjs' <= 2.1.6; the fix in 2.1.7 centralizes filtering in a new src/compile/prototype-guard.ts module (isBlockedPrototypeKey/hasBlockedUnknownPrototypePath) that both set.ts and references.ts now invoke, blocking __proto__ everywhere, prototype on function objects, and constructor/prototype traversal that would fall through to inherited prototype-chain properties.

Know when the next one hits your stack

  • 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

Vendor (github) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

Unauthenticated remote code execution via attacker-controlled template with no user interaction yields AV:N/AC:L/PR:N/UI:N and full C:H/I:H/A:H; scope unchanged as code runs in the same server process.

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

Primary rating from Vendor (github).

CVSS VectorVendor: github

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

Lifecycle Timeline

2
Patch available
Aug 13, 2026 - 19:04 EUVD
CVE Published
Aug 13, 2026 - 18:18 cve.org
CRITICAL 9.8

DescriptionCVE.org

Velocity.js is a JavaScript implementation of the Apache Velocity template engine. Prior to 2.1.7, the earlier fix for CVE-2026-44966 filtered constructor, __proto__, and prototype only in the #set assignment handler in src/compile/set.ts, while property-read expressions in src/compile/references.ts remained unfiltered. The getReferences() flow called getAttributes(), whose property access allowed an attacker-controlled template to traverse constructor.constructor to the JavaScript Function constructor. The #set handler validated only the assignment target and did not inspect the right-hand property-read expression, allowing arbitrary shell commands, environment-variable access, cloud-credential access, and internal-network access in the server process. This issue is fixed in version 2.1.7.

Executive ViewAI

Why It Matters

Velocity.js (npm package 'velocityjs') versions 2.1.6 and earlier contain a critical remote code execution vulnerability allowing attackers to execute arbitrary code through malicious template content. Organizations using Velocity.js for server-side template rendering face immediate risk of complete system compromise. No patch is currently available, requiring emergency manual containment measures.

Business Impact: Severe
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations include: restricting template content to trusted internal sources only, disabling user-controlled template input, running template processing in isolated sandboxed environments with minimal privileges, implementing strict access controls on systems accepting template input, and maintaining network segmentation to limit blast radius of any compromise.

Threat Intelligence Overview

EPSS Score
0.5%
Top 60% exploitable
Prevalence
Medium
popular npm Velocity template engine, but exposure limited to untrusted-template apps
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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 Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity + public POC available
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
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Very High
Technical Impact
Total

Priority Score

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

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

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

Vendor StatusVendor

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