Vulnerabilities |
21 via 21 paths |
|---|---|
Dependencies |
99 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
critical severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Improper Certificate Validation via EnvHttpProxyAgent, which fails to apply the application's target TLS options on both direct and proxied routes. Options passed as requestTls are silently dropped when a request goes direct (no proxy configured or host matches NO_PROXY), and options passed as connect are silently dropped when a request is tunnelled through a proxy, causing the TLS connection to the target to fall back to Node.js's default trust store and hostname check, ignoring any custom ca, checkServerIdentity, servername, client certificate, or rejectUnauthorized settings. Because the deployment environment selects the route rather than the application, an attacker who can present a publicly trusted certificate for the target host can intercept connections the application expected to be pinned or restricted to a private CA.
Workaround
Pass the same target TLS options as both requestTls and connect so they are applied on either route, or use Agent (direct) or ProxyAgent (proxied) explicitly instead of EnvHttpProxyAgent.
Remediation
Upgrade undici to version 6.29.2, 7.30.4, 8.14.1 or higher.
References
critical severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Improper Certificate Validation via the redirect interceptor in lib/handler/redirect-handler.js, which builds each follow-up request from the options of the previous one and, on a cross-origin redirect, retains the TLS servername of the first request. As a result, the redirect target's certificate is validated against the first host's name instead of its own, allowing a party that holds a valid certificate for the first host and can intercept traffic to the redirect target to impersonate that target and read or modify the redirected request and its response.
Note: This is only exploitable when redirects are followed via interceptors.redirect() and the first request carries a servername (passed as a request option, set by interceptors.dns() composed outside the redirect interceptor, or sent through a ProxyAgent tunnel without requestTls). fetch() is not affected.
Workaround
Compose the dns interceptor inside the redirect interceptor (agent.compose(interceptors.dns(), interceptors.redirect())), and do not pass a servername on requests that follow redirects. Alternatively, disable automatic redirects and follow them in application code.
Remediation
Upgrade undici to version 6.29.2, 7.30.4, 8.14.1 or higher.
References
critical severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Origin Validation Error via the cache-handler.js redirect-hop inspection logic when an originless Agent composes the redirect and shared cache interceptors as compose(redirect(), cache()). Undici decides whether to store the final response under the original request key by inspecting only the final redirect hop, bypassing the earlier fix for CVE-2026-109829 that compared only the initial and final origins. A redirect that bounces through an untrusted intermediate origin and returns to the trusted origin is still cached under the trusted key, an intermediate hop's Vary header is dropped so a response that varies on Authorization or Cookie can be served to a different user, and an intermediate hop's no-cache or default-uncacheable status is ignored so a non-storable redirect is laundered into a cacheable entry. An attacker who controls the target of a redirect from a trusted URL can poison the cached entry for that URL or have a private, per-user response served to a later caller.
Note: This is only exploitable when an originless Agent, a shared cache store, and compose(redirect(), cache()) are all used together.
Workaround
Compose the interceptors as compose(cache(), redirect()), use per-origin dispatchers and cache stores, or disable shared caching on redirect-capable requests.
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
critical severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Origin Validation Error via a protocol-relative URL misparse in buildRequestUrl (previously new URL(path, origin)) inside the redirect handler. When recording each hop of a redirect chain, a path beginning with // is misread as a protocol-relative URL, causing a hop to an attacker-controlled origin to be recorded as a hop to the trusted origin. An attacker who controls the target of a redirect from a trusted URL - for example through an open redirect - can have their response cached under the trusted URL and served to subsequent callers from the shared cache without either origin being contacted. The same mis-recorded history also allows a cross-origin 304 response to revalidate the trusted cache entry, and with SqliteCacheStore the poisoned entry survives process restarts.
Note: This is only exploitable when a shared MemoryCacheStore or SqliteCacheStore and the composition compose(redirect(), cache()) are used, and the trusted origin redirects to a URL the attacker controls.
Workaround
Use per-origin dispatchers and cache stores, or disable shared caching on redirect-capable requests.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the MemoryCacheStore and SqliteCacheStore built-in cache stores, which count response body bytes against their configured byte limits but retain each delivered body chunk as a separate Buffer object. A malicious or compromised HTTP origin can send a cacheable response framed as a very large number of tiny chunks - for example, one million one-byte HTTP/1.1 chunks - causing per-chunk object overhead (over 100 bytes of heap per payload byte) that is not bounded by the byte limits. With MemoryCacheStore, a few concurrent such responses can exhaust the heap and crash the process while the advertised byte limits are still satisfied; with SqliteCacheStore, whose default maxEntrySize is 2 GB, a single such response is sufficient.
Note: This is only exploitable when the cache interceptor is composed with either built-in store and cacheable requests are issued to an untrusted origin.
Workaround
Avoid composing the cache interceptor, with either built-in store, with requests to untrusted origins.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via the MemoryCacheStore and SqliteCacheStore built-in cache stores, which count response body bytes against their configured byte limits but retain each delivered body chunk as a separate Buffer object. A malicious or compromised HTTP origin can send a cacheable response framed as a very large number of tiny chunks - for example, one million one-byte HTTP/1.1 chunks - causing per-chunk object overhead (over 100 bytes of heap per payload byte) that is not bounded by the byte limits. With MemoryCacheStore, a few concurrent such responses can exhaust the heap and crash the process while the advertised byte limits are still satisfied; with SqliteCacheStore, whose default maxEntrySize is 2 GB, a single such response is sufficient.
Note: This is only exploitable when the cache interceptor is composed with either built-in store and cacheable requests are issued to an untrusted origin.
Workaround
Avoid composing the cache interceptor, with either built-in store, with requests to untrusted origins.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Infinite loop via unbounded HTTP/2 reconnection in lib/dispatcher/client-h2.js when a malicious or compromised HTTP/2 origin holds a request open without ever opening a stream - either by advertising SETTINGS_MAX_CONCURRENT_STREAMS = 0 or while an extended CONNECT request (such as a WebSocket handshake) waits for the peer's SETTINGS - and then repeatedly sends GOAWAY or closes the connection. Each time, undici immediately reconnects and replays the held request without charging it against the existing replay budget, so the request never settles while connection churn consumes CPU. In one reproduction, a single bodyless Client.request() opened 3,773 sessions in 400 ms without settling. With undici 8.x defaults, new WebSocket('wss://host') can negotiate HTTP/2 and reach this path; on undici 7.x the WebSocket path requires allowH2: true.
Note: On undici 7.x, the WebSocket/extended CONNECT path requires the caller to set allowH2: true.
Workaround
Configure the affected dispatcher with allowH2: false to disable HTTP/2.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Uncaught Exception via the stream() API in lib/api/api-stream.js when a Node.js Readable request body is used over HTTP/2. A server that starts a response and then destroys the HTTP/2 session while the upload is still pending causes a single request body error event to reach StreamHandler.onResponseError twice. The second call clears the stored callback, causing the response writable's error handler to invoke runInAsyncScope(null, ...), which throws an uncaught TypeError: Function.prototype.apply was called on null that bypasses the application's callback and error handling entirely, crashing the Node.js process.
Note: This is only exploitable remotely when the application uses stream() with a streaming Readable request body that has not been fully sent when the response starts, and the attacker controls the HTTP/2 server's behavior. request(), Buffer, and generator bodies are not affected by the remote trigger. The same crash can also occur locally over HTTP/1.1 when the application's own request body stream errors after the response has started.
Workaround
Use request() instead of stream() for streaming uploads to untrusted HTTP/2 servers, or send fully buffered request bodies.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Uncaught Exception via a reachable assertion in the HTTP/1.1 response parser (Parser.finish() in lib/dispatcher/client-h1.js). The parser is paused whenever the application applies backpressure to a response body, but Parser.finish() asserts that the parser is not paused when the connection ends. A server that sends a response large enough to fill the 64 KiB body buffer and then closes or resets the connection triggers an AssertionError inside a socket event listener, outside any promise or error event the application can handle. This becomes an uncaught exception that terminates the Node.js process, and is reachable through request() and the global fetch() with a single response regardless of the application's error handling.
Remediation
Upgrade undici to version 6.29.2, 7.30.4, 8.4.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key via the CacheHandler.onResponseStart function in the cache handler. With an originless Agent using a shared cache and compose(redirect(), cache()), when a credential-bearing request to a user-specific URL receives a same-origin redirect to a cacheable per-user resource, the response is stored under the original URL without varying on credentials. A later authenticated or unauthenticated caller requesting that URL receives the first user’s private response from the cache.
Notes
- The shared cache must be a
MemoryCacheStoreorSqliteCacheStore; the advisory identifies these stores as the affected cache implementations.
Workarounds
- Compose the interceptors as
compose(cache(), redirect())to prevent redirected per-user responses from being cached under the original request URL. - Use per-origin dispatchers and cache stores to prevent a shared cache from serving one origin’s user-specific response to callers of another.
- Disable shared caching for credential-bearing requests that can follow redirects to prevent private responses from being reused for other callers.
- Set appropriate
Varyheaders on per-user responses, or mark themprivateorno-store, to prevent shared-cache reuse across users.
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Insufficient Verification of Data Authenticity via the cache interceptor's background stale-while-revalidate revalidation path, when a shared cache serves a response inside its stale-while-revalidate window and the origin returns a 304 Not Modified whose ETag differs from the cached representation. The background revalidation path reuses the stored body and merges the 304's metadata around it, binding the old body to the new validator and freshness policy, instead of discarding the entry and refetching as the synchronous revalidation path does. A remote origin that answers the background conditional request with a mismatched-ETag 304 can therefore cause the shared cache to keep serving a stale representation, re-stamped with the new validator and lifetime, to later callers, potentially disclosing one caller's response body to another.
Note: This is only exploitable when a shared cache store is used and the origin returns a 304 with a mismatched ETag during background revalidation.
Workaround
Use a per-caller cache store instead of a shared one for responses that are not safe to serve across callers, or set no-store or private on such responses so they are not retained in a shared cache.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Exposure of Private Personal Information to an Unauthorized Actor via the shared cache interceptor's background stale-while-revalidate revalidation path. When a shared cache holds a stale entry inside its stale-while-revalidate window, undici serves it and revalidates in the background. If the background revalidation receives a 304 Not Modified response that introduces a Vary field the stored response did not have, undici does not treat the representation as changed: it re-stores the old, unvaried body under the background caller's value of that header and marks it fresh. Later callers with that header value are then served a body generated for a different request, possibly for another user or tenant, without the origin being contacted, resulting in cross-user disclosure of cached responses.
Note: This is only exploitable when a shared cache is used, the origin first returns a cacheable response without Vary and with stale-while-revalidate, and a later background 304 introduces Vary.
Workaround
Use a private cache (type: 'private'), disable stale-while-revalidate reuse for per-user resources, or ensure the origin sends the final Vary header on the initial response.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Improper Validation of Integrity Check Value via the fetch() function's Subresource Integrity verification logic, which splits the integrity string on a single space rather than on all ASCII whitespace characters. An integrity value whose digest is preceded by a horizontal tab or other non-space ASCII whitespace (e.g. \tsha256-...) is parsed as a single unrecognized token and skipped. When no recognized algorithm remains, the integrity list is treated as empty and the response is accepted unconditionally, allowing a server that returns a body different from the pinned digest to pass the check. An attacker who controls the response body can deliver arbitrary bytes to an application that uses whitespace-surrounded SRI metadata, with no integrity error raised.
Workaround
Supply SRI integrity metadata without surrounding whitespace, using a single space to separate multiple digests.
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Insertion of Sensitive Information into Log File via the cleanRequestHeaders function in lib/handler/redirect-handler.js, when request headers are supplied as an array of [name, value] tuples (e.g. via Object.entries(headers)). The redirect interceptor is responsible for stripping sensitive headers such as Authorization, Cookie, Proxy-Authorization, and Host on cross-origin redirects, but it misreads tuple-format headers as a flat alternating [name, value, name, value, ...] list, causing header names to never match the strip list and leaving sensitive headers intact. When a header-normalizing interceptor such as cache() or deduplicate() is composed outside redirect(), it serializes the retained headers onto the cross-origin request, disclosing origin-bound credentials to the redirect destination. This is a representation-dependent bypass of the cross-origin header stripping introduced to address CVE-2024-30260.
Note: This is only exploitable when headers are supplied as an array of [name, value] tuples and a header-normalizing interceptor (cache() or deduplicate()) is composed outside the redirect() interceptor.
Workaround
Supply request headers as a plain object or a flat [name, value, name, value, ...] array rather than an array of [name, value] tuples, or compose the redirect() interceptor outside the normalizing interceptor (cache() or deduplicate()).
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Origin Validation Error via the cache interceptor in lib/interceptor/cache.js when an Agent composes the redirect and shared cache interceptors as compose(redirect(), cache()). The redirect handler strips origin-bound credential headers from a conditional revalidation request but does not strip the cache-generated If-None-Match or If-Modified-Since validators, so when the original origin redirects the revalidation request to a different origin, the redirect destination receives the original origin's validators. undici then treats a 304 Not Modified response from that different origin as successful revalidation of the stored representation, allowing a shared cache to serve the original origin's authenticated response - including one gated by Authorization - to a subsequent unauthenticated caller.
Note: This is only exploitable when a shared MemoryCacheStore or SqliteCacheStore and the composition compose(redirect(), cache()) are used, and an attacker can influence a cross-origin redirect on the revalidated request.
Workaround
Compose the interceptors as compose(cache(), redirect()), use per-origin dispatchers and cache stores, or disable shared caching on redirect-capable requests.
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Uncaught Exception via the cache interceptor in lib/interceptor/cache.js when it is composed with a downstream handler that throws during response processing. When a cached response is replayed through the cache interceptor's async store path, a throw raised asynchronously - for example from the built-in dump interceptor exceeding its maxSize, or the decompress interceptor rejecting more than five Content-Encoding values - escapes as an uncaught exception or unhandled promise rejection and terminates the Node.js process. A malicious or compromised HTTP server can trigger this crash by serving a cacheable response whose replayed body or headers cause the downstream handler to throw, including on a 304 revalidation of a stale cache entry.
Note: This is only exploitable when the cache interceptor is composed with a downstream response handler that throws during response processing (such as dump with a maxSize limit, or decompress with more than five Content-Encoding values).
Workaround
Avoid composing the cache interceptor with a response handler that throws during response processing (such as dump with a maxSize) until upgrading.
Remediation
Upgrade undici to version 7.30.2, 8.12.4 or higher.
References
high severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Uncaught Exception via unhandled error propagation in the dump and retry interceptors when a dispatcher is composed with both and the application discards a response body via body.dump(). A malicious or faulty server that announces a larger content-length than it actually sends, delivers a partial body, and closes the connection causes the abort reason to be lost before reaching the retry handler. The default retry function then receives undefined and throws while reading it, surfacing as an error event on an internal Client with no listener, which causes the Node.js process to exit. Neither the application's try/catch nor the promise returned by request() catches this error, so a remote, unauthenticated server can crash the process with a single response.
Note: This is only exploitable when a dispatcher is composed with both the dump and retry interceptors and response bodies are discarded using body.dump().
Workaround
Avoid composing the retry interceptor together with the dump interceptor on dispatchers whose response bodies are discarded, or pass a custom retry function to interceptors.retry() that tolerates a non-object error by returning it instead of reading properties from it.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
medium severity
new
- Vulnerable module: minimatch
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › minimatch@11.0.8
Overview
minimatch is a minimal matching utility.
Affected versions of this package are vulnerable to Prototype Pollution in the optionsKey and copyOptions functions in src/index.ts. An attacker who controls the options object passed to minimatch() can poison the module-global matcher cache by supplying a __proto__ key (for example via JSON.parse), since optionsKey() assigns it no weight while copyOptions()'s for...in loop copies it as an inherited property onto the cached Minimatch instance, causing later, independent callers matching the same pattern string with no options to receive the attacker's cached behavior (such as case-insensitive matching) instead of the default. This requires an attacker-influenced options object and a pattern string also reused by another caller in the same process.
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 minimatch to version 11.0.10 or higher.
References
medium severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Insufficiently Protected Credentials via ProxyAgent in lib/dispatcher/proxy-agent.js, which writes proxy credentials (from the auth, token options, or the username and password in the proxy URL) as a proxy-authorization entry directly onto the caller's headers object rather than a copy. Any other agent holding that same object then forwards those credentials to its own proxy. EnvHttpProxyAgent passes the same headers object to both the ProxyAgent it creates for HTTP_PROXY and the one it creates for HTTPS_PROXY, so when the two variables name different proxies, one proxy receives the credentials intended for the other. An application that reuses one headers object across multiple ProxyAgent instances is equally affected, allowing the operator of one proxy to capture credentials meant for another.
Note: This is only exploitable when the headers option is explicitly set on ProxyAgent or EnvHttpProxyAgent.
Workaround
Give each ProxyAgent its own headers object and do not reuse it elsewhere. With EnvHttpProxyAgent, avoid the headers option when HTTP_PROXY and HTTPS_PROXY name different proxies and either one carries credentials; create a separate ProxyAgent for each proxy instead.
Remediation
Upgrade undici to version 6.29.2, 7.30.4, 8.14.1 or higher.
References
medium severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Origin Validation Error via the cache interceptor (interceptors.cache()), which builds its cache key from the request's origin, method, and path, but forwards an explicit Host header to the server as the target authority. When an application sends requests for multiple virtual hosts to a single origin by varying the Host header, a cacheable response for one host is stored under the shared origin key and served to a subsequent request for a different host without that request reaching the server. This can disclose one host's response to callers of another, and allows a caller who controls the Host header to influence the cached response that other requests to the same origin and path receive.
Note: This is only exploitable when the cache interceptor is in use and requests are sent with a Host header naming a different authority than the request origin; responses that include a Vary: Host header are not affected.
Workaround
Do not compose interceptors.cache() on dispatchers that send requests with an explicit Host header for a different host, use a separate dispatcher and cache store per host, or have the server send Vary: Host on responses that differ by host.
Remediation
Upgrade undici to version 7.30.4, 8.14.1 or higher.
References
medium severity
new
- Vulnerable module: undici
- Introduced through: nx@24.1.1
Detailed paths
-
Introduced through: contract-case@case-contract-testing/case › nx@24.1.1 › undici@7.30.1
Overview
undici is an An HTTP/1.1 client, written from scratch for Node.js
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the trimOWS helper in the RFC 9111 cache interceptor, which uses the regular expression /^[\t ]+|[\t ]+$/g to trim optional whitespace from Cache-Control and Vary response headers. A malicious or compromised origin that returns a header value containing a long run of internal whitespace forces the client to spend O(N^2) CPU time parsing a single size-bounded response, synchronously blocking the Node.js event loop for 100 to 200 milliseconds at the default maxHeaderSize and for several seconds when applications raise that limit, with concurrent responses serialized.
Note: This is only exploitable when the cache interceptor (undici.interceptors.cache()) is in use; the default fetch() and request paths trim headers with a linear scanner and are unaffected.
Workaround
Do not compose the cache interceptor (undici.interceptors.cache()). The default request and fetch() paths are unaffected.
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 undici to version 7.30.4, 8.14.1 or higher.