Update minimatch to 3.1.5 to fix ReDoS vulnerability (GHSA-3ppc-4f35-3m26)#202
Draft
Update minimatch to 3.1.5 to fix ReDoS vulnerability (GHSA-3ppc-4f35-3m26)#202
Conversation
…ity (GHSA-3ppc-4f35-3m26) Agent-Logs-Url: https://github.com/advanced-security/secret-scanning-notifications/sessions/9eb0ae41-22db-474d-afa1-09cfa755b9c2 Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix minimatch ReDoS vulnerability in pattern matching
Update minimatch to 3.1.5 to fix ReDoS vulnerability (GHSA-3ppc-4f35-3m26)
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
minimatch3.1.2 is vulnerable to ReDoS via repeated*wildcards — each compiles to[^/]*?, causing O(4^N) backtracking on non-matching input.minimatchfrom 3.1.2 → 3.1.5 vianpm update minimatch^3.xsemver range required by all consumersReachability
Not reachable — high confidence.
minimatchis never imported in application source (src/). It exists only as a transitive dep of dev tooling (eslint,glob,test-exclude). Update satisfies scanners; no active exposure.Pre-existing test failures
Three tests in
inputs.test.ts(expect rejections, get resolutions) andsecretscanning.test.ts(Jest can't parse ESM from@octokit/action) fail on the base branch. Not related to this change.Original prompt
This section details the Dependabot vulnerability alert you should resolve
<alert_title>minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern</alert_title>
<alert_description>### Summary
minimatchis vulnerable to Regular Expression Denial of Service (ReDoS) when a glob pattern contains many consecutive*wildcards followed by a literal character that doesn't appear in the test string. Each*compiles to a separate[^/]*?regex group, and when the match fails, V8's regex engine backtracks exponentially across all possible splits.The time complexity is O(4^N) where N is the number of
*characters. With N=15, a singleminimatch()call takes ~2 seconds. With N=34, it hangs effectively forever.Details
Give all details on the vulnerability. Pointing to the incriminated source code is very helpful for the maintainer.
PoC
When minimatch compiles a glob pattern, each
*becomes[^/]*?in the generated regex. For a pattern like***************X***:When the test string doesn't contain
X, the regex engine must try every possible way to distribute the characters across all the[^/]*?groups before concluding no match exists. With N groups and M characters, this is O(C(N+M, N)) — exponential.Impact
Any application that passes user-controlled strings to
minimatch()as the pattern argument is vulnerable to DoS. This includes:.gitignore-style filtering with user-defined rulesThanks to @ljharb for back-porting the fix to legacy versions of minimatch.</alert_description>
high
https://github.com/isaacs/minimatch/security/advisories/GHSA-3ppc-4f35-3m26 https://github.com/isaacs/minimatch/commit/2e111f3a79abc00fa73110195de2c0f2351904f5 https://nvd.nist.gov/vuln/detail/CVE-2026-26996 https://github.com/advisories/GHSA-3ppc-4f35-3m26GHSA-3ppc-4f35-3m26, CVE-2026-26996
minimatch
npm
<vulnerable_versions>3.1.2</vulnerable_versions>
<patched_version>3.1.3</patched_version>
<manifest_path>package-lock.json</manifest_path>
<task_instructions>Resolve this alert by updating the affected package to a non-vulnerable version. Prefer the lowest non-vulnerable version (see the patched_version field above) over the latest to minimize breaking changes. Include a Reachability Assessment section in the PR description. Review the alert_description field to understand which APIs, features, or configurations are affected, then search the codebase for usage of those specific items. If the vulnerable code path is reachable, explain how (which files, APIs, or call sites use the affected functionality) and note that the codebase is actively exposed to this vulnerability. If the vulnerable code path is not reachable, explain why (e.g. the affected API is never called, the vulnerable configuration is not used) and note that the update is primarily to satisfy vulnerability scanners rather than to address an active risk. If the advisory is too vague to determine reachability (e.g. 'improper input validation' with no specific API named), state that reachability could not be determined and explain why. Include a confidence level in the reachability assessment (e.g. high confidence if the advisory names a specific API and you confirmed it is or is not called, low confidence if the usage is indirect and hard to trace). If no patched version is available, check the alert_description field for a Workarounds section — the advisory may describe configuration changes or usage patterns that mitigate the vulnerability without a version update. If a workaround is available, apply it and leave a code comment referencing the advisory identifier explaining it is a temporary mitigation. If neither a patch nor a workaround is available, explain in the PR description why the alert cannot be resolved automatically so a human reviewer can take over. Inspect the repository to determine which package manager is used (e.g. lock files, config files, build scripts) and use that tooling to perform the update — do not edit lock files directly. If the version constraint in the manifest (e.g. package.json, Gemfile, pyproject.toml) caps the version below the fix, update the constraint first. For transitive dependencies, determine whether it is simpler to update the direct dependency that pulls in the vulnerable package or to update the transitive dependency directly, and choose the least disruptive approach. If upgrading to fix the vulnerability forces a major version bump or known breaking changes, review the changelog or release notes, then audit t...