Vulnerabilities

9 via 13 paths

Dependencies

171

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Severity
  • 3
  • 6
Status
  • 9
  • 0
  • 0

high severity

Integer Overflow or Wraparound

  • Vulnerable module: nanoid
  • Introduced through: nanoid@4.0.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › nanoid@4.0.0
    Remediation: Upgrade to nanoid@5.1.11.

Overview

Affected versions of this package are vulnerable to Integer Overflow or Wraparound through the fillPool logic in index.js and index.cjs. An attacker can make subsequent ID generation deterministic by supplying an oversized size value to nanoid(size), which is coerced into a negative 32-bit integer and corrupts the shared random pool state. After that call, all later IDs produced in the same process lose their randomness and uniqueness, breaking session tokens, CSRF tokens, and other identifiers until the process restarts.

Remediation

Upgrade nanoid to version 3.3.12, 5.1.11 or higher.

References

high severity

Infinite loop

  • Vulnerable module: nanoid
  • Introduced through: nanoid@4.0.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › nanoid@4.0.0
    Remediation: Upgrade to nanoid@5.1.16.

Overview

Affected versions of this package are vulnerable to Infinite loop through the customAlphabet and nanoid functions in nanoid/non-secure. An attacker can hang the calling thread by supplying a negative size to either function, causing the loop counter to decrement from a negative value and never reach its termination condition. This affects applications that pass unvalidated attacker-controlled size values into the non-secure ID generator, where a single malicious request can spin the process indefinitely and stop the service from responding.

Notes

  • The vulnerable code path is in the nanoid/non-secure entry point, so bundles or consumers that import the non-secure module directly are the ones exposed; the secure/default package path is a separate export.
  • The denial-of-service only shows up when callers pass a negative size into these APIs, which the advisory’s regression tests treat as returning an empty string rather than looping.

Remediation

Upgrade nanoid to version 3.3.16, 5.1.16 or higher.

References

high severity

Infinite loop

  • Vulnerable module: nanoid
  • Introduced through: nanoid@4.0.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › nanoid@4.0.0
    Remediation: Upgrade to nanoid@5.1.6.

Overview

Affected versions of this package are vulnerable to Infinite loop through the customRandom function in the customRandom implementation. An attacker can hang the calling thread by supplying a size of 0 to customRandom, which causes its ID generation loop to never reach a terminating condition. This breaks any application path that accepts an unvalidated, attacker-controlled size and passes it into customRandom, leaving the process stuck while handling the request.

Remediation

Upgrade nanoid to version 3.3.17, 5.1.6 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: @babel/runtime
  • Introduced through: @babel/runtime@7.18.9

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › @babel/runtime@7.18.9
    Remediation: Upgrade to @babel/runtime@7.26.10.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the replace() method in wrapRegExp.js. An attacker can cause degradation in performance by supplying input strings that exploit the quadratic complexity of the replacement algorithm.

This is only exploitable when all of the following conditions are met:

  1. The code passes untrusted strings in the second argument to .replace().

  2. The compiled regular expressions being applied contain named capture groups.

In the case of @babel/preset-env, if the targets option is in use the application will be vulnerable under either of the following conditions:

  1. A browser older than Chrome 64, Opera 71, Edge 79, Firefox 78, Safari 11.1, or Node.js 10 is used when processing named capture groups.

  2. A browser older than Chrome/Edge 126, Opera 112, Firefox 129, Safari 17.4, or Node.js 23 is used when processing duplicated named capture groups.

Note: The project maintainers advise that "just updating your Babel dependencies is not enough: you will also need to re-compile your code."

Workaround

This vulnerability can be avoided by filtering out input containing a $< that is not followed by a >.

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade @babel/runtime to version 7.26.10, 8.0.0-alpha.17 or higher.

References

medium severity

Asymmetric Resource Consumption (Amplification)

  • Vulnerable module: minimatch
  • Introduced through: @linaria/core@4.1.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › @linaria/core@4.1.0 › @linaria/utils@4.5.3 › minimatch@9.0.9
  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › @linaria/core@4.1.0 › @linaria/tags@4.5.4 › @linaria/utils@4.5.3 › minimatch@9.0.9

Overview

minimatch is a minimal matching utility.

Affected versions of this package are vulnerable to Asymmetric Resource Consumption (Amplification) in the firstPhasePreProcess method, where the **/.. transform clones a globParts entry and pushes the clone back onto the same array inside a do...while (didSomething) fixpoint loop. An attacker can exhaust CPU and memory by supplying a glob pattern whose **/.. sequences regenerate entries during preprocessing, which secondPhasePreProcess then compares in an O(n^2) pairwise partsMatch pass over the expanded set. Exploitation requires the pattern to be parsed with optimizationLevel set to 2 or higher.

Remediation

Upgrade minimatch to version 11.0.1 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: path-to-regexp
  • Introduced through: path-to-regexp@6.2.1

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › path-to-regexp@6.2.1
    Remediation: Upgrade to path-to-regexp@6.3.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when including multiple regular expression parameters in a single segment, which will produce the regular expression /^\/([^\/]+?)-([^\/]+?)\/?$/, if two parameters within a single segment are separated by a character other than a / or .. Poor performance will block the event loop and can lead to a DoS.

Note: While the 8.0.0 release has completely eliminated the vulnerable functionality, prior versions that have received the patch to mitigate backtracking may still be vulnerable if custom regular expressions are used. So it is strongly recommended for regular expression input to be controlled to avoid malicious performance degradation in those versions. This behavior is enforced as of version 7.1.0 via the strict option, which returns an error if a dangerous regular expression is detected.

Workaround

This vulnerability can be avoided by using a custom regular expression for parameters after the first in a segment, which excludes - and /.

PoC

/a${'-a'.repeat(8_000)}/a

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.

The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.

Let’s take the following regular expression as an example:

regex = /A(B|C+)+D/

This regular expression accomplishes the following:

  • A The string must start with the letter 'A'
  • (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
  • D Finally, we ensure this section of the string ends with a 'D'

The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD

It most cases, it doesn't take very long for a regex engine to find a match:

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total

$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total

The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.

Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.

Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:

  1. CCC
  2. CC+C
  3. C+CC
  4. C+C+C.

The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.

From there, the number of steps the engine must use to validate a string just continues to grow.

String Number of C's Number of steps
ACCCX 3 38
ACCCCX 4 71
ACCCCCX 5 136
ACCCCCCCCCCCCCCX 14 65,553

By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.

Remediation

Upgrade path-to-regexp to version 0.1.10, 1.9.0, 3.3.0, 6.3.0, 8.0.0 or higher.

References

medium severity
new

Incorrect Regular Expression

  • Vulnerable module: picomatch
  • Introduced through: tailwindcss@3.1.7

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › tailwindcss@3.1.7 › chokidar@3.6.0 › anymatch@3.1.3 › picomatch@2.3.2
  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › tailwindcss@3.1.7 › chokidar@3.6.0 › readdirp@3.6.0 › picomatch@2.3.2
  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › tailwindcss@3.1.7 › fast-glob@3.3.3 › micromatch@4.0.8 › picomatch@2.3.2

Overview

Affected versions of this package are vulnerable to Incorrect Regular Expression via the globstar function in lib/parse.js, where globstar (**) patterns are compiled without the dotAll flag, causing the generated regular expression to use . which does not match line terminator characters. An attacker who controls file names, object keys, or archive entry names can embed newline characters in those names to evade **-based deny patterns, causing excluded resources to be included and exposed.

Remediation

A fix was pushed into the master branch but not yet published.

References

medium severity

Improper Input Validation

  • Vulnerable module: nanoid
  • Introduced through: nanoid@4.0.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › nanoid@4.0.0
    Remediation: Upgrade to nanoid@5.0.9.

Overview

Affected versions of this package are vulnerable to Improper Input Validation due to the mishandling of fractional values in the nanoid function. By exploiting this vulnerability, an attacker can achieve an infinite loop.

Remediation

Upgrade nanoid to version 3.3.8, 5.0.9 or higher.

References

medium severity
new

Improper Encoding or Escaping of Output

  • Vulnerable module: minimatch
  • Introduced through: @linaria/core@4.1.0

Detailed paths

  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › @linaria/core@4.1.0 › @linaria/utils@4.5.3 › minimatch@9.0.9
  • Introduced through: @crystal-ball/react-app-prototype@crystal-ball/react-app-prototype › @linaria/core@4.1.0 › @linaria/tags@4.5.4 › @linaria/utils@4.5.3 › minimatch@9.0.9

Overview

minimatch is a minimal matching utility.

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via minimatch.escape() in src/escape.ts, which fails to neutralize four classes of special input before the result is used as a glob pattern. A leading ! passes through unescaped and becomes a negation operator, causing the pattern to match every path except the intended literal. A leading # passes through and becomes a comment, causing the pattern to match nothing. When the escaped output is combined with a brace group (either caller-supplied or present in the user text itself), brace-expansion collapses the \\ escape sequence and reactivates the following magic character (such as *), widening the match. With { windowsPathsNoEscape: true, magicalBraces: true }, brace-literal encoding using character classes ([{]) is misinterpreted by brace-expansion, producing patterns that match unintended strings and fail to match the intended literal. Applications that pass attacker-controlled text through escape() and use the result for authorization, filtering, or path-selection decisions may grant or deny access to unintended paths.

Workaround

Until upgrading, the following per-behavior mitigations can be applied (each measured on 11.0.5):

  • Behaviors 1 and 2 (leading ! and #): pass { nonegate: true, nocomment: true } when matching escaped patterns.
  • Behavior 3 (escaped backslash plus brace group): do not combine escaped text with a brace group, and use { magicalBraces: true } so user braces are escaped. Alternatively, pass nobrace: true to stop the over-match, but note that the caller's brace group then also becomes literal.
  • Behavior 4 (windowsPathsNoEscape + magicalBraces): pass nobrace: true when matching.

Remediation

Upgrade minimatch to version 11.0.8 or higher.

References