Vulnerabilities |
35 via 71 paths |
|---|---|
Dependencies |
615 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: brace-expansion
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › brace-expansion@5.0.8Remediation: Upgrade to lerna@10.0.0.
Overview
brace-expansion is a Brace expansion as known from sh/bash
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the expand(), expand_(), combine(), and expandSequence() functions, which bound the accumulator where results are combined but not the intermediate arrays that feed it. An attacker can crash the process with an uncatchable out-of-memory error, or stall the event loop for minutes, by supplying a pattern with many comma-separated alternatives that each receive an independent maxLength allowance and accumulate without a cumulative limit, or a padded sequence whose generation ignores maxLength and does work proportional to max * width. Exploitation requires the application to pass untrusted input to expand(), directly or transitively through a glob or pattern-matching library.
Workaround
This vulnerability can be avoided by passing an explicitly small max together with a small maxLength to expand(), bounding both the result count and length, since a small maxLength alone is insufficient on affected versions where it is applied per alternative rather than cumulatively.
Note: This is a bypass of the fix for the vulnerability described in CVE-2026-14257.
Remediation
Upgrade brace-expansion to version 1.1.18, 2.1.4, 3.0.6, 5.0.9 or higher.
References
high severity
new
- Vulnerable module: brace-expansion
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › brace-expansion@5.0.8Remediation: Upgrade to lerna@10.0.0.
Overview
brace-expansion is a Brace expansion as known from sh/bash
Affected versions of this package are vulnerable to Uncontrolled Recursion via uncontrolled recursion in expand_ when processing deeply nested brace patterns. An attacker can supply approximately 6 KB of deeply nested braces (e.g., { repeated ~3,200 times followed by a,b and the matching } characters) to exhaust the native call stack and crash the process with a RangeError: Maximum call stack size exceeded. The max and maxLength bounds do not prevent this because the stack is exhausted during recursive descent into sub-expansions, before the result set grows.
Remediation
Upgrade brace-expansion to version 1.1.20, 2.1.6, 3.0.8, 5.0.11 or higher.
References
high severity
new
- Vulnerable module: brace-expansion
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › brace-expansion@5.0.8Remediation: Upgrade to lerna@10.0.0.
Overview
brace-expansion is a Brace expansion as known from sh/bash
Affected versions of this package are vulnerable to Uncontrolled Recursion via two distinct stack-exhaustion paths in parseCommaParts. In the first, the function recurses on the remainder of the string once per brace group, so a chain of approximately 7,000 groups (~29 KB of input) exhausts the native call stack and throws a RangeError. In the second, push.apply passes one argument per element, meaning a single large comma-separated array inside a brace group overflows the stack at a recursion depth of exactly one, requiring roughly 125,000 comma-separated elements. Neither the max nor maxLength options can bound either path because the crash occurs during parsing, before any expansion takes place.
Remediation
Upgrade brace-expansion to version 1.1.19, 2.1.5, 3.0.7, 5.0.10 or higher.
References
high severity
- Vulnerable module: http-cache-semantics
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › make-fetch-happen@15.0.2 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › npm-registry-fetch@19.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmaccess@10.0.3 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
Overview
Affected versions of this package are vulnerable to Improper Authorization via improper validation of security-zeroed cache entries when processing client max-stale directives. An unauthenticated attacker can request the same URL with a large max-stale value to retrieve cached responses belonging to other users, including Set-Cookie session credentials from shared-cache entries that were deliberately zeroed for security reasons.
Remediation
There is no fixed version for http-cache-semantics.
References
high severity
- Vulnerable module: js-yaml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › js-yaml@4.1.1Remediation: Upgrade to lerna@10.1.0.
Overview
js-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the merge key (<<) handling of the loader, where the maxTotalMergeKeys budget does not count empty mappings against its limit. An attacker can consume significant CPU, on the order of O(N*K) for N empty mappings merged K times, with a relatively small document by repeatedly merging a large sequence of empty mappings so the budget counter never increments.
Note: This requires YAML merge processing to be enabled for untrusted YAML, which is the default behavior in versions 3 and 4, but is not the default in version 5.
Remediation
Upgrade js-yaml to version 3.15.2, 4.3.2 or higher.
References
high severity
- Vulnerable module: js-yaml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › js-yaml@4.1.1Remediation: Upgrade to lerna@10.0.0.
Overview
js-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in merge key (<<) handling during YAML parsing, where each mapping in a chain re-enumerates the keys inherited from the previous mapping. An attacker can exhaust CPU and cause denial of service by supplying a document with N chained merge mappings, which forces roughly O(N^2) work for O(N) input. Exploitation requires the application to parse untrusted YAML with the default or YAML11 schema, under which merge keys are resolved.
Remediation
Upgrade js-yaml to version 3.15.0, 4.3.0 or higher.
References
high severity
- Vulnerable module: js-yaml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › js-yaml@4.1.1Remediation: Upgrade to lerna@10.1.0.
Overview
js-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity through the yaml.load process. An attacker can cause excessive CPU consumption and block the event loop by providing a specially crafted YAML document containing a large !!omap sequence.
Remediation
Upgrade js-yaml to version 3.15.1, 4.3.1 or higher.
References
high severity
- Vulnerable module: pacote
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1Remediation: Upgrade to lerna@10.1.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
wspackage
Remediation
Upgrade pacote to version 21.5.1 or higher.
References
high severity
new
- Vulnerable module: picomatch
- Introduced through: @tsed/schema@8.44.0 and lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › @tsed/schema@8.44.0 › picomatch@4.0.4
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tinyglobby@0.2.12 › picomatch@4.0.7
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/run-script@10.0.3 › node-gyp@12.4.0 › tinyglobby@0.2.17 › picomatch@4.0.7
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/run-script@10.0.4 › node-gyp@12.4.0 › tinyglobby@0.2.17 › picomatch@4.0.7
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › @npmcli/run-script@10.0.4 › node-gyp@12.4.0 › tinyglobby@0.2.17 › picomatch@4.0.7
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › @npmcli/run-script@10.0.4 › node-gyp@12.4.0 › tinyglobby@0.2.17 › picomatch@4.0.7
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › @npmcli/run-script@10.0.4 › node-gyp@12.4.0 › tinyglobby@0.2.17 › picomatch@4.0.7
Overview
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via analyzeRepeatedExtglob in lib/parse.js, which skips single-branch repeated extglob patterns such as +(*) or +(*a). An attacker can supply these glob patterns to trigger exponential backtracking in the underlying regular expression engine against short inputs, blocking the Node.js event loop and crashing the application.
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:
AThe 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.DFinally, 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:
- CCC
- CC+C
- C+CC
- 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
There is no fixed version for picomatch.
References
high severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.0.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling due to the lack of enforced upper bounds on total decompressed data, entry counts, or decompression ratio in extraction and parsing paths such as src/extract.ts. An attacker can exhaust disk space and CPU resources by submitting a small crafted gzip archive with a high decompression ratio.
Remediation
Upgrade tar to version 7.5.19 or higher.
References
high severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.0.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Infinite loop via the replace method. An attacker can cause the archive scanner to enter an infinite loop by providing a tar header with a negative base-256 encoded entry size.
Remediation
Upgrade tar to version 7.5.18 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Prototype Pollution via insufficient hardening of runtime option handling across multiple request-processing helpers (lib/helpers/resolveConfig.js, lib/helpers/toFormData.js, lib/adapters/fetch.js, and related files). An attacker can supply a manipulated configuration object that overrides internally owned fetch options (such as body, headers, method, signal) or bypasses the default formSerializer.maxDepth limit, leading to integrity violations in outgoing requests or a crash causing denial of service.
Note: This is only exploitable when the caller does not explicitly set formSerializer.maxDepth, allowing a prototype-level or caller-supplied value to override the expected default.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade axios to version 0.34.0, 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via unsafe runtime option handling in the fetch and HTTP adapters, where user-supplied fetchOptions are merged into the resolved request options without sanitization. An attacker who can influence request configuration can trigger uncontrolled resource consumption, crashing the process.
Note: This is only exploitable when requests follow redirects (i.e., maxRedirects is not set to 0), unless application code manually follows the malicious redirect and re-enters axios.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input via unsafe runtime option handling in the fetch and HTTP adapters, where user-supplied fetchOptions are merged into the resolved request options without sanitization or allowlist enforcement. An attacker who can influence request configuration can supply option values that override Axios-owned fields (such as signal, method, headers, or body) or inject unexpected fetch option keys, causing the request pipeline to crash and producing a denial of service.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input via unsafe runtime option handling in the fetch and HTTP adapters, where user-supplied fetchOptions are merged into the resolved request options without sanitization or allowlist enforcement. An attacker who can influence request configuration can supply option values that override Axios-owned fields (such as signal, method, headers, or body) or inject unexpected fetch option keys, causing the request pipeline to crash and producing a denial of service.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via improper validation of runtime options in resolveConfig and related helpers, where an attacker-controlled or malformed configuration value can trigger a crash in the request processing pipeline. The hardening of option handling across fetch.js, http.js, dispatchRequest.js, and supporting helpers indicates that unsanitized option objects could be passed through to the underlying fetch or HTTP adapter in a way that causes an unhandled runtime error, crashing the process and denying service to other users.
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:
AThe 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.DFinally, 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:
- CCC
- CC+C
- C+CC
- 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 axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: follow-redirects
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › follow-redirects@1.16.0Remediation: Upgrade to lerna@10.0.0.
Overview
Affected versions of this package are vulnerable to Improper Removal of Sensitive Information Before Storage or Transfer via the _sanitizeOptions function in index.js when HTTP headers are supplied as a flat key/value array rather than an object. Because the array form is not converted before sensitive-header filtering is applied, headers designated as sensitive are not recognized and are not stripped on redirect, allowing an attacker in a position to observe outbound requests to capture those header values.
Remediation
Upgrade follow-redirects to version 1.16.1 or higher.
References
high severity
- Vulnerable module: http-cache-semantics
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › make-fetch-happen@15.0.2 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › npm-registry-fetch@19.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmaccess@10.0.3 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › npm-registry-fetch@19.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › libnpmpublish@11.1.2 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › pacote@21.0.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/sign@4.1.1 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › @npmcli/arborist@9.1.6 › @npmcli/metavuln-calculator@9.0.3 › pacote@21.5.1 › sigstore@4.1.1 › @sigstore/tuf@4.0.2 › tuf-js@4.1.0 › make-fetch-happen@15.0.6 › http-cache-semantics@4.3.0
Overview
Affected versions of this package are vulnerable to Origin Validation Error via the _varyMatches() function, which fails to properly handle Vary: * (wildcard) headers due to byte-for-byte string comparison. An attacker can request URLs previously fetched by other clients to receive cached responses intended for different users, disclosing sensitive information across clients. The Vary: * directive signals that a response is uncacheable for any other request, but the flawed comparison allows the wildcard to be bypassed, enabling cross-client cache disclosure.
Remediation
There is no fixed version for http-cache-semantics.
References
high severity
- Vulnerable module: smol-toml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › smol-toml@1.6.1Remediation: Upgrade to lerna@10.0.0.
Overview
smol-toml is an A small, fast, and correct TOML parser/serializer
Affected versions of this package are vulnerable to Unchecked Input for Loop Condition due to the skipUntil comment-skipping logic in src/util.ts. An attacker can hang parse() by supplying a TOML document with a value in an array or inline table followed by a # comment that runs to end of input without a trailing newline. The parser gets stuck in an internal loop while searching for the end of the structure, pinning CPU and preventing the application from completing TOML parsing.
Remediation
Upgrade smol-toml to version 1.7.1 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Unintended Proxy or Intermediary ('Confused Deputy') via insufficient hardening of runtime option handling in the fetch and HTTP adapters (lib/adapters/fetch.js, lib/adapters/http.js, and related helpers). An authenticated attacker can supply malicious request options that are passed through without sanitization, allowing them to override Axios-controlled fetch properties such as body, headers, method, signal, duplex, and credentials, leading to a full compromise of request confidentiality and integrity.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via unsafe merging of user-supplied fetchOptions into the resolved request options object in lib/adapters/fetch.js. An attacker who controls request configuration can supply a fetchOptions object with prototype-polluting keys (e.g. __proto__ or constructor), which are spread directly into the options passed to the Fetch API without sanitization, allowing pollution of Object.prototype and affecting downstream system-level behaviour. The fix replaces the spread with Object.assign(Object.create(null), fetchOptions) to strip inherited properties and enforces an allowlist of safe Fetch API keys.
Note: This is only exploitable when the attacker can influence the fetchOptions configuration passed to axios requests.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
high severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Unintended Proxy or Intermediary ('Confused Deputy') via improper enforcement of maxRedirects: 0 in the fetch adapter, where user-supplied fetchOptions are merged into the resolved request options without defaulting the redirect field. When a caller sets maxRedirects: 0 to prevent redirects, the fetch adapter does not apply redirect: 'manual' unless the caller also explicitly sets fetchOptions.redirect, causing the underlying fetch runtime to silently follow a 302 redirect from the initial target and forward the request - including any credentials or sensitive headers - to the redirect destination, which may be attacker-controlled.
Note: This is only exploitable when requests are configured with maxRedirects: 0 but without fetchOptions.redirect: 'manual' or an equivalent runtime-specific redirect control.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Improper Input Validation via insufficient hardening of runtime option handling in the fetch and HTTP adapters, where user-supplied fetchOptions are merged into the resolved request options without sanitization. An attacker who can influence request configuration can inject or override internal Axios-owned options (such as body, headers, method, signal, credentials), leading to integrity impact on the downstream system receiving the request.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Improper Isolation or Compartmentalization in lib/helpers/shouldBypassProxy.js, which matches NO_PROXY entries by exact host or IP and has no parsing for CIDR notation, so an entry such as 127.0.0.0/8 or 10.0.0.0/8 never matches and the request is routed through the configured proxy. An attacker able to observe or operate that proxy can read internal hostnames, request URLs, headers, and any credentials those requests carry, by receiving traffic the deployment intended to keep direct. This requires a Node.js deployment with HTTP_PROXY or HTTPS_PROXY set, at least one NO_PROXY entry written in CIDR form, and a proxy sitting outside the intended trust boundary, and exact host or IP entries in NO_PROXY are matched correctly.
Note: This is only exploitable when requests are configured with proxy: false.
Workaround
This vulnerability can be avoided by writing NO_PROXY entries for sensitive destinations as exact hosts or IP addresses rather than CIDR ranges.
Remediation
Upgrade axios to version 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Prototype Pollution via unsafe merging of user-supplied fetchOptions in lib/adapters/fetch.js. When a caller passes a fetchOptions object, axios spreads it directly into the resolved request options without sanitizing prototype-inherited properties, allowing an attacker who controls request configuration to pollute Object.prototype and influence downstream system behavior such as request routing or security-sensitive option values.
Note: This is only exploitable when the attacker can influence the fetchOptions configuration object passed to axios requests.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade axios to version 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Prototype Pollution via insufficiently hardened runtime option handling in the fetch and HTTP adapters (lib/adapters/fetch.js, lib/adapters/http.js, and related helpers), where user-controlled or prototype-polluted properties on request configuration objects are merged into fetch/request options without sanitization. An attacker who can introduce a prototype-pollution gadget elsewhere in the application can inject arbitrary properties into the resolved fetch options, leading to integrity violations on outbound requests.
Note: This is only exploitable if an existing prototype-pollution path is present in the application.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade axios to version 0.34.0, 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: axios
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › axios@1.18.1Remediation: Upgrade to lerna@10.0.0.
Overview
axios is a promise-based HTTP client for the browser and Node.js.
Affected versions of this package are vulnerable to Prototype Pollution via insufficient hardening of runtime option handling in the fetch and HTTP adapters (lib/adapters/fetch.js, lib/adapters/http.js, and related helpers). An attacker who can influence request configuration options passed to axios can supply unsanitized values that bypass expected constraints, resulting in unintended modification of downstream system behavior (SI:H) such as request routing or proxy bypass, while leaving the client-side response unaffected (VC:N, VI:N, VA:N).
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade axios to version 1.20.0 or higher.
References
medium severity
new
- Vulnerable module: brace-expansion
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › brace-expansion@5.0.8Remediation: Upgrade to lerna@10.0.0.
Overview
brace-expansion is a Brace expansion as known from sh/bash
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the expand_ function, which implements a Bash quirk where a brace group followed by a comma set (e.g. {a},b}) causes the parser to rewrite the input string and restart the scan, absorbing one closing brace per pass. Because each pass re-reads the entire string and the string itself grows by approximately 25 characters per rewrite (due to the escClose sentinel), the work is quadratic in the number of trailing braces, allowing an attacker to block the event loop with a small input. An input of the form '{a}' + '}'.repeat(128000) + ',z}' takes approximately 27 seconds to process while producing only two results, and neither the existing max nor maxLength guards can prevent this because the cost is incurred during parsing before any result set is produced.
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:
AThe 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.DFinally, 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:
- CCC
- CC+C
- C+CC
- 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 brace-expansion to version 1.1.21, 2.1.7, 3.0.9, 5.0.12 or higher.
References
medium severity
new
- Vulnerable module: follow-redirects
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › follow-redirects@1.16.0Remediation: Upgrade to lerna@10.0.0.
Overview
Affected versions of this package are vulnerable to Incorrect Regular Expression in the escapeRegex function in index.js, which escapes ], \, /, (, ), *, +, ?, ., and $ but leaves ^, |, [, {, and } intact, and whose output is joined into the alternation that the RedirectableRequest constructor compiles into this._headerFilter. An attacker can receive a custom credential header that the application declared through sensitiveHeaders by drawing the request into a cross-origin redirect to a host they control, because a declared name holding ^, such as X-Api^Key, gains a mid-pattern start-of-string anchor and can never match, while one holding |, such as X-Token|Secret, splits into the separate alternatives X-Token and Secret, so the real header is forwarded and unrelated headers by those names are stripped instead. Only ^ and | are reachable in practice, since Node rejects [, {, and } in header names with ERR_INVALID_HTTP_TOKEN and declaring one of them instead throws a SyntaxError from the constructor, and the built-in Authorization, Proxy-Authorization, and Cookie entries contain no metacharacters, so the failure is confined to applications that declare their own names and silently lose the protection they configured.
Remediation
Upgrade follow-redirects to version 1.16.1 or higher.
References
medium severity
- Vulnerable module: js-yaml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › js-yaml@4.1.1Remediation: Upgrade to lerna@10.0.0.
Overview
js-yaml is a human-friendly data serialization language.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the storeMappingPair() function in loader.js when handling repeated aliases in merge sequences. An attacker can exhaust CPU resources and significantly degrade service availability by submitting malicious YAML documents.
Remediation
Upgrade js-yaml to version 3.15.0, 4.2.0 or higher.
References
medium severity
new
- Vulnerable module: smol-toml
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › nx@22.7.12 › smol-toml@1.6.1Remediation: Upgrade to lerna@10.0.0.
Overview
smol-toml is an A small, fast, and correct TOML parser/serializer
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via the parseKey function in src/struct.ts, which used the regular expression KEY_PART_RE (/^[a-zA-Z0-9-_]+[ \t]*$/) to validate bare key components. An attacker can supply a TOML document containing a long bare key with trailing characters that cause catastrophic backtracking in the regex engine, blocking the event loop and crashing the process.
Remediation
Upgrade smol-toml to version 1.9.0 or higher.
References
medium severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.0.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Incorrect Type Conversion or Cast via the src/pax.ts file. An attacker can cause a process crash by providing all-digit PAX path or linkpath values that are coerced to JavaScript numbers, leading to a TypeError during downstream path handling.
Remediation
Upgrade tar to version 7.5.18 or higher.
References
medium severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.0.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Interpretation Conflict due to improper handling of PAX extended header size overrides in intermediary metadata headers. An attacker can cause inconsistent archive parsing results between different tar implementations by crafting a malicious tar archive that desynchronizes the parser's interpretation, potentially hiding files from scanners or extractors that rely on different tools.
Remediation
Upgrade tar to version 7.5.16 or higher.
References
medium severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.0.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Uncaught Exception through improper handling of NUL bytes in the src/pax.ts file. An attacker can cause the application to terminate unexpectedly by providing a crafted archive containing NUL bytes in PAX path or linkpath records, which leads to an uncaught exception when these values are passed to filesystem operations.
Remediation
Upgrade tar to version 7.5.17 or higher.
References
medium severity
- Vulnerable module: tar
- Introduced through: lerna@9.0.7
Detailed paths
-
Introduced through: @tsed/cli-root@tsedio/tsed-cli › lerna@9.0.7 › tar@7.5.11Remediation: Upgrade to lerna@10.0.1.
Overview
tar is a full-featured Tar for Node.js.
Affected versions of this package are vulnerable to Uncontrolled Recursion in the mapHas helper and filesFilter function in src/list.ts, which walk an entry path upward with one path.dirname() call per recursion and no segment cap. An attacker can terminate the Node process with an uncatchable stack-overflow RangeError by supplying a tar archive whose GNU L or PAX x long-path header carries tens of thousands of /-separated segments, when that archive is listed or extracted with a member-selection filter. Exploitation requires the application to call tar.t() or tar.x() with a non-empty member-selection list on an untrusted archive, and on async or streaming consumers the error is uncatchable while synchronous APIs can catch it.
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
wspackage
Remediation
Upgrade tar to version 7.5.21 or higher.