CVE-2021-27405: @progfay/scrapbox parser Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-9fhw-r42p-5c7r
CVSS 4.3
CWE-400
Published
Advisory Summary

CVE-2021-27405 is a MODERATE (CVSS 4.3) denial of service vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting @progfay/scrapbox parser libraries in the npm ecosystem. The issue involves regular expression denial of service in @progfay/scrapbox-parser. Remediation is available by upgrading affected packages to version 6.0.3, 7.0.2.

CVE-2021-27405 at a Glance

CVE Identifier CVE-2021-27405
GHSA Identifier GHSA-9fhw-r42p-5c7r
Severity MODERATE
CVSS v3.1 Base Score 4.3
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product @progfay/scrapbox parser
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 4.3

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

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

How to Fix CVE-2021-27405

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

@progfay/scrapbox-parser fixed: 6.0.3
npm install @progfay/scrapbox-parser@6.0.3
@progfay/scrapbox-parser fixed: 7.0.2
npm install @progfay/scrapbox-parser@7.0.2
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 @progfay/scrapbox-parser

How to Check if You Are Affected

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

npm ls @progfay/scrapbox-parser

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

Note: The npm ls @progfay/scrapbox-parser 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-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In @progfay/scrapbox parser, 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

### Impact A [Regular expression Denial of Service](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) flaw was found in the @progfay/scrapbox-parser package before 6.0.3, 7.0.2 for Node.js. The attacker that is able to be parsed a specially crafted text may cause the application to consume an excessive amount of CPU. ### Patches Upgrade to version 6.0.3, 7.0.2 or later. ### Workarounds Avoid to parse text with a lot of `[` chars. ### References * https://github.com/progfay/scrapbox-parser/pull/519 * https://github.com/progfay/scrapbox-parser/pull/539 * https://github.com/progfay/scrapbox-parser/pull/540 * https://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-27405 * https://snyk.io/vuln/SNYK-JS-PROGFAYSCRAPBOXPARSER-1076803 ### For more information If you have any questions or comments about this advisory: * Open an issue in [github.com/progfay/scrapbox-parser](https://github.com/progfay/scrapbox-parser/issues)

CVE-2021-27405 Affected @progfay/scrapbox parser Versions

2 component(s)
Fixed Versions:
6.0.37.0.2
Product / Package Ecosystem Affected Versions Fixed Version
@progfay/scrapbox-parser
npm
< 6.0.3
6.0.3
@progfay/scrapbox-parser
npm
≥ 7.0.0
< 7.0.2
7.0.2

References

Frequently Asked Questions

What is CVE-2021-27405?
CVE-2021-27405 is a security vulnerability in @progfay/scrapbox parser involving Regular expression Denial of Service in @progfay/scrapbox-parser under CWE-400: Uncontrolled Resource Consumption.
Which @progfay/scrapbox parser versions are affected?
Affected versions include releases prior to 6.0.3, 7.0.2 across affected packages: @progfay/scrapbox-parser.
What version fixes CVE-2021-27405?
Upgrading to 6.0.3, 7.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @progfay/scrapbox-parser affected?
Yes, @progfay/scrapbox-parser is affected in releases prior to 6.0.3, 7.0.2. Upgrade your dependency to 6.0.3, 7.0.2 or later.
What is the CVSS score of CVE-2021-27405?
CVE-2021-27405 has a CVSS v3.1 base score of 4.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2021-27405?
CVE-2021-27405 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check npm dependencies for CVE-2021-27405?
Run the dependency tree command: 'npm ls @progfay/scrapbox-parser'. 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-9fhw-r42p-5c7r",
  "modified" : "2021-02-26T19:49:07Z",
  "published" : "2021-03-01T20:44:44Z",
  "aliases" : [ "CVE-2021-27405" ],
  "summary" : "Regular expression Denial of Service in @progfay/scrapbox-parser",
  "details" : "### Impact\n\nA [Regular expression Denial of Service](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS) flaw was found in the @progfay/scrapbox-parser package before 6.0.3, 7.0.2 for Node.js.\nThe attacker that is able to be parsed a specially crafted text may cause the application to consume an excessive amount of CPU.\n\n### Patches\n\nUpgrade to version 6.0.3, 7.0.2 or later.\n\n### Workarounds\n\nAvoid to parse text with a lot of `[` chars.\n\n### References\n\n* https://github.com/progfay/scrapbox-parser/pull/519\n* https://github.com/progfay/scrapbox-parser/pull/539\n* https://github.com/progfay/scrapbox-parser/pull/540\n* https://cve.mitre.org/cgi-bin/cvename.cgi?name=2021-27405\n* https://snyk.io/vuln/SNYK-JS-PROGFAYSCRAPBOXPARSER-1076803\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [github.com/progfay/scrapbox-parser](https://github.com/progfay/scrapbox-parser/issues)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@progfay/scrapbox-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "6.0.3"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@progfay/scrapbox-parser"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "7.0.0"
      }, {
        "fixed" : "7.0.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/progfay/scrapbox-parser/security/advisories/GHSA-9fhw-r42p-5c7r"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-27405"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/progfay/scrapbox-parser/pull/519"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/progfay/scrapbox-parser/pull/539"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/progfay/scrapbox-parser/pull/540"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210326-0002"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-02-26T19:49:07Z",
    "nvd_published_at" : "2021-02-19T05:15:00Z"
  }
}