Vulnerabilities

26 via 66 paths

Dependencies

462

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 26
  • 9
Severity
  • 2
  • 15
  • 17
  • 1
Status
  • 35
  • 0
  • 0

critical severity
new

Improper Certificate Validation

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in the BalancedPool class, which deep-clones its connect and tls options with JSON.parse(JSON.stringify(...)) and thereby silently drops any function-valued callbacks, such as a custom checkServerIdentity or connector, before they reach the TLS layer. An attacker can present a server certificate that the caller's custom checkServerIdentity was written to reject and still have it accepted, as long as it passes Node's default hostname and chain checks, because the discarded check never runs. This affects only BalancedPool configured with function-valued connect or tls options, and not Client, Pool, Agent, or RoundRobinPool.

Workaround

This vulnerability can be avoided by using Client, Pool, or Agent instead of BalancedPool for connections that rely on a custom checkServerIdentity or connector, so the callback is not stripped before reaching the TLS layer.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

critical severity
new

Origin Validation Error

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 leading to cache poisoning in the interceptors.cache() and interceptors.deduplicate() interceptors, which build cache and deduplication keys without the actual destination origin when the dispatcher lacks a single authoritative origin or requests supply their own origin. An attacker who controls responses from one origin can have them returned for requests to a different, trusted origin whose method, path, and relevant headers match, enabling cross-origin information disclosure and persistent cache poisoning such as JWKS poisoning. This requires a cache store or interceptor instance shared across multiple origins, together with a dispatcher that has no single authoritative origin or requests that carry their own origin.

Workaround

This vulnerability can be avoided by using separate cache stores and interceptor instances per origin rather than sharing them across origins, so requests to different origins cannot share a cache key.

Remediation

Upgrade undici to version 8.10.2 or higher.

References

high severity
new

Prototype Pollution

  • Vulnerable module: joi
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › joi@18.2.3

Overview

Affected versions of this package are vulnerable to Prototype Pollution via the compile() and merge() functions in lib/messages.js, where passing __proto__ as a top-level error-code key (or as a language-scoped sub-key) to the .messages() API triggers the legacy __proto__ accessor on plain-object assignment, replacing the returned messages object's own prototype instead of creating an own property. An attacker who controls the messages configuration can overwrite Object.prototype properties, affecting the integrity of objects across the application. This is a sibling of the previously fixed GHSA-6w3j-5fw6-r9vr and GHSA-gg4h-3hg2-grpc, reaching flat write paths in both compile() and merge() that those fixes did not address.

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 Object recursive merge

  • Property 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

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade joi to version 17.13.8, 18.2.9 or higher.

References

high severity
new

Prototype Pollution

  • Vulnerable module: deepmerge
  • Introduced through: sanitize-html@2.17.7

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › sanitize-html@2.17.7 › deepmerge@4.3.1

Overview

Affected versions of this package are vulnerable to Prototype Pollution via mergeObject(), which fails to validate keys before writing them to target objects. An attacker can supply a malicious source object containing a __proto__ key in a merge operation, injecting attacker-controlled properties into the prototype of the returned object and causing applications to inherit unintended values when accessing properties without own-property checks. We score this differently from NVD: prototype pollution that achieves property injection into Object.prototype with no authentication and no user interaction warrants a High integrity impact, consistent with the supplied CVSS vectors.

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 Object recursive merge

  • Property 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

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

There is no fixed version for deepmerge.

References

high severity

Prototype Pollution

  • Vulnerable module: find-my-way
  • Introduced through: restify@11.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › restify@11.1.0 › find-my-way@7.7.0
    Remediation: Upgrade to restify@12.0.0.

Overview

Affected versions of this package are vulnerable to Prototype Pollution in the lookup function when handling HTTP/2 requests. An attacker can cause the application to crash by sending specially crafted HTTP method values that exploit inherited object properties, leading to a denial of service.

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 Object recursive merge

  • Property 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

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade find-my-way to version 9.7.0 or higher.

References

high severity
new

Uncontrolled Recursion

  • Vulnerable module: ioredis
  • Introduced through: ioredis@5.11.1 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › ioredis@5.11.1
    Remediation: Upgrade to ioredis@6.0.0.
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › ioredis@5.11.1

Overview

ioredis is a Redis client for Node.js.

Affected versions of this package are vulnerable to Uncontrolled Recursion in the RESP protocol parser in lib/parser.js. An attacker can crash the Node.js client process by sending crafted RESP byte streams with repeated nested array headers. The parser recurses while handling nested arrays, exhausting the V8 call stack and triggering an uncaught RangeError. In affected deployments that consume data from a malicious or compromised Redis endpoint, this terminates the process and disrupts Redis client operations.

Remediation

Upgrade ioredis to version 6.0.0-beta.1 or higher.

References

high severity
new

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: joi
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › joi@18.2.3

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) through the isoDate validation rule. An attacker can cause the application to become unresponsive by submitting a specially crafted string containing a valid ISO date followed by a long sequence of fractional-second digits, which triggers excessive backtracking in the regular expression engine.

Workaround

This vulnerability can be mitigated by capping the length of the string before it is processed.

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 joi to version 17.13.7, 18.2.6 or higher.

References

high severity
new

Improper Verification of Cryptographic Signature

  • Vulnerable module: node-forge
  • Introduced through: node-forge@1.4.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › node-forge@1.4.0

Overview

node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature in rsa.js, whose DigestInfo validation checks the outer element count (obj.value.length !== 2) but never verifies the element count of the inner DigestAlgorithm SEQUENCE, so the ASN.1 parser accepts extra children that are ignored during digest extraction. An attacker can forge a signature that verifies as valid for an arbitrary message, without the private key, by fixing the target digest at the block boundaries and filling roughly 314 garbage bytes inside the DigestAlgorithm structure to absorb the mathematical residue. This only affects verification against RSA keys with a low public exponent such as e=3, and although _parseAllDigestBytes defaults to true and rejects trailing garbage, it does not detect this interior padding.

Note: This is a bypass of the fix for the vulnerability described in CVE-2026-33894 and, as of this publication, has not been acknowledged by project maintainers.

Remediation

A fix was pushed into the master branch but not yet published.

References

high severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: nodemailer
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › nodemailer@9.0.4

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity through the addressparser function in lib/addressparser/index.js. An attacker can block the Node.js event loop by supplying a crafted comma-separated address list, such as a To, Cc, Bcc, From, or Reply-To header value, that forces the parser to spend CPU time proportional to the square of the input size. This stalls email processing and delays or freezes every other request handled by the same process.

Remediation

Upgrade nodemailer to version 9.1.0 or higher.

References

high severity
new

Uncaught Exception

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in its WebSocket client, in the form of a TypeError inside a queueMicrotask callback when a server's 101 response carries a Sec-WebSocket-Protocol header the client never requested. An attacker can crash the process by returning a 101 handshake response that names a subprotocol the client did not offer. This requires the application to open a WebSocket without requesting a subprotocol to an attacker-controlled or compromised server, or over plaintext ws:// where a MitM can alter the handshake.

Remediation

Upgrade undici to version 6.28.1, 7.29.1, 8.10.2 or higher.

References

high severity
new

Interpretation Conflict

  • Vulnerable module: nodemailer
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › nodemailer@9.0.4

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Interpretation Conflict via RFC 5322 comment mis-parsing in lib/addressparser/index.js. An attacker can make mail be delivered to an attacker-controlled domain by supplying a recipient such as user@good-corp.com(x)evil.com, which the parser glues into good-corp.comevil.com instead of treating the comment as folding whitespace. Applications that approve recipients by parsing or matching the domain separately can be tricked into sending mail to a domain they never intended to allow, exposing messages to the attacker-controlled recipient.

Remediation

Upgrade nodemailer to version 9.1.0 or higher.

References

high severity
new

Interpretation Conflict

  • Vulnerable module: nodemailer
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › nodemailer@9.0.4

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Interpretation Conflict through _normalizeAddress in lib/mime-node/index.js. An attacker can cause mail to be delivered to an attacker-controlled domain by supplying a recipient address whose domain contains an IDN-mapped or ignored code point, such as an invisible soft hyphen, that a standards-compliant domain check resolves to a trusted domain but Nodemailer encodes to a different xn-- label. This can make an application approve or display one recipient domain while Nodemailer sends the message to another external domain, exposing the intended email content and breaking domain-based recipient controls.

Remediation

Upgrade nodemailer to version 9.1.0 or higher.

References

high severity
new

Use of Persistent Cookies Containing Sensitive Information

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Use of Persistent Cookies Containing Sensitive Information in the interceptors.cache() interceptor's shared-cache mode (type: 'shared'), which stores responses without excluding their Set-Cookie headers, contrary to RFC 6265 section 7.2. An attacker can have one user's cookie served to every subsequent caller matching the same cache key, or inject an upstream-supplied cookie into responses served to all callers, by getting a cacheable response that carries a Set-Cookie header cached. This requires the shared-cache mode, which is the default for the cache interceptor, with cacheable Set-Cookie responses from a multi-user or untrusted upstream, and private caches are unaffected.

Workaround

This vulnerability can be avoided by running the cache interceptor in private mode (type: 'private'), so per-user Set-Cookie responses are not shared across callers.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

high severity
new

Allocation of Resources Without Limits or Throttling

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in the interceptors.decompress() interceptor, which caps the decompression chain at 5 layers but does not bound the total decompressed output size. An attacker can exhaust memory and crash the process by delivering, from a malicious upstream, a small compressed response whose Content-Encoding expands to gigabytes. This requires the application to use the interceptors.decompress() interceptor against untrusted or compromised upstream servers.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

high severity
new

Missing Release of Resource after Effective Lifetime

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime in the RetryHandler, which can leave a response body pending indefinitely when a retried request receives a non-retryable response after a truncated one. An attacker can accumulate unresolved promises and streams until the client is denied service by running a malicious server that repeatedly returns a non-retryable response following a truncated one, so the original response body never resolves and calls like response.body.text() never complete. This requires the application to retry requests through the RetryHandler, and bodyTimeout does not fire because the orphaned body is never active.

Workaround

This vulnerability can be avoided by imposing an independent request deadline and destroying the response body when it expires, since bodyTimeout alone does not release the orphaned body.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

high severity
new

Uncaught Exception

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in the WebSocketStream API, whose socket-close handler calls abort() on the writable stream while the application holds a writer lock and then discards the rejected promise that aborting a locked stream returns. An attacker can crash the process through Node's default unhandledRejection handling by tearing down a WebSocket connection without completing the close handshake, for example with a TCP reset, a proxy teardown, or a protocol-violating frame. This requires the application to use the WebSocketStream API while actively writing through a writer, and the server to be attacker-controlled or compromised.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

high severity
new

Uncaught Exception

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in lib/web/websocket/permessage-deflate.js, whose cleanup calls removeAllListeners() on the zlib InflateRaw object, removing the error listener while the stream is still active. An attacker can crash the Node.js process, and repeat the crash on every reconnect to form a crash loop, by sending a permessage-deflate WebSocket message of roughly 130 KB that exceeds the decompressed-payload size limit and contains a malformed DEFLATE block, so the resulting Z_DATA_ERROR has no listener. This requires the application to use undici's WebSocket client or Node's bundled globalThis.WebSocket against an attacker-controlled or compromised WebSocket server.

Remediation

Upgrade undici to version 6.28.1, 7.29.1, 8.10.2 or higher.

References

medium severity

Regular Expression Denial of Service (ReDoS)

  • Vulnerable module: find-my-way
  • Introduced through: restify@11.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › restify@11.1.0 › find-my-way@7.7.0
    Remediation: Upgrade to restify@12.0.0.

Overview

Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when including two parameters ending with - in a single segment, which causes inefficient backtracking when parsing the string into a regular expression. The resulting poor performance can lead to denial of service.

Note:

This vulnerability is similar to the path-to-regexp ReDoS Vulnerability

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:

  • A The 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.
  • D Finally, 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:

  1. CCC
  2. CC+C
  3. C+CC
  4. 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 find-my-way to version 8.2.2, 9.0.1 or higher.

References

medium severity
new

Prototype Pollution

  • Vulnerable module: joi
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › joi@18.2.3

Overview

Affected versions of this package are vulnerable to Prototype Pollution via the compile and merge functions in lib/messages.js, where a language key named __proto__ or constructor in a user-supplied messages object causes writes to flow onto Object.prototype rather than the intended target object. An attacker who can control the messages configuration passed to joi can pollute the prototype chain of all objects in the process, potentially altering application behaviour.

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 Object recursive merge

  • Property 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

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade joi to version 17.13.6, 18.2.5 or higher.

References

medium severity
new

Prototype Pollution

  • Vulnerable module: joi
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › joi@18.2.3
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › joi@18.2.3

Overview

Affected versions of this package are vulnerable to Prototype Pollution in the rename method. An attacker can manipulate the prototype of the validated object by supplying specially crafted input keys that are interpreted as __proto__, leading to unintended property inheritance or behavior in the returned object.

Note: This is only exploitable if the schema uses a regular-expression source with a template target and the { multiple: true } option enabled.

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 Object recursive merge

  • Property 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

  1. Freeze the prototype— use Object.freeze (Object.prototype).

  2. Require schema validation of JSON input.

  3. Avoid using unsafe recursive merge functions.

  4. Consider using objects without prototypes (for example, Object.create(null)), breaking the prototype chain and preventing pollution.

  5. As a best practice use Map instead of Object.

For more information on this vulnerability type:

Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018

Remediation

Upgrade joi to version 17.13.5, 18.2.4 or higher.

References

medium severity
new

HTTP Request Smuggling

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to HTTP Request Smuggling in the interceptors.retry() interceptor, which resumes a partial response and appends the resumed bytes to an already-delivered body, so the delivered body can exceed the declared Content-Length. An attacker can inject bytes beyond the Content-Length into a forwarded response and split the downstream HTTP response by running an upstream that returns a partial response and then resumes it with a Range request, for example a 404 with Content-Length: 2 that sends one byte, closes, then appends 206 Partial Content bytes. This requires the application to enable interceptors.retry(), an untrusted or faulty upstream, and a downstream proxy or gateway that forwards the body without recalculating framing.

Workaround

This vulnerability can be avoided by removing or recalculating Content-Length before forwarding a response body, so a resumed over-length body cannot desynchronize the downstream response.

Remediation

Upgrade undici to version 6.28.1, 7.29.1, 8.10.2 or higher.

References

medium severity
new

Insufficient Verification of Data Authenticity

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

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 in the interceptors.cache() interceptor, whose skip-list construction subtracts the configured methods from the safe-method set instead of excluding the unsafe methods (POST, PUT, PATCH, DELETE), and whose canCacheResponse storage gate does not validate the method. An attacker can have a fabricated response served for later state-changing requests, which then never reach the origin, by returning from an untrusted origin a heuristically cacheable response such as a 404 that carries an explicit Cache-Control: max-age directive to an unsafe method. This applies under the default cache configuration (methods: ['GET']) and requires the origin to return a heuristically cacheable response bearing an explicit cache-control directive.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

medium severity
new

Numeric Truncation Error

  • Vulnerable module: undici
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › undici@8.10.0
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › undici@8.10.0

Overview

undici is an An HTTP/1.1 client, written from scratch for Node.js

Affected versions of this package are vulnerable to Numeric Truncation Error in the interceptors.dump() interceptor, which, for a chunked response with no Content-Length, does not abort an oversized body but terminates after reaching maxSize and trips an internal assertion that is caught and converted into a request abort and connection tear-down. An attacker can cause the application to receive a misleading 200 response with a truncated or empty body, followed by a dropped connection, by returning from an upstream a chunked response without Content-Length that exceeds the dump limit. This requires the application to use the interceptors.dump() interceptor against an untrusted or misbehaving upstream.

Remediation

Upgrade undici to version 7.29.1, 8.10.2 or higher.

References

medium severity

Improper Validation of Specified Index, Position, or Offset in Input

  • Vulnerable module: uuid
  • Introduced through: @zone-eu/mobileconfig@2.4.6 and restify@11.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/mobileconfig@2.4.6 › uuid@8.3.2
    Remediation: Upgrade to @zone-eu/mobileconfig@2.4.7.
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › restify@11.1.0 › uuid@9.0.1
    Remediation: Upgrade to restify@12.0.0.

Overview

uuid is a RFC4122 (v1, v4, and v5) compliant UUID library.

Affected versions of this package are vulnerable to Improper Validation of Specified Index, Position, or Offset in Input due to accepting external output buffers but not rejecting out-of-range writes (small buf or large offset). This inconsistency allows silent partial writes into caller-provided buffers.

PoC

cd /home/StrawHat/uuid
npm ci
npm run build

node --input-type=module -e "
import {v4,v5,v6} from './dist-node/index.js';
const ns='6ba7b810-9dad-11d1-80b4-00c04fd430c8';
for (const [name,fn] of [
  ['v4',()=>v4({},new Uint8Array(8),4)],
  ['v5',()=>v5('x',ns,new Uint8Array(8),4)],
  ['v6',()=>v6({},new Uint8Array(8),4)],
]) {
  try { fn(); console.log(name,'NO_THROW'); }
  catch(e){ console.log(name,'THREW',e.name); }
}"

Remediation

Upgrade uuid to version 11.1.1, 14.0.0 or higher.

References

medium severity
new

Server-side Request Forgery (SSRF)

  • Vulnerable module: nodemailer
  • Introduced through: mailauth@5.0.3 and @zone-eu/zone-mta@3.11.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mailauth@5.0.3 › nodemailer@9.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @zone-eu/zone-mta@3.11.0 › mx-connect@2.0.0 › mailauth@5.0.1 › nodemailer@9.0.4

Overview

nodemailer is an Easy as cake e-mail sending from your Node.js applications

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the resolveContent() method in lib/mailer/mail-message.js. An attacker can read local files or trigger outbound URL fetches by supplying html or attachment content that is resolved through the legacy mail.resolveContent(data, key, callback) signature. When a plugin or application calls this API on a message created with disableFileAccess or disableUrlAccess, the access policy is dropped and the content resolver reaches fs.createReadStream() or nmfetch(), exposing server files or causing SSRF.

Remediation

Upgrade nodemailer to version 9.1.1 or higher.

References

medium severity

MPL-2.0 license

  • Module: @root/acme
  • Introduced through: @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/asn1
  • Introduced through: @root/csr@0.8.1 and @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/asn1@1.0.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/asn1@1.0.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/x509@0.7.2 › @root/asn1@1.0.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/asn1@1.0.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/asn1@1.0.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/x509@0.7.2 › @root/asn1@1.0.2

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/csr
  • Introduced through: @root/csr@0.8.1 and @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/encoding
  • Introduced through: @root/acme@3.1.0 and @root/csr@0.8.1

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/asn1@1.0.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/x509@0.7.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/asn1@1.0.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/x509@0.7.2 › @root/asn1@1.0.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/asn1@1.0.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/x509@0.7.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/x509@0.7.2 › @root/asn1@1.0.2 › @root/encoding@1.0.1
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/x509@0.7.2 › @root/asn1@1.0.2 › @root/encoding@1.0.1

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/keypairs
  • Introduced through: @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/pem
  • Introduced through: @root/csr@0.8.1 and @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/pem@1.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/pem@1.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/pem@1.0.4
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/pem@1.0.4

MPL-2.0 license

medium severity

MPL-2.0 license

  • Module: @root/x509
  • Introduced through: @root/csr@0.8.1 and @root/acme@3.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/csr@0.8.1 › @root/x509@0.7.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/x509@0.7.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/csr@0.8.1 › @root/x509@0.7.2
  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › @root/acme@3.1.0 › @root/keypairs@0.10.3 › @root/x509@0.7.2

MPL-2.0 license

medium severity

LGPL-3.0 license

  • Module: openpgp
  • Introduced through: openpgp@6.1.1

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › openpgp@6.1.1

LGPL-3.0 license

medium severity

MPL-2.0 license

  • Module: pem-jwk
  • Introduced through: pem-jwk@2.0.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › pem-jwk@2.0.0

MPL-2.0 license

low severity

Cross-site Scripting

  • Vulnerable module: send
  • Introduced through: restify@11.1.0

Detailed paths

  • Introduced through: @zone-eu/wildduck@nodemailer/wildduck › restify@11.1.0 › send@0.18.0
    Remediation: Upgrade to restify@12.0.0.

Overview

send is a Better streaming static file server with Range and conditional-GET support

Affected versions of this package are vulnerable to Cross-site Scripting due to improper user input sanitization passed to the SendStream.redirect() function, which executes untrusted code. An attacker can execute arbitrary code by manipulating the input parameters to this method.

Note:

Exploiting this vulnerability requires the following:

  1. The attacker needs to control the input to response.redirect()

  2. Express MUST NOT redirect before the template appears

  3. The browser MUST NOT complete redirection before

  4. The user MUST click on the link in the template

Details

Cross-site scripting (or XSS) is a code vulnerability that occurs when an attacker “injects” a malicious script into an otherwise trusted website. The injected script gets downloaded and executed by the end user’s browser when the user interacts with the compromised website.

This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.

Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.

Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as &lt; and > can be coded as &gt; in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.

The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.

Types of attacks

There are a few methods by which XSS can be manipulated:

Type Origin Description
Stored Server The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link.
Reflected Server The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser.
DOM-based Client The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data.
Mutated The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters.

Affected environments

The following environments are susceptible to an XSS attack:

  • Web servers
  • Application servers
  • Web application environments

How to prevent

This section describes the top best practices designed to specifically protect your code:

  • Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
  • Convert special characters such as ?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
  • Give users the option to disable client-side scripts.
  • Redirect invalid requests.
  • Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
  • Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
  • Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.

Remediation

Upgrade send to version 0.19.0, 1.1.0 or higher.

References