GHSA-f7xj-rg7h-mc87: Stylelint Stylelint Has Vulnerability Vulnerability

LOW
Published
Advisory Summary

GHSA-f7xj-rg7h-mc87 is a LOW stylelint has vulnerability vulnerability (General Security Weakness) affecting Stylelint libraries in the npm ecosystem. The issue involves stylelint has vulnerability in semver dependency. Remediation is available by upgrading affected packages to version 15.10.1.

GHSA-f7xj-rg7h-mc87 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-f7xj-rg7h-mc87
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Stylelint
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-f7xj-rg7h-mc87

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

stylelint fixed: 15.10.1
npm install stylelint@15.10.1
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 stylelint

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-f7xj-rg7h-mc87, inspect your project dependencies using npm:

npm ls stylelint

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

Note: The npm ls stylelint 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 Stylelint, 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 Our `meow` dependency (which we use for our CLI) depended on `semver@5.7.1 `. A vulnerability in this version of `semver` was recently identified and surfaced by `npm audit`: Regular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw ### Details Original post by the reporter: "my npm audit show the report semver <7.5.2 Severity: moderate semver vulnerable to Regular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw No fix available And my dependencies tree for semver show your package ├─┬ stylelint@15.9.0 │ └─┬ meow@9.0.0 │ └─┬ read-pkg-up@7.0.1 │ └─┬ read-pkg@5.2.0 │ └─┬ normalize-package-data@2.5.0 │ └── semver@5.7.1 deduped I found that meow@10.x.x contains normalize-package-data@5 and I can fix this vulnerability because it uses semver@7. But I can't update meow to the new major version because your package doesn't allow it." Update your package to use the 'meow' version >=10" ### PoC N/A ### Impact We anticipate the impact to be low as Stylelint is a dev tool and `meow` is only used on the CLI pathway. --- ⬇️ EDITED AFTER PUBLISHED ⬇️ ### Security fix backported to older `semver` versions The same security fix has been backported to older `semver` versions of 5.x and 6.x. See the [CVE-2022-25883](https://github.com/advisories/GHSA-c2qf-rxjj-qqgw) details. So, you can fix this vulnerability by just updating `semver` in your project's dependency tree, instead of updating `stylelint`. For details, see the example: `package.json`: ```json { "dependencies": { "stylelint": "15.10.0" } } ``` Run `npm audit` (here is no alert for `semver`): ```console $ npm ci ... $ npm audit ... stylelint 8.0.0 - 15.10.0 Stylelint has vulnerability in semver dependency - https://github.com/advisories/GHSA-f7xj-rg7h-mc87 fix available via `npm audit fix --force` Will install stylelint@15.10.1, which is outside the stated dependency range node_modules/stylelint 1 low severity vulnerability ... $ npm ls semver ... └─┬ stylelint@15.10.0 └─┬ meow@9.0.0 ├─┬ normalize-package-data@3.0.3 │ └── semver@7.5.4 └─┬ read-pkg-up@7.0.1 └─┬ read-pkg@5.2.0 └─┬ normalize-package-data@2.5.0 └── semver@5.7.2 ```

GHSA-f7xj-rg7h-mc87 Affected Stylelint Versions

1 component(s)
Fixed Versions:
15.10.1
Product / Package Ecosystem Affected Versions Fixed Version
stylelint
npm
≥ 8.0.0
< 15.10.1
15.10.1

References

Frequently Asked Questions

What is GHSA-f7xj-rg7h-mc87?
GHSA-f7xj-rg7h-mc87 is a security vulnerability in Stylelint involving Stylelint has vulnerability in semver dependency under General Security Weakness.
Which Stylelint versions are affected?
Affected versions include releases prior to 15.10.1 across affected packages: stylelint.
What version fixes GHSA-f7xj-rg7h-mc87?
Upgrading to 15.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is stylelint affected?
Yes, stylelint is affected in releases prior to 15.10.1. Upgrade your dependency to 15.10.1 or later.
What CWE is associated with GHSA-f7xj-rg7h-mc87?
GHSA-f7xj-rg7h-mc87 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-f7xj-rg7h-mc87?
Run the dependency tree command: 'npm ls stylelint'. 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-f7xj-rg7h-mc87",
  "modified" : "2023-07-13T16:49:53Z",
  "published" : "2023-07-07T20:32:55Z",
  "withdrawn" : "2023-07-13T16:49:53Z",
  "aliases" : [ ],
  "summary" : "Stylelint has vulnerability in semver dependency",
  "details" : "### Summary\n\nOur `meow` dependency (which we use for our CLI) depended on `semver@5.7.1 `. A vulnerability in this version of `semver` was recently identified and surfaced by `npm audit`:\n\nRegular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw\n\n### Details\n\nOriginal post by the reporter:\n\n\"my npm audit show the report\n\nsemver  <7.5.2\nSeverity: moderate\nsemver vulnerable to Regular Expression Denial of Service - https://github.com/advisories/GHSA-c2qf-rxjj-qqgw\nNo fix available\n\nAnd my dependencies tree for semver show your package\n\n├─┬ stylelint@15.9.0\n│   └─┬ meow@9.0.0\n│        └─┬ read-pkg-up@7.0.1\n│             └─┬ read-pkg@5.2.0\n│                  └─┬ normalize-package-data@2.5.0\n│                       └── semver@5.7.1 deduped\n\nI found that meow@10.x.x contains normalize-package-data@5 and I can fix this vulnerability because it uses semver@7.  But I can't update meow to the new major version because your package doesn't allow it.\"\n\nUpdate your package to use the 'meow' version >=10\"\n\n### PoC\n\nN/A\n\n### Impact\n\nWe anticipate the impact to be low as Stylelint is a dev tool and `meow` is only used on the CLI pathway. \n\n---\n\n⬇️  EDITED AFTER PUBLISHED ⬇️ \n\n### Security fix backported to older `semver` versions\n\nThe same security fix has been backported to older `semver` versions of 5.x and 6.x. See the [CVE-2022-25883](https://github.com/advisories/GHSA-c2qf-rxjj-qqgw) details.\n\nSo, you can fix this vulnerability by just updating `semver` in your project's dependency tree, instead of updating `stylelint`. For details, see the example:\n\n`package.json`:\n\n```json\n{\n  \"dependencies\": {\n    \"stylelint\": \"15.10.0\"\n  }\n}\n```\n\nRun `npm audit` (here is no alert for `semver`):\n\n```console\n$ npm ci\n...\n\n$ npm audit\n...\nstylelint  8.0.0 - 15.10.0\nStylelint has vulnerability in semver dependency - https://github.com/advisories/GHSA-f7xj-rg7h-mc87\nfix available via `npm audit fix --force`\nWill install stylelint@15.10.1, which is outside the stated dependency range\nnode_modules/stylelint\n\n1 low severity vulnerability\n...\n\n$ npm ls semver\n...\n└─┬ stylelint@15.10.0\n  └─┬ meow@9.0.0\n    ├─┬ normalize-package-data@3.0.3\n    │ └── semver@7.5.4\n    └─┬ read-pkg-up@7.0.1\n      └─┬ read-pkg@5.2.0\n        └─┬ normalize-package-data@2.5.0\n          └── semver@5.7.2\n```\n\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "stylelint"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.0.0"
      }, {
        "fixed" : "15.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/stylelint/stylelint/security/advisories/GHSA-f7xj-rg7h-mc87"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stylelint/stylelint/pull/7043"
  }, {
    "type" : "ADVISORY",
    "url" : "https://github.com/advisories/GHSA-c2qf-rxjj-qqgw"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/stylelint/stylelint"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/stylelint/stylelint/releases/tag/15.10.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-07T20:32:55Z",
    "nvd_published_at" : null
  }
}