GHSA-5w9c-rv96-fr7g: Faker Removal Of Functional Code Vulnerability

HIGH
Published
Advisory Summary

GHSA-5w9c-rv96-fr7g is a HIGH removal of functional code vulnerability (General Security Weakness) affecting Faker libraries in the npm ecosystem. The issue involves removal of functional code in faker.js. Remediation is available in the latest vendor maintenance releases.

GHSA-5w9c-rv96-fr7g at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-5w9c-rv96-fr7g
Severity HIGH
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Faker
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-5w9c-rv96-fr7g

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 fixed: Latest secure release
npm install faker@Latest secure release
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

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-5w9c-rv96-fr7g, inspect your project dependencies using npm:

npm ls 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 the patched release), your application is affected.

Note: The npm ls 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 General Security Weakness. 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

Faker.js helps users create large amounts of data for testing and development. The maintainer deliberately removed the functional code from this package. This appears to be a purposeful and successful attempt to make the package unusable. This is related to the colors.js [CVE-2021-23567](https://github.com/advisories/GHSA-gh88-3pxp-6fm8). The functional code for this package was forked and can be found [here](https://github.com/faker-js/faker).

GHSA-5w9c-rv96-fr7g Affected Faker Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
faker
npm
6.6.6
All 1 versions
6.6.6
None specified

References

Frequently Asked Questions

What is GHSA-5w9c-rv96-fr7g?
GHSA-5w9c-rv96-fr7g is a security vulnerability in Faker involving Removal of functional code in faker.js under General Security Weakness.
Which Faker versions are affected?
Affected versions include releases prior to current release patches across affected packages: faker.
What version fixes GHSA-5w9c-rv96-fr7g?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is faker affected?
Yes, faker is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What CWE is associated with GHSA-5w9c-rv96-fr7g?
GHSA-5w9c-rv96-fr7g is classified under General Security Weakness.
How can I check npm dependencies for GHSA-5w9c-rv96-fr7g?
Run the dependency tree command: 'npm ls 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-5w9c-rv96-fr7g",
  "modified" : "2022-03-22T20:33:40Z",
  "published" : "2022-03-22T19:28:24Z",
  "aliases" : [ ],
  "summary" : "Removal of functional code in faker.js",
  "details" : "Faker.js helps users create large amounts of data for testing and development. The maintainer deliberately removed the functional code from this package. This appears to be a purposeful and successful attempt to make the package unusable. This is related to the colors.js [CVE-2021-23567](https://github.com/advisories/GHSA-gh88-3pxp-6fm8). \n\nThe functional code for this package was forked and can be found [here](https://github.com/faker-js/faker). ",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "faker"
    },
    "versions" : [ "6.6.6" ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23567"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/issues/285"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/issues/285%23issuecomment-1008212640"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Marak/colors.js/commit/074a0f8ed0c31c35d13d28632bd8a049ff136fb6#diff-92bbac9a308cd5fcf9db165841f2d90ce981baddcb2b1e26cfff170929af3bd1R18"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Marak/Faker.js"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-gh88-3pxp-6fm8"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-COLORS-2331906"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/@faker-js/faker"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/faker"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-03-22T19:28:24Z",
    "nvd_published_at" : null
  }
}