Vulnerabilities in pkg:npm/@faker-js/faker

PACKAGE
Advisory Identifier: GHSA-qxc2-j82w-r537
Advisory Summary

CVE-2026-73231 is a HIGH (CVSS 7.8) helpers.fake exploitable into arbritary code vulnerability (CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')) affecting Faker libraries in the npm ecosystem. The issue involves helpers.fake exploitable into arbritary code execution. Remediation is available by upgrading affected packages to version 10.5.0.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@faker-js/faker

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@faker-js/faker. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-qxc2-j82w-r537 CVE-2026-73231 HIGH Faker: helpers.fake exploitable into arbritary code execution

CVE-2026-73231 at a Glance

CVE Identifier CVE-2026-73231
GHSA Identifier GHSA-qxc2-j82w-r537
Severity HIGH
CVSS v3.1 Base Score 7.8
CWE Classification CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')
Affected Product Faker
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 7.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-73231

To remediate this vulnerability, upgrade all affected Faker dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@faker-js/faker fixed: 10.5.0
npm install @faker-js/faker@10.5.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @faker-js/faker

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-73231, inspect your project dependencies using npm:

npm ls @faker-js/faker

Analyze the terminal output to locate any version of Faker in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 10.5.0), your application is affected.

Note: The npm ls @faker-js/faker command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection'), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval"). In Faker, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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 ````ts 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.

CVE-2026-73231 Affected Faker Versions

1 component(s)
Fixed Versions:
10.5.0
Product / Package Ecosystem Affected Versions Fixed Version
@faker-js/faker
npm
< 10.5.0
10.5.0

References

Frequently Asked Questions

What is CVE-2026-73231?
CVE-2026-73231 is a security vulnerability in Faker involving helpers.fake exploitable into arbritary code execution under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection').
Which Faker versions are affected?
Affected versions include releases prior to 10.5.0 across affected packages: @faker-js/faker.
What version fixes CVE-2026-73231?
Upgrading to 10.5.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @faker-js/faker affected?
Yes, @faker-js/faker is affected in releases prior to 10.5.0. Upgrade your dependency to 10.5.0 or later.
What is the CVSS score of CVE-2026-73231?
CVE-2026-73231 has a CVSS v3.1 base score of 7.8 (HIGH) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-73231?
CVE-2026-73231 is classified under CWE-95: Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection') (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes code syntax before using the input in a dynamic evaluation call (e.g. "eval").).
How can I check npm dependencies for CVE-2026-73231?
Run the dependency tree command: 'npm ls @faker-js/faker'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-qxc2-j82w-r537",
  "modified" : "2026-09-02T14:20:14Z",
  "published" : "2026-09-02T14:20:14Z",
  "aliases" : [ "CVE-2026-73231" ],
  "summary" : "Faker: helpers.fake exploitable into arbritary code execution",
  "details" : "### Summary\n\n`faker.helpers.fake` can be tricked into arbritary code execution.\n\n### Details\n\nfakeEval.resolveProperty resolves properties on functions itself instead of resolving the nested function first.\nThis can be addressed by recursively calling resolveProperty instead of accessing the property after one iteration.\n\n### PoC\n\nGo to https://fakerjs.dev/\nOpen Browser console and run\n\n````ts\nawait enableFaker(); // or import faker\nfaker.rawDefinitions.test = (() => () => {}); // Any function that returns a function\nfaker.helpers.fake(`{{test.constructor(alert('PowerLevel: Eval'))}}`);\n````\n\n### Impact\n\nThe Fake method claims:\n\n> It is also NOT possible to use any non-faker methods or plain javascript in such patterns.\n\nWhich is objectively false, since any global gets fully accessible in the fake string.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@faker-js/faker"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "10.5.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 10.4.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/faker-js/faker/security/advisories/GHSA-qxc2-j82w-r537"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-73231"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faker-js/faker/pull/3852"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faker-js/faker/commit/54586208f904012f57c50b46cc1ad32bcbe4bfb7"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/faker-js/faker"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/faker-js/faker/releases/tag/v10.5.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-95" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-02T14:20:14Z",
    "nvd_published_at" : "2026-08-11T20:18:48Z"
  }
}