Skip to content

chore(deps): update dependency brace-expansion to v2.0.3 [security] (master)#1042

Closed
red-hat-konflux[bot] wants to merge 1 commit intomasterfrom
konflux/mintmaker/master-master/npm-brace-expansion-vulnerability
Closed

chore(deps): update dependency brace-expansion to v2.0.3 [security] (master)#1042
red-hat-konflux[bot] wants to merge 1 commit intomasterfrom
konflux/mintmaker/master-master/npm-brace-expansion-vulnerability

Conversation

@red-hat-konflux
Copy link
Copy Markdown
Contributor

@red-hat-konflux red-hat-konflux bot commented Mar 26, 2026

This PR contains the following updates:

Package Change Age Confidence
brace-expansion 2.0.2 -> 2.0.3 age confidence

brace-expansion: Zero-step sequence causes process hang and memory exhaustion

CVE-2026-33750 / GHSA-f886-m6hf-6m8v

More information

Details

Impact

A brace pattern with a zero step value (e.g., {1..2..0}) causes the sequence generation loop to run indefinitely, making the process hang for seconds and allocate heaps of memory.

The loop in question:

https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L184

test() is one of

https://github.com/juliangruber/brace-expansion/blob/daa71bcb4a30a2df9bcb7f7b8daaf2ab30e5794a/src/index.ts#L107-L113

The increment is computed as Math.abs(0) = 0, so the loop variable never advances. On a test machine, the process hangs for about 3.5 seconds and allocates roughly 1.9 GB of memory before throwing a RangeError. Setting max to any value has no effect because the limit is only checked at the output combination step, not during sequence generation.

This affects any application that passes untrusted strings to expand(), or by error sets a step value of 0. That includes tools built on minimatch/glob that resolve patterns from CLI arguments or config files. The input needed is just 10 bytes.

Patches

Upgrade to versions

  • 5.0.5+

A step increment of 0 is now sanitized to 1, which matches bash behavior.

Workarounds

Sanitize strings passed to expand() to ensure a step value of 0 is not used.

Severity

  • CVSS Score: 6.5 / 10 (Medium)
  • Vector String: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H

References

This data is provided by OSV and the GitHub Advisory Database (CC-BY 4.0).


Release Notes

juliangruber/brace-expansion (brace-expansion)

v2.0.3

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

To execute skipped test pipelines write comment /ok-to-test.


Documentation

Find out how to configure dependency updates in MintMaker documentation or see all available configuration options in Renovate documentation.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai bot commented Mar 26, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the brace-expansion dependency override from v2 to v5 to address a security vulnerability and refresh the locked dependency tree accordingly.

Flow diagram for brace-expansion security fix via dependency bump

flowchart TD
    A[CLI_or_Config_input] --> B[Application_pattern_handling]
    B --> C[brace_expansion_library]

    subgraph Before_update_v2_0_2
        C --> D{Step_value_in_pattern}
        D -->|Non_zero_step| E[Generate_sequence_normally]
        D -->|Zero_step_0| F[Infinite_like_loop<br/>High_CPU_and_memory<br/>Potential_process_hang]
    end

    subgraph After_update_v5_0_5
        C --> G{Step_value_in_pattern}
        G -->|Non_zero_step| H[Generate_sequence_normally]
        G -->|Zero_step_0| I[Sanitize_step_to_1<br/>Match_bash_behavior<br/>Avoid_hang_and_exhaustion]
    end

    F -.vulnerability_CVE_2026_33750.-> J[Denial_of_service_risk]
    I --> K[Mitigated_risk_in_updated_dependency]
Loading

File-Level Changes

Change Details Files
Upgrade brace-expansion to the latest secure major version via overrides and lockfile updates.
  • Bump the brace-expansion override from ^2.0.2 to ^5.0.0 in the main package manifest to force use of a non-vulnerable version across transitive dependencies.
  • Regenerate package-lock to lock brace-expansion to the updated major version and align resolved dependency metadata.
package.json
package-lock.json

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Signed-off-by: red-hat-konflux <126015336+red-hat-konflux[bot]@users.noreply.github.com>
@red-hat-konflux red-hat-konflux bot force-pushed the konflux/mintmaker/master-master/npm-brace-expansion-vulnerability branch from 511c8c1 to ea3a01c Compare March 26, 2026 21:44
Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@red-hat-konflux red-hat-konflux bot changed the title chore(deps): update dependency brace-expansion to v5 [security] (master) chore(deps): update dependency brace-expansion to v2.0.3 [security] (master) Mar 27, 2026
@red-hat-konflux
Copy link
Copy Markdown
Contributor Author

red-hat-konflux bot commented Mar 27, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: package-lock.json
npm warn Unknown env config "store". This will stop working in the next major version of npm. See `npm help npmrc` for supported config options.
npm error code EOVERRIDE
npm error Override for brace-expansion@2.0.3 conflicts with direct dependency
npm error A complete log of this run can be found in: /tmp/renovate/cache/others/npm/_logs/2026-03-27T17_35_13_901Z-debug-0.log

@red-hat-konflux red-hat-konflux bot deleted the konflux/mintmaker/master-master/npm-brace-expansion-vulnerability branch April 1, 2026 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant