snowdensb / dependabot-core

🤖 The core logic behind Dependabot's update PR creation, and the public issue tracker for all things Dependabot
https://github.com/features/security
Other
0 stars 0 forks source link

jest-27.0.6.tgz: 7 vulnerabilities (highest severity is: 9.3) #1089

Open mend-for-github-com[bot] opened 4 months ago

mend-for-github-com[bot] commented 4 months ago
Vulnerable Library - jest-27.0.6.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/@jest/core/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-haste-map/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-config/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/@jest/transform/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-message-util/node_modules/micromatch/package.json

Vulnerabilities

CVE Severity CVSS Dependency Type Fixed in (jest version) Remediation Possible** Reachability
CVE-2023-45133 Critical 9.3 traverse-7.14.7.tgz Transitive 27.1.0
CVE-2024-4068 High 7.5 braces-3.0.2.tgz Transitive N/A*
CVE-2024-37890 High 7.5 ws-7.5.1.tgz Transitive 27.1.0
CVE-2022-46175 High 7.1 json5-2.2.0.tgz Transitive 27.1.0
CVE-2023-26136 Medium 6.5 tough-cookie-4.0.0.tgz Transitive 27.1.0
CVE-2024-4067 Medium 5.3 micromatch-4.0.4.tgz Transitive N/A*
CVE-2022-25883 Medium 5.3 semver-6.3.0.tgz Transitive N/A*

*For some transitive vulnerabilities, there is no version of direct dependency with a fix. Check the "Details" section below to see if there is a version of transitive dependency where vulnerability is fixed.

**In some cases, Remediation PR cannot be created automatically for a vulnerability despite the availability of remediation

Details

CVE-2023-45133 ### Vulnerable Library - traverse-7.14.7.tgz

The Babel Traverse module maintains the overall tree state, and is responsible for replacing, removing, and adding nodes

Library home page: https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.7.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/@babel/traverse/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - jest-snapshot-27.0.6.tgz - :x: **traverse-7.14.7.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

Babel is a compiler for writingJavaScript. In `@babel/traverse` prior to versions 7.23.2 and 8.0.0-alpha.4 and all versions of `babel-traverse`, using Babel to compile code that was specifically crafted by an attacker can lead to arbitrary code execution during compilation, when using plugins that rely on the `path.evaluate()`or `path.evaluateTruthy()` internal Babel methods. Known affected plugins are `@babel/plugin-transform-runtime`; `@babel/preset-env` when using its `useBuiltIns` option; and any "polyfill provider" plugin that depends on `@babel/helper-define-polyfill-provider`, such as `babel-plugin-polyfill-corejs3`, `babel-plugin-polyfill-corejs2`, `babel-plugin-polyfill-es-shims`, `babel-plugin-polyfill-regenerator`. No other plugins under the `@babel/` namespace are impacted, but third-party plugins might be. Users that only compile trusted code are not impacted. The vulnerability has been fixed in `@babel/traverse@7.23.2` and `@babel/traverse@8.0.0-alpha.4`. Those who cannot upgrade `@babel/traverse` and are using one of the affected packages mentioned above should upgrade them to their latest version to avoid triggering the vulnerable code path in affected `@babel/traverse` versions: `@babel/plugin-transform-runtime` v7.23.2, `@babel/preset-env` v7.23.2, `@babel/helper-define-polyfill-provider` v0.4.3, `babel-plugin-polyfill-corejs2` v0.4.6, `babel-plugin-polyfill-corejs3` v0.8.5, `babel-plugin-polyfill-es-shims` v0.10.0, `babel-plugin-polyfill-regenerator` v0.5.3.

Publish Date: 2023-10-12

URL: CVE-2023-45133

### CVSS 3 Score Details (9.3)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Local - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Changed - Impact Metrics: - Confidentiality Impact: High - Integrity Impact: High - Availability Impact: High

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Origin: https://github.com/babel/babel/security/advisories/GHSA-67hx-6x53-jw92

Release Date: 2023-10-12

Fix Resolution (@babel/traverse): 7.23.2

Direct dependency fix Resolution (jest): 27.1.0

:rescue_worker_helmet: Automatic Remediation will be attempted for this issue.
CVE-2024-4068 ### Vulnerable Library - braces-3.0.2.tgz

Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.

Library home page: https://registry.npmjs.org/braces/-/braces-3.0.2.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/@jest/transform/node_modules/braces/package.json,/npm_and_yarn/helpers/node_modules/@jest/core/node_modules/braces/package.json,/npm_and_yarn/helpers/node_modules/jest-message-util/node_modules/braces/package.json,/npm_and_yarn/helpers/node_modules/jest-config/node_modules/braces/package.json,/npm_and_yarn/helpers/node_modules/jest-haste-map/node_modules/braces/package.json,/npm_and_yarn/spec/fixtures/projects/npm6/peer_dependency_typescript_no_lockfile/node_modules/braces/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - transform-27.0.6.tgz - micromatch-4.0.4.tgz - :x: **braces-3.0.2.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

The NPM package `braces`, versions prior to 3.0.3, fails to limit the number of characters it can handle, which could lead to Memory Exhaustion. In `lib/parse.js,` if a malicious user sends "imbalanced braces" as input, the parsing will enter a loop, which will cause the program to start allocating heap memory without freeing it at any moment of the loop. Eventually, the JavaScript heap limit is reached, and the program will crash. Mend Note: After conducting a further research, it was concluded that CVE-2024-4068 does not contain a high security risk that reflects the NVD score, but should be kept for users' awareness. Users of braces should follow the fix recommendation as noted.

Publish Date: 2024-05-13

URL: CVE-2024-4068

### CVSS 3 Score Details (7.5)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: None - Integrity Impact: None - Availability Impact: High

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Release Date: 2024-05-13

Fix Resolution: braces - 3.0.3

CVE-2024-37890 ### Vulnerable Library - ws-7.5.1.tgz

Simple to use, blazing fast and thoroughly tested websocket client and server for Node.js

Library home page: https://registry.npmjs.org/ws/-/ws-7.5.1.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/ws/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - jest-config-27.0.6.tgz - jest-environment-jsdom-27.0.6.tgz - jsdom-16.6.0.tgz - :x: **ws-7.5.1.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

ws is an open source WebSocket client and server for Node.js. A request with a number of headers exceeding theserver.maxHeadersCount threshold could be used to crash a ws server. The vulnerability was fixed in ws@8.17.1 (e55e510) and backported to ws@7.5.10 (22c2876), ws@6.2.3 (eeb76d3), and ws@5.2.4 (4abd8f6). In vulnerable versions of ws, the issue can be mitigated in the following ways: 1. Reduce the maximum allowed length of the request headers using the --max-http-header-size=size and/or the maxHeaderSize options so that no more headers than the server.maxHeadersCount limit can be sent. 2. Set server.maxHeadersCount to 0 so that no limit is applied.

Publish Date: 2024-06-17

URL: CVE-2024-37890

### CVSS 3 Score Details (7.5)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: None - Integrity Impact: None - Availability Impact: High

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Origin: https://github.com/websockets/ws/security/advisories/GHSA-3h5v-q93c-6h6q

Release Date: 2024-06-17

Fix Resolution (ws): 7.5.10

Direct dependency fix Resolution (jest): 27.1.0

:rescue_worker_helmet: Automatic Remediation will be attempted for this issue.
CVE-2022-46175 ### Vulnerable Library - json5-2.2.0.tgz

JSON for humans.

Library home page: https://registry.npmjs.org/json5/-/json5-2.2.0.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/json5/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - transform-27.0.6.tgz - core-7.14.6.tgz - :x: **json5-2.2.0.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

JSON5 is an extension to the popular JSON file format that aims to be easier to write and maintain by hand (e.g. for config files). The `parse` method of the JSON5 library before and including versions 1.0.1 and 2.2.1 does not restrict parsing of keys named `__proto__`, allowing specially crafted strings to pollute the prototype of the resulting object. This vulnerability pollutes the prototype of the object returned by `JSON5.parse` and not the global Object prototype, which is the commonly understood definition of Prototype Pollution. However, polluting the prototype of a single object can have significant security impact for an application if the object is later used in trusted operations. This vulnerability could allow an attacker to set arbitrary and unexpected keys on the object returned from `JSON5.parse`. The actual impact will depend on how applications utilize the returned object and how they filter unwanted keys, but could include denial of service, cross-site scripting, elevation of privilege, and in extreme cases, remote code execution. `JSON5.parse` should restrict parsing of `__proto__` keys when parsing JSON strings to objects. As a point of reference, the `JSON.parse` method included in JavaScript ignores `__proto__` keys. Simply changing `JSON5.parse` to `JSON.parse` in the examples above mitigates this vulnerability. This vulnerability is patched in json5 versions 1.0.2, 2.2.2, and later.

Publish Date: 2022-12-24

URL: CVE-2022-46175

### CVSS 3 Score Details (7.1)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: High - Privileges Required: Low - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: High - Integrity Impact: Low - Availability Impact: High

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Origin: https://www.cve.org/CVERecord?id=CVE-2022-46175

Release Date: 2022-12-24

Fix Resolution (json5): 2.2.2

Direct dependency fix Resolution (jest): 27.1.0

:rescue_worker_helmet: Automatic Remediation will be attempted for this issue.
CVE-2023-26136 ### Vulnerable Library - tough-cookie-4.0.0.tgz

RFC6265 Cookies and Cookie Jar for node.js

Library home page: https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/tough-cookie/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - jest-config-27.0.6.tgz - jest-environment-jsdom-27.0.6.tgz - jsdom-16.6.0.tgz - :x: **tough-cookie-4.0.0.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

Versions of the package tough-cookie before 4.1.3 are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in rejectPublicSuffixes=false mode. This issue arises from the manner in which the objects are initialized.

Publish Date: 2023-07-01

URL: CVE-2023-26136

### CVSS 3 Score Details (6.5)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: Low - Integrity Impact: Low - Availability Impact: None

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Origin: https://www.cve.org/CVERecord?id=CVE-2023-26136

Release Date: 2023-07-01

Fix Resolution (tough-cookie): 4.1.3

Direct dependency fix Resolution (jest): 27.1.0

:rescue_worker_helmet: Automatic Remediation will be attempted for this issue.
CVE-2024-4067 ### Vulnerable Library - micromatch-4.0.4.tgz

Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.

Library home page: https://registry.npmjs.org/micromatch/-/micromatch-4.0.4.tgz

Path to dependency file: /npm_and_yarn/helpers/package.json

Path to vulnerable library: /npm_and_yarn/helpers/node_modules/@jest/core/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-haste-map/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-config/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/@jest/transform/node_modules/micromatch/package.json,/npm_and_yarn/helpers/node_modules/jest-message-util/node_modules/micromatch/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - :x: **micromatch-4.0.4.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

The NPM package `micromatch` prior to 4.0.8 is vulnerable to Regular Expression Denial of Service (ReDoS). The vulnerability occurs in `micromatch.braces()` in `index.js` because the pattern `.*` will greedily match anything. By passing a malicious payload, the pattern matching will keep backtracking to the input while it doesn't find the closing bracket. As the input size increases, the consumption time will also increase until it causes the application to hang or slow down. There was a merged fix but further testing shows the issue persists. This issue should be mitigated by using a safe pattern that won't start backtracking the regular expression due to greedy matching. This issue was fixed in version 4.0.8. Mend Note: After conducting a further research, it was concluded that CVE-2024-4067 should not reflect the security risk score in NVD, but will be kept for users' awareness.

Publish Date: 2024-05-13

URL: CVE-2024-4067

### CVSS 3 Score Details (5.3)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: None - Integrity Impact: None - Availability Impact: Low

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Release Date: 2024-05-13

Fix Resolution: micromatch - 4.0.8

CVE-2022-25883 ### Vulnerable Library - semver-6.3.0.tgz

The semantic version parser used by npm.

Library home page: https://registry.npmjs.org/semver/-/semver-6.3.0.tgz

Path to dependency file: /npm_and_yarn/spec/fixtures/projects/npm6/peer_dependency_typescript_no_lockfile/package.json

Path to vulnerable library: /npm_and_yarn/spec/fixtures/projects/npm6/peer_dependency_typescript_no_lockfile/node_modules/semver/package.json,/npm_and_yarn/helpers/node_modules/istanbul-lib-instrument/node_modules/semver/package.json,/npm_and_yarn/helpers/node_modules/make-dir/node_modules/semver/package.json,/npm_and_yarn/helpers/node_modules/@babel/core/node_modules/semver/package.json,/npm_and_yarn/helpers/node_modules/@babel/helper-compilation-targets/node_modules/semver/package.json

Dependency Hierarchy: - jest-27.0.6.tgz (Root Library) - core-27.0.6.tgz - transform-27.0.6.tgz - core-7.14.6.tgz - :x: **semver-6.3.0.tgz** (Vulnerable Library)

Found in base branch: main

### Vulnerability Details

Versions of the package semver before 7.5.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range, when untrusted user data is provided as a range.

Publish Date: 2023-06-21

URL: CVE-2022-25883

### CVSS 3 Score Details (5.3)

Base Score Metrics: - Exploitability Metrics: - Attack Vector: Network - Attack Complexity: Low - Privileges Required: None - User Interaction: None - Scope: Unchanged - Impact Metrics: - Confidentiality Impact: None - Integrity Impact: None - Availability Impact: Low

For more information on CVSS3 Scores, click here.

### Suggested Fix

Type: Upgrade version

Origin: https://github.com/advisories/GHSA-c2qf-rxjj-qqgw

Release Date: 2023-06-21

Fix Resolution: semver - 5.7.2,6.3.1,7.5.2;org.webjars.npm:semver:7.5.2


:rescue_worker_helmet:Automatic Remediation will be attempted for this issue.