CVE-2026-73231 is a high-severity (CVSS 7.8) CWE-95 vulnerability in @faker-js/faker. A fix is available for @faker-js/faker — see the affected versions and patch details below.
Faker: helpers.fake exploitable into arbritary code execution
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- A successful exploit gives an attacker total control of the affected component, not partial access.
Exploitation and automatability from CISA’s SSVC triage for CVE-2026-73231.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
Where this sits among everything scored
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@faker-js/fakernpmDescription
Summary
faker.helpers.fake can be tricked into arbritary code execution.
Details
fakeEval.resolveProperty resolves properties on functions itself instead of resolving the nested function first. This can be addressed by recursively calling resolveProperty instead of accessing the property after one iteration.
PoC
Go to https://fakerjs.dev/ Open Browser console and run
await enableFaker(); // or import faker
faker.rawDefinitions.test = (() => () => {}); // Any function that returns a function
faker.helpers.fake(`{{test.constructor(alert('PowerLevel: Eval'))}}`);
Impact
The Fake method claims:
It is also NOT possible to use any non-faker methods or plain javascript in such patterns.
Which is objectively false, since any global gets fully accessible in the fake string.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @faker-js/faker | all versions | 10.5.0npm install @faker-js/faker@10.5.0 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @faker-js/faker, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @faker-js/faker to 10.5.0 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2026-73231 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
Red Hat products ship @faker-js/faker as a bundled dependency. Faker is typically used for test data generation rather than in production code paths, which limits the practical attack surface. However, if attacker-controlled input reaches the faker.helpers.fake() method, arbitrary code execution is possible. Upgrade…
Do not pass untrusted or user-controlled input to the faker.helpers.fake() method. If Faker is only used for testing, ensure it is not included in production builds. Upgrading to @faker-js/faker version 10.5.0 resolves the underlying code injection vulnerability.Source: Red Hat security advisory for CVE-2026-73231 (CC BY 4.0)
Frequently Asked Questions
Is CVE-2026-73231 in your dependencies?
Find it across npm, including transitive dependencies.