2026-03-26 19:2CVE-2026-4923openjs
PUBLISHED5.2CWE-1333

path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards

Impact:

When using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.

Unsafe examples:

/*foo-*bar-:baz

/*a-:b-*c-:d

/x/*a-:b/*c/y

Safe examples:

/*foo-:bar

/*foo-:bar-*baz

Patches:

Upgrade to version 8.4.0.

Workarounds:

If you are using multiple wildcard parameters, you can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable.

Problem type

Affected products

path-to-regexp

path-to-regexp

< 8.4.0 - AFFECTED

8.4.0 - UNAFFECTED

References

GitHub Security Advisories

GHSA-27v5-c462-wpq7

path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards

https://github.com/advisories/GHSA-27v5-c462-wpq7

Impact

When using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.

Unsafe examples:

/*foo-*bar-:baz
/*a-:b-*c-:d
/x/*a-:b/*c/y

Safe examples:

/*foo-:bar
/*foo-:bar-*baz

Patches

Upgrade to version 8.4.0.

Workarounds

If developers are using multiple wildcard parameters, they can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable.

JSON source

https://cveawg.mitre.org/api/cve/CVE-2026-4923
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2026-4923",
    "assignerOrgId": "ce714d77-add3-4f53-aff5-83d477b104bb",
    "assignerShortName": "openjs",
    "dateUpdated": "2026-03-26T19:02:00.729Z",
    "dateReserved": "2026-03-26T18:05:44.717Z",
    "datePublished": "2026-03-26T19:02:00.729Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "ce714d77-add3-4f53-aff5-83d477b104bb",
        "shortName": "openjs",
        "dateUpdated": "2026-03-26T19:02:00.729Z"
      },
      "title": "path-to-regexp vulnerable to Regular Expression Denial of Service via multiple wildcards",
      "descriptions": [
        {
          "lang": "en",
          "value": "Impact:\n\nWhen using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.\n\nUnsafe examples:\n\n/*foo-*bar-:baz\n/*a-:b-*c-:d\n/x/*a-:b/*c/y\n\nSafe examples:\n\n/*foo-:bar\n/*foo-:bar-*baz\n\nPatches:\n\nUpgrade to version 8.4.0.\n\nWorkarounds:\n\nIf you are using multiple wildcard parameters, you can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "Impact:\n\nWhen using multiple wildcards, combined with at least one parameter, a regular expression can be generated that is vulnerable to ReDoS. This backtracking vulnerability requires the second wildcard to be somewhere other than the end of the path.\n\nUnsafe examples:\n\n/*foo-*bar-:baz\n/*a-:b-*c-:d\n/x/*a-:b/*c/y\n\nSafe examples:\n\n/*foo-:bar\n/*foo-:bar-*baz\n\nPatches:\n\nUpgrade to version 8.4.0.\n\nWorkarounds:\n\nIf you are using multiple wildcard parameters, you can check the regex output with a tool such as https://makenowjust-labs.github.io/recheck/playground/ to confirm whether a path is vulnerable."
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "path-to-regexp",
          "product": "path-to-regexp",
          "defaultStatus": "unaffected",
          "versions": [
            {
              "version": "8.0.0",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.4.0"
            },
            {
              "version": "8.4.0",
              "status": "unaffected",
              "versionType": "semver"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-1333: Inefficient Regular Expression Complexity",
              "cweId": "CWE-1333",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://cna.openjsf.org/security-advisories.html"
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ],
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H",
            "baseScore": 5.9,
            "baseSeverity": "MEDIUM"
          }
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "blakeembrey",
          "type": "remediation developer"
        },
        {
          "lang": "en",
          "value": "UlisesGascon",
          "type": "remediation reviewer"
        }
      ]
    }
  }
}