Find, fix and prevent vulnerabilities in your code.
critical severity
- Vulnerable module: xmldom
- Introduced through: jsonld@0.4.12, rdflib@0.12.3 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › xmldom@0.1.31
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › xmldom@0.6.0
Overview
xmldom is an A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.
Affected versions of this package are vulnerable to Improper Input Validation due to parsing XML that is not well-formed, and contains multiple top-level elements. All the root nodes are being added to the childNodes collection of the Document, without reporting or throwing any error.
Workarounds
One of the following approaches might help, depending on your use case:
Instead of searching for elements in the whole DOM, only search in the
documentElement.Reject a document with a document that has more than 1
childNode.
PoC
var DOMParser = require('xmldom').DOMParser;
var xmlData = '<?xml version="1.0" encoding="UTF-8"?>\n' +
'<root>\n' +
' <branch girth="large">\n' +
' <leaf color="green" />\n' +
' </branch>\n' +
'</root>\n' +
'<root>\n' +
' <branch girth="twig">\n' +
' <leaf color="gold" />\n' +
' </branch>\n' +
'</root>\n';
var xmlDOM = new DOMParser().parseFromString(xmlData);
console.log(xmlDOM.toString());
This will result with the following output:
<?xml version="1.0" encoding="UTF-8"?><root>
<branch girth="large">
<leaf color="green"/>
</branch>
</root>
<root>
<branch girth="twig">
<leaf color="gold"/>
</branch>
</root>
Remediation
There is no fixed version for xmldom.
References
critical severity
- Vulnerable module: form-data
- Introduced through: request@2.88.2, jsonld@0.4.12 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › request@2.88.2 › form-data@2.3.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › request@2.88.2 › form-data@2.3.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › request@2.88.2 › form-data@2.3.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › request@2.88.2 › form-data@2.3.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › request@2.88.2 › form-data@2.3.3
Overview
Affected versions of this package are vulnerable to Predictable Value Range from Previous Values via the boundary value, which uses Math.random(). An attacker can manipulate HTTP request boundaries by exploiting predictable values, potentially leading to HTTP parameter pollution.
Remediation
Upgrade form-data to version 2.5.4, 3.0.4, 4.0.4 or higher.
References
critical severity
- Vulnerable module: babel-traverse
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-core@6.26.3 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-block-scoping@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-parameters@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-core@6.26.3 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-block-scoping@6.26.0 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-computed-properties@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-commonjs@6.26.2 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-amd@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-systemjs@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-umd@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-parameters@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-register@6.26.0 › babel-core@6.26.3 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-function-name@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-function-name@6.24.1 › babel-helper-function-name@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-replace-supers@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-object-super@6.24.1 › babel-helper-replace-supers@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-parameters@6.24.1 › babel-helper-call-delegate@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-core@6.26.3 › babel-helpers@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-register@6.26.0 › babel-core@6.26.3 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-function-name@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-function-name@6.24.1 › babel-helper-function-name@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-replace-supers@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-object-super@6.24.1 › babel-helper-replace-supers@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-amd@6.24.1 › babel-plugin-transform-es2015-modules-commonjs@6.26.2 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-umd@6.24.1 › babel-plugin-transform-es2015-modules-amd@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-define-map@6.26.0 › babel-helper-function-name@6.24.1 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-register@6.26.0 › babel-core@6.26.3 › babel-helpers@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-classes@6.24.1 › babel-helper-define-map@6.26.0 › babel-helper-function-name@6.24.1 › babel-template@6.26.0 › babel-traverse@6.26.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-preset-es2015@6.24.1 › babel-plugin-transform-es2015-modules-umd@6.24.1 › babel-plugin-transform-es2015-modules-amd@6.24.1 › babel-plugin-transform-es2015-modules-commonjs@6.26.2 › babel-template@6.26.0 › babel-traverse@6.26.0
Overview
Affected versions of this package are vulnerable to Incomplete List of Disallowed Inputs when using plugins that rely on the path.evaluate() or path.evaluateTruthy() internal Babel methods.
Note:
This is only exploitable if the attacker uses known affected plugins such as @babel/plugin-transform-runtime, @babel/preset-env when using its useBuiltIns option, and any "polyfill provider" plugin that depends on @babel/helper-define-polyfill-provider. No other plugins under the @babel/ namespace are impacted, but third-party plugins might be.
Users that only compile trusted code are not impacted.
Workaround
Users who are unable to upgrade the library can upgrade the affected plugins instead, to avoid triggering the vulnerable code path in affected @babel/traverse.
Remediation
There is no fixed version for babel-traverse.
References
critical severity
- Vulnerable module: elliptic
- Introduced through: webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › browserify@17.0.1 › crypto-browserify@3.12.1 › browserify-sign@4.2.5 › elliptic@6.6.1
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › browserify@17.0.1 › crypto-browserify@3.12.1 › create-ecdh@4.0.4 › elliptic@6.6.1
Overview
elliptic is a fast elliptic-curve cryptography implementation in plain javascript.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature due to an anomaly in the _truncateToN function. An attacker can cause legitimate transactions or communications to be incorrectly flagged as invalid by exploiting the signature verification process when the hash contains at least four leading 0 bytes, and the order of the elliptic curve's base point is smaller than the hash.
In some situations, a private key exposure is possible. This can happen when an attacker knows a faulty and the corresponding correct signature for the same message.
Note: Although the vector for exploitation of this vulnerability was restricted with the release of versions 6.6.0 and 6.6.1, it remains possible to generate invalid signatures in some cases in those releases as well.
PoC
var elliptic = require('elliptic'); // tested with version 6.5.7
var hash = require('hash.js');
var BN = require('bn.js');
var toArray = elliptic.utils.toArray;
var ec = new elliptic.ec('p192');
var msg = '343236343739373234';
var sig = '303502186f20676c0d04fc40ea55d5702f798355787363a91e97a7e50219009d1c8c171b2b02e7d791c204c17cea4cf556a2034288885b';
// Same public key just in different formats
var pk = '04cd35a0b18eeb8fcd87ff019780012828745f046e785deba28150de1be6cb4376523006beff30ff09b4049125ced29723';
var pkPem = '-----BEGIN PUBLIC KEY-----\nMEkwEwYHKoZIzj0CAQYIKoZIzj0DAQEDMgAEzTWgsY7rj82H/wGXgAEoKHRfBG54\nXeuigVDeG+bLQ3ZSMAa+/zD/CbQEkSXO0pcj\n-----END PUBLIC KEY-----\n';
// Create hash
var hashArray = hash.sha256().update(toArray(msg, 'hex')).digest();
// Convert array to string (just for showcase of the leading zeros)
var hashStr = Array.from(hashArray, function(byte) {
return ('0' + (byte & 0xFF).toString(16)).slice(-2);
}).join('');
var hMsg = new BN(hashArray, 'hex');
// Hashed message contains 4 leading zeros bytes
console.log('sha256 hash(str): ' + hashStr);
// Due to using BN bitLength lib it does not calculate the bit length correctly (should be 32 since it is a sha256 hash)
console.log('Byte len of sha256 hash: ' + hMsg.byteLength());
console.log('sha256 hash(BN): ' + hMsg.toString(16));
// Due to the shift of the message to be within the order of the curve the delta computation is invalid
var pubKey = ec.keyFromPublic(toArray(pk, 'hex'));
console.log('Valid signature: ' + pubKey.verify(hashStr, sig));
// You can check that this hash should validate by consolidating openssl
const fs = require('fs');
fs.writeFile('msg.bin', new BN(msg, 16).toBuffer(), (err) => {
if (err) throw err;
});
fs.writeFile('sig.bin', new BN(sig, 16).toBuffer(), (err) => {
if (err) throw err;
});
fs.writeFile('cert.pem', pkPem, (err) => {
if (err) throw err;
});
// To verify the correctness of the message signature and key one can run:
// openssl dgst -sha256 -verify cert.pem -signature sig.bin msg.bin
// Or run this python script
/*
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
msg = '343236343739373234'
sig = '303502186f20676c0d04fc40ea55d5702f798355787363a91e97a7e50219009d1c8c171b2b02e7d791c204c17cea4cf556a2034288885b'
pk = '04cd35a0b18eeb8fcd87ff019780012828745f046e785deba28150de1be6cb4376523006beff30ff09b4049125ced29723'
p192 = ec.SECP192R1()
pk = ec.EllipticCurvePublicKey.from_encoded_point(p192, bytes.fromhex(pk))
pk.verify(bytes.fromhex(sig), bytes.fromhex(msg), ec.ECDSA(hashes.SHA256()))
*/
Remediation
There is no fixed version for elliptic.
References
critical severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.2.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Interpretation Conflict via the asn1.validate() function. An attacker can cause schema validation to become desynchronized, resulting in semantic divergence that may allow bypassing cryptographic verifications and security decisions, by passing in ASN.1 data with optional parameters that may be interpreted as object boundaries.
Remediation
Upgrade node-forge to version 1.3.2 or higher.
References
high severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.2.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Uncontrolled Recursion via the fromDer function in asn1.js, which lacks recursion depth. An attacker can cause stack exhaustion and disrupt service availability by submitting specially crafted, deeply nested DER-encoded ASN.1 data.
Remediation
Upgrade node-forge to version 1.3.2 or higher.
References
high severity
new
- Vulnerable module: qs
- Introduced through: request@2.88.2, jsonld@0.4.12 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › request@2.88.2 › qs@6.5.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › request@2.88.2 › qs@6.5.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › request@2.88.2 › qs@6.5.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › request@2.88.2 › qs@6.5.3
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › request@2.88.2 › qs@6.5.3
Overview
qs is a querystring parser that supports nesting and arrays, with a depth limit.
Affected versions of this package are vulnerable to Allocation of Resources Without Limits or Throttling via improper enforcement of the arrayLimit option in bracket notation parsing. An attacker can exhaust server memory and cause application unavailability by submitting a large number of bracket notation parameters - like a[]=1&a[]=2 - in a single HTTP request.
PoC
const qs = require('qs');
const attack = 'a[]=' + Array(10000).fill('x').join('&a[]=');
const result = qs.parse(attack, { arrayLimit: 100 });
console.log(result.a.length); // Output: 10000 (should be max 100)
Remediation
Upgrade qs to version 6.14.1 or higher.
References
high severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2Remediation: Upgrade to nodemailer@6.4.16.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to Command Injection. Use of crafted recipient email addresses may result in arbitrary command flag injection in sendmail transport for sending mails.
PoC
-bi@example.com (-bi Initialize the alias database.)
-d0.1a@example.com (The option -d0.1 prints the version of sendmail and the options it was compiled with.)
-Dfilename@example.com (Debug output ffile)
Remediation
Upgrade nodemailer to version 6.4.16 or higher.
References
high severity
- Vulnerable module: xmldom
- Introduced through: jsonld@0.4.12, rdflib@0.12.3 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › xmldom@0.1.31
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › xmldom@0.6.0
Overview
xmldom is an A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.
Affected versions of this package are vulnerable to Prototype Pollution through the copy() function in dom.js. Exploiting this vulnerability is possible via the p variable.
DISPUTED This vulnerability has been disputed by the maintainers of the package. Currently the only viable exploit that has been demonstrated is to pollute the target object (rather then the global object which is generally the case for Prototype Pollution vulnerabilities) and it is yet unclear if this limited attack vector exposes any vulnerability in the context of this package.
See the linked GitHub Issue for full details on the discussion around the legitimacy and potential revocation of this vulnerability.
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
There is no fixed version for xmldom.
References
high severity
new
- Vulnerable module: nodemailer
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2Remediation: 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
- Vulnerable module: ip
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › socks@1.1.9 › ip@1.1.9
Overview
ip is a Node library.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the ip.isPublic() and ip.isPrivate() functions. An attacker can interact with internal network resources by supplying specially crafted IP address such as octal localhost format ("017700000001") that is incorrectly identified as public.
Note:
This issue exists because of an incomplete fix for CVE-2024-29415.
PoC
Test octal localhost bypass:
node -e "const ip=require('ip'); console.log('017700000001 bypass:', ip.isPublic('017700000001'));" - returns true
Remediation
There is no fixed version for ip.
References
high severity
- Vulnerable module: ip
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › socks@1.1.9 › ip@1.1.9
Overview
ip is a Node library.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the ip.isPublic() and ip.isPrivate() functions. An attacker can interact with internal network resources by supplying specially crafted IP address such as null route ("0") that is being incorrectly identified as public.
Note: This issue exists because of an incomplete fix for CVE-2024-29415.
Exploit is only possible if the application and operating system interpret connection attempts to 0 or 0.0.0.0 as connections to 127.0.0.1.
PoC
Test null route bypass:
node -e "const ip=require('ip'); console.log('0 bypass:', ip.isPublic('0'));" - returns true
Remediation
There is no fixed version for ip.
References
high severity
- Vulnerable module: braces
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › anymatch@1.3.2 › micromatch@2.3.11 › braces@1.8.5
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › braces@2.3.2
Overview
braces is a Bash-like brace expansion, implemented in JavaScript.
Affected versions of this package are vulnerable to Excessive Platform Resource Consumption within a Loop due improper limitation of the number of characters it can handle, through the parse function. An attacker can cause the application to allocate excessive memory and potentially crash by sending imbalanced braces as input.
PoC
const { braces } = require('micromatch');
console.log("Executing payloads...");
const maxRepeats = 10;
for (let repeats = 1; repeats <= maxRepeats; repeats += 1) {
const payload = '{'.repeat(repeats*90000);
console.log(`Testing with ${repeats} repeats...`);
const startTime = Date.now();
braces(payload);
const endTime = Date.now();
const executionTime = endTime - startTime;
console.log(`Regex executed in ${executionTime / 1000}s.\n`);
}
Remediation
Upgrade braces to version 3.0.3 or higher.
References
high severity
- Vulnerable module: dicer
- Introduced through: busboy@0.2.14
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › busboy@0.2.14 › dicer@0.2.5
Overview
Affected versions of this package are vulnerable to Denial of Service (DoS). A malicious attacker can send a modified form to server, and crash the nodejs service. An attacker could sent the payload again and again so that the service continuously crashes.
PoC
await fetch('http://127.0.0.1:8000', { method: 'POST', headers: { ['content-type']: 'multipart/form-data; boundary=----WebKitFormBoundaryoo6vortfDzBsDiro', ['content-length']: '145', connection: 'keep-alive', }, body: '------WebKitFormBoundaryoo6vortfDzBsDiro\r\n Content-Disposition: form-data; name="bildbeschreibung"\r\n\r\n\r\n------WebKitFormBoundaryoo6vortfDzBsDiro--' });
Remediation
There is no fixed version for dicer.
References
high severity
- Vulnerable module: unset-value
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › snapdragon@0.8.2 › base@0.11.2 › cache-base@1.0.1 › unset-value@1.0.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › braces@2.3.2 › snapdragon@0.8.2 › base@0.11.2 › cache-base@1.0.1 › unset-value@1.0.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › extglob@2.0.4 › snapdragon@0.8.2 › base@0.11.2 › cache-base@1.0.1 › unset-value@1.0.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › nanomatch@1.2.13 › snapdragon@0.8.2 › base@0.11.2 › cache-base@1.0.1 › unset-value@1.0.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10 › extglob@2.0.4 › expand-brackets@2.1.4 › snapdragon@0.8.2 › base@0.11.2 › cache-base@1.0.1 › unset-value@1.0.0
Overview
Affected versions of this package are vulnerable to Prototype Pollution via the unset function in index.js, because it allows access to object prototype properties.
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade unset-value to version 2.0.1 or higher.
References
high severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature due to RSA's PKCS#1 v1.5 signature verification code which does not check for tailing garbage bytes after decoding a DigestInfo ASN.1 structure. This can allow padding bytes to be removed and garbage data added to forge a signature when a low public exponent is being used.
Remediation
Upgrade node-forge to version 1.3.0 or higher.
References
high severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@0.10.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Prototype Pollution via the util.setPath function.
Note: version 0.10.0 is a breaking change removing the vulnerable functions.
POC:
const nodeforge = require('node-forge');
var obj = {};
nodeforge.util.setPath(obj, ['__proto__', 'polluted'], true);
console.log(polluted);
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade node-forge to version 0.10.0 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2Remediation: 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: tmp
- Introduced through: inquirer@1.2.3
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › inquirer@1.2.3 › external-editor@1.1.1 › tmp@0.0.29
Overview
Affected versions of this package are vulnerable to Symlink Attack via the dir parameter. An attacker can cause files or directories to be written to arbitrary locations by supplying a crafted symbolic link that resolves outside the intended temporary directory.
PoC
const tmp = require('tmp');
const tmpobj = tmp.fileSync({ 'dir': 'evil-dir'});
console.log('File: ', tmpobj.name);
try {
tmp.fileSync({ 'dir': 'mydir1'});
} catch (err) {
console.log('test 1:', err.message)
}
try {
tmp.fileSync({ 'dir': '/foo'});
} catch (err) {
console.log('test 2:', err.message)
}
try {
const fs = require('node:fs');
const resolved = fs.realpathSync('/tmp/evil-dir');
tmp.fileSync({ 'dir': resolved});
} catch (err) {
console.log('test 3:', err.message)
}
Remediation
Upgrade tmp to version 0.2.4 or higher.
References
medium severity
- Vulnerable module: ip
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › socks@1.1.9 › ip@1.1.9
Overview
ip is a Node library.
Affected versions of this package are vulnerable to Server-Side Request Forgery (SSRF) via the isPublic function, which identifies some private IP addresses as public addresses due to improper parsing of the input.
An attacker can manipulate a system that uses isLoopback(), isPrivate() and isPublic functions to guard outgoing network requests to treat certain IP addresses as globally routable by supplying specially crafted IP addresses.
Note
This vulnerability derived from an incomplete fix for CVE-2023-42282
Remediation
There is no fixed version for ip.
References
medium severity
- Vulnerable module: request
- Introduced through: request@2.88.2, jsonld@0.4.12 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › request@2.88.2
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › request@2.88.2
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › request@2.88.2
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › request@2.88.2
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › request@2.88.2
Overview
request is a simplified http request client.
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) due to insufficient checks in the lib/redirect.js file by allowing insecure redirects in the default configuration, via an attacker-controller server that does a cross-protocol redirect (HTTP to HTTPS, or HTTPS to HTTP).
NOTE: request package has been deprecated, so a fix is not expected. See https://github.com/request/request/issues/3142.
Remediation
A fix was pushed into the master branch but not yet published.
References
medium severity
- Vulnerable module: tough-cookie
- Introduced through: request@2.88.2, jsonld@0.4.12 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › request@2.88.2 › tough-cookie@2.5.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › request@2.88.2 › tough-cookie@2.5.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › request@2.88.2 › tough-cookie@2.5.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › request@2.88.2 › tough-cookie@2.5.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › request@2.88.2 › tough-cookie@2.5.0
Overview
tough-cookie is a RFC6265 Cookies and CookieJar module for Node.js.
Affected versions of this package are vulnerable to Prototype Pollution due to improper handling of Cookies when using CookieJar in rejectPublicSuffixes=false mode. Due to an issue with the manner in which the objects are initialized, an attacker can expose or modify a limited amount of property information on those objects. There is no impact to availability.
PoC
// PoC.js
async function main(){
var tough = require("tough-cookie");
var cookiejar = new tough.CookieJar(undefined,{rejectPublicSuffixes:false});
// Exploit cookie
await cookiejar.setCookie(
"Slonser=polluted; Domain=__proto__; Path=/notauth",
"https://__proto__/admin"
);
// normal cookie
var cookie = await cookiejar.setCookie(
"Auth=Lol; Domain=google.com; Path=/notauth",
"https://google.com/"
);
//Exploit cookie
var a = {};
console.log(a["/notauth"]["Slonser"])
}
main();
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade tough-cookie to version 4.1.3 or higher.
References
medium severity
- Vulnerable module: xmldom
- Introduced through: jsonld@0.4.12, rdflib@0.12.3 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › xmldom@0.1.31
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › xmldom@0.6.0
Overview
xmldom is an A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.
Affected versions of this package are vulnerable to Improper Input Validation. It does not correctly escape special characters when serializing elements are removed from their ancestor. This may lead to unexpected syntactic changes during XML processing in some downstream applications.
Note: Customers who use "xmldom" package, should use "@xmldom/xmldom" instead, as "xmldom" is no longer maintained.
Remediation
There is no fixed version for xmldom.
References
medium severity
- Vulnerable module: json5
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-core@6.26.3 › json5@0.5.1
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › babel-register@6.26.0 › babel-core@6.26.3 › json5@0.5.1
Overview
Affected versions of this package are vulnerable to Prototype Pollution via the parse method , which does not restrict parsing of keys named __proto__, allowing specially crafted strings to pollute the prototype of the resulting object. This pollutes the prototype of the object returned by JSON5.parse and not the global Object prototype (which is the commonly understood definition of Prototype Pollution). Therefore, the actual impact will depend on how applications utilize the returned object and how they filter unwanted keys.
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade json5 to version 1.0.2, 2.2.2 or higher.
References
medium severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.2.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Integer Overflow or Wraparound via the derToOid function in the asn1.js file, which decodes ASN.1 structures containing OIDs with oversized arcs. An attacker can bypass security decisions based on OID validation by crafting malicious ASN.1 data that exploits 32-bit bitwise truncation.
Remediation
Upgrade node-forge to version 1.3.2 or higher.
References
medium severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.0.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Prototype Pollution via the forge.debug API if called with untrusted input.
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, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
Remediation
Upgrade node-forge to version 1.0.0 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2Remediation: Upgrade to nodemailer@6.6.1.
Overview
nodemailer is an Easy as cake e-mail sending from your Node.js applications
Affected versions of this package are vulnerable to HTTP Header Injection if unsanitized user input that may contain newlines and carriage returns is passed into an address object.
PoC:
const userEmail = 'foo@bar.comrnSubject: foobar'; // imagine this comes from e.g. HTTP request params or is otherwise user-controllable
await transporter.sendMail({
from: '...',
to: '...',
replyTo: {
name: 'Customer',
address: userEmail,
},
subject: 'My Subject',
text: message,
});
Remediation
Upgrade nodemailer to version 6.6.1 or higher.
References
medium severity
- Vulnerable module: inflight
- Introduced through: glob@7.2.3, rimraf@2.7.1 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › fs-extra@0.30.0 › rimraf@2.7.1 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › glob@7.2.3 › inflight@1.0.6
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › browserify@17.0.1 › glob@7.2.3 › 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: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature due to RSA's PKCS#1 v1.5 signature verification code which does not properly check DigestInfo for a proper ASN.1 structure. This can lead to successful verification with signatures that contain invalid structures but a valid digest.
Remediation
Upgrade node-forge to version 1.3.0 or higher.
References
medium severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.3.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Improper Verification of Cryptographic Signature due to RSAs PKCS#1` v1.5 signature verification code which is lenient in checking the digest algorithm structure. This can allow a crafted structure that steals padding bytes and uses unchecked portion of the PKCS#1 encoded message to forge a signature when a low public exponent is being used.
Remediation
Upgrade node-forge to version 1.3.0 or higher.
References
medium severity
- Vulnerable module: underscore
- Introduced through: nodemailer@2.7.2 and nomnom@1.8.1
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › nodemailer-direct-transport@3.3.2 › smtp-connection@2.12.0 › httpntlm@1.6.1 › underscore@1.7.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › nodemailer-smtp-pool@2.8.2 › smtp-connection@2.12.0 › httpntlm@1.6.1 › underscore@1.7.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2 › nodemailer-smtp-transport@2.7.2 › smtp-connection@2.12.0 › httpntlm@1.6.1 › underscore@1.7.0
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nomnom@1.8.1 › underscore@1.6.0
Overview
underscore is a JavaScript's functional programming helper library.
Affected versions of this package are vulnerable to Arbitrary Code Injection via the template function, particularly when the variable option is taken from _.templateSettings as it is not sanitized.
PoC
const _ = require('underscore');
_.templateSettings.variable = "a = this.process.mainModule.require('child_process').execSync('touch HELLO')";
const t = _.template("")();
Remediation
Upgrade underscore to version 1.13.0-2, 1.12.1 or higher.
References
medium severity
- Vulnerable module: xmldom
- Introduced through: jsonld@0.4.12, rdflib@0.12.3 and others
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › jsonld@0.4.12 › xmldom@0.1.19Remediation: Upgrade to jsonld@4.0.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › rdflib@0.2.11 › jsonld@0.4.12 › xmldom@0.1.19
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › rdflib@0.12.3 › xmldom@0.1.31Remediation: Upgrade to rdflib@2.2.1.
Overview
xmldom is an A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.
Affected versions of this package are vulnerable to XML External Entity (XXE) Injection. Does not correctly preserve system identifiers, FPIs or namespaces when repeatedly parsing and serializing maliciously crafted documents.
Details
XXE Injection is a type of attack against an application that parses XML input. XML is a markup language that defines a set of rules for encoding documents in a format that is both human-readable and machine-readable. By default, many XML processors allow specification of an external entity, a URI that is dereferenced and evaluated during XML processing. When an XML document is being parsed, the parser can make a request and include the content at the specified URI inside of the XML document.
Attacks can include disclosing local files, which may contain sensitive data such as passwords or private user data, using file: schemes or relative paths in the system identifier.
For example, below is a sample XML document, containing an XML element- username.
<xml>
<?xml version="1.0" encoding="ISO-8859-1"?>
<username>John</username>
</xml>
An external XML entity - xxe, is defined using a system identifier and present within a DOCTYPE header. These entities can access local or remote content. For example the below code contains an external XML entity that would fetch the content of /etc/passwd and display it to the user rendered by username.
<xml>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE foo [
<!ENTITY xxe SYSTEM "file:///etc/passwd" >]>
<username>&xxe;</username>
</xml>
Other XXE Injection attacks can access local resources that may not stop returning data, possibly impacting application availability and leading to Denial of Service.
Remediation
Upgrade xmldom to version 0.5.0 or higher.
References
medium severity
- Vulnerable module: micromatch
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › anymatch@1.3.2 › micromatch@2.3.11
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › readdirp@2.2.1 › micromatch@3.1.10
Overview
Affected versions of this package are vulnerable to Inefficient Regular Expression Complexity due to the use of unsafe pattern configurations that allow greedy matching through the micromatch.braces() function. An attacker can cause the application to hang or slow down by passing a malicious payload that triggers extensive backtracking in regular expression processing.
Remediation
Upgrade micromatch to version 4.0.8 or higher.
References
medium severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49 and webid@0.3.11
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@1.0.0.
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › webid@0.3.11 › node-forge@0.7.6
Overview
node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.
Affected versions of this package are vulnerable to Open Redirect via parseUrl function when it mishandles certain uses of backslash such as https:/\/\/\ and interprets the URI as a relative path.
PoC:
// poc.js
var forge = require("node-forge");
var url = forge.util.parseUrl("https:/\/\/\www.github.com/foo/bar");
console.log(url);
// Output of node poc.js:
{
full: 'https://',
scheme: 'https',
host: '',
port: 443,
path: '/www.github.com/foo/bar', <<<---- path should be "/foo/bar"
fullHost: ''
}
Remediation
Upgrade node-forge to version 1.0.0 or higher.
References
medium severity
- Vulnerable module: node-forge
- Introduced through: node-forge@0.6.49
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › node-forge@0.6.49Remediation: Upgrade to node-forge@0.7.4.
Overview
node-forge is a native implementation of TLS (and various other cryptographic tools) in JavaScript.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) attacks. This can cause an impact of about 10 seconds matching time for data 3K characters long.
Disclosure Timeline
- Feb 15th, 2018 - Initial Disclosure to package owner
- Feb 15th, 2018 - Initial Response by package owner
- Feb 15th, 2018 - GitHub issue opened
- Feb 26th, 2018 - Vulnerability published
- Mar 7thth, 2018 - Vulnerability fixed
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
Update node-forge to version 0.7.4 or higher.
References
medium severity
- Vulnerable module: nodemailer
- Introduced through: nodemailer@2.7.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › nodemailer@2.7.2Remediation: Upgrade to nodemailer@6.9.9.
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) via the attachDataUrls parameter or when parsing attachments with an embedded file. An attacker can exploit this vulnerability by sending a specially crafted email that triggers inefficient regular expression evaluation, leading to excessive consumption of CPU resources.
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 6.9.9 or higher.
References
medium severity
- Vulnerable module: string
- Introduced through: string@3.3.3
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › string@3.3.3
Overview
string is a JavaScript library for extra String methods.
Affected versions of this package are vulnerable to Regular expression Denial of Service (ReDoS). It uses regex in the underscore and unescapeHTML methods, which can cause a slowdown of 2 seconds 50k characters.
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
Let’s take the following regular expression as an example:
regex = /A(B|C+)+D/
This regular expression accomplishes the following:
AThe string must start with the letter 'A'(B|C+)+The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the+matches one or more times). The+at the end of this section states that we can look for one or more matches of this section.DFinally, we ensure this section of the string ends with a 'D'
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
It most cases, it doesn't take very long for a regex engine to find a match:
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
0.04s user 0.01s system 95% cpu 0.052 total
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
1.79s user 0.02s system 99% cpu 1.812 total
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
- CCC
- CC+C
- C+CC
- C+C+C.
The engine has to try each of those combinations to see if any of them potentially match against the expression. When you combine that with the other steps the engine must take, we can use RegEx 101 debugger to see the engine has to take a total of 38 steps before it can determine the string doesn't match.
From there, the number of steps the engine must use to validate a string just continues to grow.
| String | Number of C's | Number of steps |
|---|---|---|
| ACCCX | 3 | 38 |
| ACCCCX | 4 | 71 |
| ACCCCCX | 5 | 136 |
| ACCCCCCCCCCCCCCX | 14 | 65,553 |
By the time the string includes 14 C's, the engine has to take over 65,000 steps just to see if the string is valid. These extreme situations can cause them to work very slowly (exponentially related to input size, as shown above), allowing an attacker to exploit this and can cause the service to excessively consume CPU, resulting in a Denial of Service.
Remediation
There is no fix version for string.
References
medium severity
- Vulnerable module: ws
- Introduced through: solid-ws@0.2.3
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-ws@0.2.3 › ws@1.1.5Remediation: Upgrade to solid-ws@0.3.1.
Overview
ws is a simple to use websocket client, server and console for node.js.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). A specially crafted value of the Sec-Websocket-Protocol header can be used to significantly slow down a ws server.
##PoC
for (const length of [1000, 2000, 4000, 8000, 16000, 32000]) {
const value = 'b' + ' '.repeat(length) + 'x';
const start = process.hrtime.bigint();
value.trim().split(/ *, */);
const end = process.hrtime.bigint();
console.log('length = %d, time = %f ns', length, end - start);
}
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 ws to version 7.4.6, 6.2.2, 5.2.3 or higher.
References
low severity
- Vulnerable module: braces
- Introduced through: solid-permissions@0.4.2
Detailed paths
-
Introduced through: solid-server@ah7/node-solid-server#4db0f646155a7ee565c12942ee45d97221365319 › solid-permissions@0.4.2 › babel-cli@6.26.0 › chokidar@1.7.0 › anymatch@1.3.2 › micromatch@2.3.11 › braces@1.8.5
Overview
braces is a Bash-like brace expansion, implemented in JavaScript.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). It used a regular expression (^\{(,+(?:(\{,+\})*),*|,*(?:(\{,+\})*),+)\}) in order to detects empty braces. This can cause an impact of about 10 seconds matching time for data 50K characters long.
Disclosure Timeline
- Feb 15th, 2018 - Initial Disclosure to package owner
- Feb 16th, 2018 - Initial Response from package owner
- Feb 18th, 2018 - Fix issued
- Feb 19th, 2018 - Vulnerability published
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 braces to version 2.3.1 or higher.