org.mvnpm:brace-expansion@5.0.9

  • latest version

    5.0.12

  • latest non vulnerable version

  • first published

    3 years ago

  • latest version published

    2 months ago

  • licenses detected

  • package registry

  • Direct Vulnerabilities

    Known vulnerabilities in the org.mvnpm:brace-expansion package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • H
    Uncontrolled Recursion

    org.mvnpm:brace-expansion is a Brace expansion as known from sh/bash

    Affected versions of this package are vulnerable to Uncontrolled Recursion via two distinct stack-exhaustion paths in parseCommaParts. In the first, the function recurses on the remainder of the string once per brace group, so a chain of approximately 7,000 groups (~29 KB of input) exhausts the native call stack and throws a RangeError. In the second, push.apply passes one argument per element, meaning a single large comma-separated array inside a brace group overflows the stack at a recursion depth of exactly one, requiring roughly 125,000 comma-separated elements. Neither the max nor maxLength options can bound either path because the crash occurs during parsing, before any expansion takes place.

    How to fix Uncontrolled Recursion?

    Upgrade org.mvnpm:brace-expansion to version 5.0.12 or higher.

    [,5.0.12)
    • M
    Regular Expression Denial of Service (ReDoS)

    org.mvnpm:brace-expansion is a Brace expansion as known from sh/bash

    Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the expand_ function, which implements a Bash quirk where a brace group followed by a comma set (e.g. {a},b}) causes the parser to rewrite the input string and restart the scan, absorbing one closing brace per pass. Because each pass re-reads the entire string and the string itself grows by approximately 25 characters per rewrite (due to the escClose sentinel), the work is quadratic in the number of trailing braces, allowing an attacker to block the event loop with a small input. An input of the form '{a}' + '}'.repeat(128000) + ',z}' takes approximately 27 seconds to process while producing only two results, and neither the existing max nor maxLength guards can prevent this because the cost is incurred during parsing before any result set is produced.

    How to fix Regular Expression Denial of Service (ReDoS)?

    Upgrade org.mvnpm:brace-expansion to version 5.0.12 or higher.

    [,5.0.12)
    • H
    Uncontrolled Recursion

    org.mvnpm:brace-expansion is a Brace expansion as known from sh/bash

    Affected versions of this package are vulnerable to Uncontrolled Recursion via uncontrolled recursion in expand_ when processing deeply nested brace patterns. An attacker can supply approximately 6 KB of deeply nested braces (e.g., { repeated ~3,200 times followed by a,b and the matching } characters) to exhaust the native call stack and crash the process with a RangeError: Maximum call stack size exceeded. The max and maxLength bounds do not prevent this because the stack is exhausted during recursive descent into sub-expansions, before the result set grows.

    How to fix Uncontrolled Recursion?

    Upgrade org.mvnpm:brace-expansion to version 5.0.12 or higher.

    [,5.0.12)