Vulnerabilities |
31 via 31 paths |
|---|---|
Dependencies |
165 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: engine.io
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › engine.io@4.1.2Remediation: Upgrade to socket.io@4.8.0.
Overview
engine.io is a realtime engine behind Socket.IO. It provides the foundation of a bidirectional connection between client and server
Affected versions of this package are vulnerable to Improper Resource Shutdown or Release through the polling request handler in Polling transport processing. An attacker can consume server-side sockets and related HTTP resources by sending an invalid Engine.IO v4 polling POST request with Content-Type: application/octet-stream after establishing a polling session. The vulnerable code reports invalid content but leaves the HTTP response open, so repeated malformed requests can accumulate unfinished connections. This can prevent legitimate clients from connecting and exhaust available file descriptors or connection slots on the server.
Notes
- The vulnerable path is limited to Engine.IO protocol v4 polling
POSTrequests that presentContent-Type: application/octet-stream; other polling traffic is not in scope for this issue.
Workarounds
- Block or reject Engine.IO protocol v4 polling
POSTrequests withContent-Type: application/octet-streamat a reverse proxy, load balancer, WAF, or application middleware to prevent the malformed request path that can leave HTTP connections open and consume sockets/resources. - Disable HTTP long-polling and use WebSocket-only transport if your deployment and clients support it to prevent exposure of the vulnerable polling handler.
- Enforce strict request and connection timeouts at the HTTP server, reverse proxy, or load balancer to limit how long malformed polling requests can hold server-side connections open.
- Apply per-IP rate limits and connection limits for Engine.IO endpoints to reduce the ability to repeat the crafted polling requests and exhaust server resources.
- Restrict access to the Socket.IO/Engine.IO endpoint where feasible to limit who can reach the vulnerable polling transport.
Remediation
Upgrade engine.io to version 6.6.7 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@9.1.0.
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
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.6.
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 via the address parser in src/addressparser/index.ts, where the regex /\s*\b[^@\s]+@[^\s]+\b\s*/ was used to search free text for an email address. The [^@\s]+ quantifier causes quadratic backtracking: from every offset it rescans the run up to the next @ and then fails, advancing one character and repeating. An attacker who can supply a long whitespace-free string containing no usable @ character can block the Node.js event loop for tens of seconds, with 273 KB of input producing approximately 43 seconds of blocking.
Remediation
Upgrade nodemailer to version 10.0.6 or higher.
References
high severity
- Vulnerable module: socket.io
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2Remediation: Upgrade to socket.io@4.6.2.
Overview
socket.io is a node.js realtime framework server.
Affected versions of this package are vulnerable to Uncaught Exception in handling error events. If there is no listener set up for such events, an attacker can send packets containing them to crash the Node process.
Workaround
This vulnerability can be avoided by attaching a listener for error events, such as
io.on("connection", (socket) => {
socket.on("error", () => {
// ...
});
});
Remediation
Upgrade socket.io to version 2.5.1, 4.6.2 or higher.
References
high severity
- Vulnerable module: socket.io-parser
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › socket.io-parser@4.0.5Remediation: Upgrade to socket.io@4.5.2.
Overview
socket.io-parser is a socket.io protocol parser
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling in the Decoder class, which accepts an unlimited number of binary attachments. An attacker can exploit this to exhaust server memory.
Remediation
Upgrade socket.io-parser to version 3.3.5, 3.4.4, 4.2.6 or higher.
References
high severity
- Vulnerable module: socket.io-parser
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › socket.io-parser@4.0.5Remediation: Upgrade to socket.io@4.5.2.
Overview
socket.io-parser is a socket.io protocol parser
Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions via attachment handling. An attacker can cause the server to exhaust memory resources by sending specially crafted packets that make the server wait for and buffer a large number of binary attachments.
Remediation
Upgrade socket.io-parser to version 3.3.6, 3.4.5, 4.2.7 or higher.
References
high severity
- Vulnerable module: ws
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › engine.io@4.1.2 › ws@7.4.6Remediation: Upgrade to socket.io@4.8.0.
Overview
ws is a simple to use websocket client, server and console for node.js.
Affected versions of this package are vulnerable to Asymmetric Resource Consumption (Amplification) when handling a large number of very small fragments and data chunks. An attacker can cause excessive memory allocation and OOM by sending a high volume of tiny WebSocket frames
Workaround
This vulnerability can be mitigated by lowering the value of the maxPayload option.
PoC
import { WebSocket, WebSocketServer } from 'ws';
const wss = new WebSocketServer({ port: 0 }, function () {
const data = Buffer.alloc(1);
const options = { fin: false };
const { port } = wss.address();
const ws = new WebSocket(`ws://localhost:${port}`);
ws.on('open', function () {
(function send() {
ws.send(data, options, function (err) {
if (err) return;
send();
});
})();
});
ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(`client close - code: ${code} reason: ${reason.toString()}`);
});
});
wss.on('connection', function (ws) {
ws.on('error', console.error);
ws.on('close', function (code, reason) {
console.log(`server close - code: ${code} reason: ${reason.toString()}`);
});
});
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade ws to version 5.2.5, 6.2.4, 7.5.11, 8.21.0 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@9.1.0.
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
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@9.1.0.
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
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.1.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 the address parser in src/addressparser/index.ts when processing email header values containing nested comments. RFC 5322 §3.2.2 defines comments as nestable, but the tokenizer ends a comment at the first ) encountered, so the ) closing an inner comment prematurely closes the outer one and releases the remaining comment text, including any address it contains, into the parsed header. An attacker can construct a To header such as Victim (x(y) <evil@evil.com>) <v@victim.com> to redirect delivery to evil@evil.com instead of the intended v@victim.com, because the envelope RCPT TO is derived from the same malformed parse.
PoC
const addressparser = require('nodemailer/lib/addressparser');
console.log(addressparser("Victim (x(y) <evil@evil.com>) <v@victim.com>"));
// [ { address: 'evil@evil.com', name: 'Victim) v@victim.com' } ]
Python's email._header_value_parser.get_address_list reads the same value as v@victim.com with the display name Victim, with no defects reported.
The envelope a message gets is built from the same parse, so sendMail({ to: "Victim (x(y) <evil@evil.com>) <v@victim.com>" }) issues the RCPT TO shown above.
Note: The PoC states no specific environment, runtime version, or operating system.
Remediation
Upgrade nodemailer to version 10.1.4 or higher.
References
high severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.1.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 the address parser in src/addressparser/index.ts, where the tokenizer tracks only a single open operator and does not account for quoted strings, comments, or domain literals nested inside an angle-addr or group. An attacker who controls a recipient address can supply a value such as 'G: (a; <evil@evil.com>) <v@victim.com>;' to cause the parser to terminate the group at the ; inside the comment, resulting in evil@evil.com being added to the SMTP envelope as a recipient instead of, or in addition to, the intended address. Similarly, a quoted local part containing > prematurely closes an angle-addr, so <"a@evil.com>"@good.com> is resolved to evil.com rather than good.com.
PoC
const addressparser = require('nodemailer/lib/addressparser');
console.log(addressparser("G: (a; <evil@evil.com>) <v@victim.com>;"));
// [ { name: 'G', group: [ [Object] ] }, { address: 'evil@evil.com', name: ') v@victim.com' } ]
Python's email._header_value_parser.get_address_list reads the same value as the single mailbox v@victim.com, with no defects reported.
The envelope a message gets is built from the same parse, so sendMail({ to: "G: (a; <evil@evil.com>) <v@victim.com>;" }) issues the RCPT TO shown above.
Note: The PoC uses the addressparser module bundled with nodemailer and states no specific version, OS, or non-default configuration.
Remediation
Upgrade nodemailer to version 10.1.4 or higher.
References
high severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.1.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 the address parser (src/addressparser/index.ts) when processing angle-addr and group constructs. The tokenizer tracks only a single open operator and, once < or : is encountered, looks only for the closing > or ; without accounting for quoted strings, comments, or domain literals that may appear inside. A > character inside a quoted local part therefore terminates the angle-addr prematurely, so an input such as <"a@evil.com>"@good.com> is parsed as an address at evil.com rather than the RFC 5322-conformant mailbox "a@evil.com>"@good.com. Similarly, a ; inside a quoted display name or a comment prematurely closes a group, causing additional recipients to be injected into the envelope, so G: (a; <evil@evil.com>) <v@victim.com>; delivers only to evil@evil.com instead of v@victim.com.
PoC
const addressparser = require('nodemailer/lib/addressparser');
console.log(addressparser("<\"a@evil.com>\"@good.com>"));
// [ { address: '"a@evil.com', name: '@good.com>' } ]
Python's email._header_value_parser.get_address_list reads the same value as "a@evil.com>"@good.com, with no defects reported.
The envelope a message gets is built from the same parse, so sendMail({ to: "<\"a@evil.com>\"@good.com>" }) issues the RCPT TO shown above.
Note: The PoC states no specific environment, runtime version, or operating system.
Remediation
Upgrade nodemailer to version 10.1.4 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@7.0.11.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Uncontrolled Recursion in the addressparser function. An attacker can cause the process to terminate immediately by sending an email address header containing deeply nested groups, separated by many :s.
Remediation
Upgrade nodemailer to version 7.0.11 or higher.
References
high severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.2.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Uncontrolled Recursion via _parseAddresses in src/mime-node/index.ts when a recipient field is supplied as a deeply nested array. The native array-to-string conversion applied before passing the value to addressparser recurses once per nesting level, so a recipient wrapped in roughly a few thousand arrays (approximately 10 KB of JSON) exhausts the call stack and causes a RangeError. Because the compile step of sendMail was not wrapped in a try/catch, the synchronous throw escapes the callback chain and can crash the process.
Note: This is only exploitable if the caller does not catch the complete synchronous invocation of sendMail.
Remediation
Upgrade nodemailer to version 10.0.2 or higher.
References
high severity
- Vulnerable module: engine.io
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › engine.io@4.1.2Remediation: Upgrade to socket.io@4.5.0.
Overview
engine.io is a realtime engine behind Socket.IO. It provides the foundation of a bidirectional connection between client and server
Affected versions of this package are vulnerable to Denial of Service (DoS). A malicious client could send a specially crafted HTTP request, triggering an uncaught exception and killing the Node.js process.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade engine.io to version 3.6.1, 6.2.1 or higher.
References
high severity
- Vulnerable module: socket.io-parser
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › socket.io-parser@4.0.5Remediation: Upgrade to socket.io@4.5.2.
Overview
socket.io-parser is a socket.io protocol parser
Affected versions of this package are vulnerable to Denial of Service (DoS) due to insufficient validation when decoding a packet. An attacker can send an event with a name like '2[{"toString":"foo"}]' to trigger an uncaught exception and a crash, like the below.
TypeError: Cannot convert object to primitive value
at Socket.emit (node:events:507:25)
at .../node_modules/socket.io/lib/socket.js:531:14
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade socket.io-parser to version 3.4.3, 4.2.3 or higher.
References
high severity
- Vulnerable module: ws
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › engine.io@4.1.2 › ws@7.4.6Remediation: Upgrade to socket.io@4.7.0.
Overview
ws is a simple to use websocket client, server and console for node.js.
Affected versions of this package are vulnerable to Denial of Service (DoS) when the number of received headers exceed the server.maxHeadersCount or request.maxHeadersCount threshold.
Workaround
This issue can be mitigating by following these steps:
Reduce the maximum allowed length of the request headers using the
--max-http-header-size=sizeand/or themaxHeaderSizeoptions so that no more headers than theserver.maxHeadersCountlimit can be sent.Set
server.maxHeadersCountto 0 so that no limit is applied.
PoC
const http = require('http');
const WebSocket = require('ws');
const server = http.createServer();
const wss = new WebSocket.Server({ server });
server.listen(function () {
const chars = "!#$%&'*+-.0123456789abcdefghijklmnopqrstuvwxyz^_`|~".split('');
const headers = {};
let count = 0;
for (let i = 0; i < chars.length; i++) {
if (count === 2000) break;
for (let j = 0; j < chars.length; j++) {
const key = chars[i] + chars[j];
headers[key] = 'x';
if (++count === 2000) break;
}
}
headers.Connection = 'Upgrade';
headers.Upgrade = 'websocket';
headers['Sec-WebSocket-Key'] = 'dGhlIHNhbXBsZSBub25jZQ==';
headers['Sec-WebSocket-Version'] = '13';
const request = http.request({
headers: headers,
host: '127.0.0.1',
port: server.address().port
});
request.end();
});
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
Two common types of DoS vulnerabilities:
High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm
wspackage
Remediation
Upgrade ws to version 5.2.4, 6.2.3, 7.5.10, 8.17.1 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.9.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to CRLF Injection via the comment field in the list message option. An attacker can inject arbitrary headers into generated email messages by supplying crafted input containing CRLF sequences.
Remediation
Upgrade nodemailer to version 8.0.9 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@9.0.1.
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 message-level raw option bypassing disableFileAccess and disableUrlAccess flags. An attacker can access arbitrary local files or perform server-side request forgery by supplying crafted input to the raw field, which bypasses intended access restrictions and results in sensitive data being sent to an attacker-controlled recipient.
Remediation
Upgrade nodemailer to version 9.0.1 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.5.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to CRLF Injection via the name configuration configuration option. An attacker can inject arbitrary SMTP commands by supplying carriage return and line feed sequences, enabling unauthorized email sending, sender spoofing, and phishing attacks before authentication occurs.
Remediation
Upgrade nodemailer to version 8.0.5 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@7.0.7.
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 due to improper handling of quoted local-parts containing @. An attacker can cause emails to be sent to unintended external recipients or bypass domain-based access controls by crafting specially formatted email addresses with quoted local-parts containing the @ character.
Remediation
Upgrade nodemailer to version 7.0.7 or higher.
References
medium severity
- Vulnerable module: cookie
- Introduced through: socket.io@3.1.2
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › socket.io@3.1.2 › engine.io@4.1.2 › cookie@0.4.2Remediation: Upgrade to socket.io@4.8.0.
Overview
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the cookie name, path, or domain, which can be used to set unexpected values to other cookie fields.
Workaround
Users who are not able to upgrade to the fixed version should avoid passing untrusted or arbitrary values for the cookie fields and ensure they are set by the application instead of user input.
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 < and > can be coded as > 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 cookie to version 0.7.0 or higher.
References
medium severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.10.
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 in the isPartialResponse function and the _onData method of SMTPConnection in src/smtp-connection/index.ts, where each continuation line is appended to the same response queue entry and the partial check re-runs str.slice(str.lastIndexOf('\n') + 1) over the whole accumulated string, forcing a full flatten of the V8 rope on every line. An attacker who controls or impersonates the SMTP peer can starve the event loop of the entire Node.js process, halting every other connection, request, and timer in it, and grow memory without bound, by streaming continuation lines such as 220-flood and never sending a completion line. This is reachable during the greeting and EHLO phases before the client authenticates or issues any command, the connection module applies no cap on accumulated reply size or line count, and the existing timers do not help, since greetingTimeout fires into an already starved loop and the inactivity socketTimeout resets on every inbound chunk.
Remediation
Upgrade nodemailer to version 10.0.10 or higher.
References
medium severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.13.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) in the AUTH mechanism detection of SMTPConnection._actionEHLO in src/smtp-connection/index.ts, where all four patterns contain (?:(\s+|=)[^\n]*\s+|\s+|=) before the mechanism literal, so [^\n]* and the trailing \s+ compete for the same whitespace and the engine tries every partition of the run before failing. An attacker who controls or intercepts the SMTP peer can stall the whole Node.js process, suspending every other request, timer, and connection in it, by answering EHLO with a line such as 250-AUTH followed by a long whitespace run and a token that matches no mechanism. This is reached before authentication on the first EHLO against a server offering no STARTTLS, on the second after a STARTTLS upgrade, or on the first when ignoreTLS is set, and the synchronous stall cannot be interrupted by the socket timeout, with roughly 4,000 whitespace characters already costing tens of seconds per pattern.
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 nodemailer to version 10.0.13 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.8.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Improper Certificate Validation due to the use of rejectUnauthorized: false in the internal HTTPS client, which disables TLS certificate verification during OAuth2 token retrieval. An attacker can intercept sensitive OAuth2 credentials and tokens by performing a machine-in-the-middle attack on the HTTPS connection.
Remediation
Upgrade nodemailer to version 8.0.8 or higher.
References
medium severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.2.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Improper Certificate Validation via the DNS cache in src/shared/index.ts, where the TLS server name (SNI) is stored alongside resolved addresses and keyed only by hostname. When two transports in the same process connect to the same host with different tls.servername values, the second transport inherits the server name cached by the first, sends it as SNI, and verifies the peer certificate against it. This allows an attacker to present a certificate issued for the first transport's server name to the second transport's connection, effectively bypassing certificate validation and enabling a MitM attack that exposes credentials sent to the wrong endpoint.
Remediation
Upgrade nodemailer to version 10.0.2 or higher.
References
medium severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.10.
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 in the parseHeaders method of MessageParser in src/dkim/message-parser.ts, whose unfold loop appends each continuation line onto the preceding one and then re-tests the anchored /^[ \t]/ against the growing merged line, forcing a full flatten of the accumulated rope on every iteration. A user who can influence the size of a header that folds into many continuation lines, most readily a large recipient list but equally a long Subject, References, or custom header, can starve the event loop of the single threaded sending process for seconds on every signed message, halting all other work in it. This requires DKIM signing to be enabled, and nothing bounds the input, since checkHeaders buffers the header block until the terminator and the signer's MAX_MESSAGE_SIZE and cacheTreshold apply to the body stream rather than the headers, while the MIME composer folds the value deterministically at column 76 so the line count scales with the supplied size.
Remediation
Upgrade nodemailer to version 10.0.10 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@9.1.1.
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
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.9.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Missing Authorization in the jsonTransport message, which fails to enforce file and URL access restrictions during message normalization. An attacker can access local files or trigger outbound HTTP requests by supplying crafted message content fields such as attachment path or text.href.
Remediation
Upgrade nodemailer to version 8.0.9 or higher.
References
medium severity
- Module: openpgp
- Introduced through: openpgp@5.0.0-1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › openpgp@5.0.0-1
LGPL-3.0 license
low severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.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 CRLF Injection via the envelope.size parameter in the sendMail function. An attacker can inject arbitrary SMTP commands by supplying CRLF characters in the size property, which are concatenated directly into the SMTP command stream. This can result in unauthorized recipients being added to outgoing emails or other SMTP commands being executed.
Note:
This is only exploitable if the application explicitly passes a custom envelope object with a user-controlled size property to the mail sending process.
PoC
const net = require('net');
const nodemailer = require('nodemailer');
// Minimal SMTP server that logs raw commands
const server = net.createServer(socket => {
socket.write('220 localhost ESMTP\r\n');
let buffer = '';
socket.on('data', chunk => {
buffer += chunk.toString();
const lines = buffer.split('\r\n');
buffer = lines.pop();
for (const line of lines) {
if (!line) continue;
console.log('C:', line);
if (line.startsWith('EHLO')) {
socket.write('250-localhost\r\n250-SIZE 10485760\r\n250 OK\r\n');
} else if (line.startsWith('MAIL FROM')) {
socket.write('250 OK\r\n');
} else if (line.startsWith('RCPT TO')) {
socket.write('250 OK\r\n');
} else if (line === 'DATA') {
socket.write('354 Start\r\n');
} else if (line === '.') {
socket.write('250 OK\r\n');
} else if (line.startsWith('QUIT')) {
socket.write('221 Bye\r\n');
socket.end();
}
}
});
});
server.listen(0, '127.0.0.1', () => {
const port = server.address().port;
console.log('SMTP server on port', port);
console.log('Sending email with injected RCPT TO...\n');
const transporter = nodemailer.createTransport({
host: '127.0.0.1',
port,
secure: false,
tls: { rejectUnauthorized: false },
});
transporter.sendMail({
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Normal email',
text: 'This is a normal email.',
envelope: {
from: 'sender@example.com',
to: ['recipient@example.com'],
size: '100\r\nRCPT TO:<attacker@evil.com>',
},
}, (err) => {
if (err) console.error('Error:', err.message);
console.log('\nExpected output above:');
console.log(' C: MAIL FROM:<sender@example.com> SIZE=100');
console.log(' C: RCPT TO:<attacker@evil.com> <-- INJECTED');
console.log(' C: RCPT TO:<recipient@example.com>');
server.close();
transporter.close();
});
});
Remediation
Upgrade nodemailer to version 8.0.4 or higher.
References
low severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1
Detailed paths
-
Introduced through: kloak_platform@KloakIT/Kloak_platform › nodemailer@6.10.1Remediation: Upgrade to nodemailer@10.0.13.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Improper Adherence to Coding Standards in the checkChar method of the Tokenizer class in src/addressparser/index.ts, where operatorExpecting holds a single expected closing character, so once < opens an address scope a following ( is not recognized as an operator and the RFC 5322 comment survives verbatim in the parsed address. An attacker can have a recipient address approved by an application's own domain allow-list check and then sent differently on the wire by supplying a value such as Legit User <user@good-corp.com(x)evil.com>, since the parentheses reach envelope.to and the RCPT TO command unchanged, where a conformant server rejects the transaction and a server that does strip comments resolves a different domain than the validator read. No recovery path applies, because _recoverAddrSpec returns immediately when the address contains no whitespace and the angle bracket path inserts none, and every field funnelling through MimeNode._parseAddresses, including to, cc, bcc, from, replyTo, and an explicit envelope, is affected identically.
Remediation
Upgrade nodemailer to version 10.0.13 or higher.