+
+
Server-side Request Forgery (SSRF)
+
+
+
+ critical severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
parse-url is an An advanced url parser supporting git urls too.
+
Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) in the parseUrl function, due to mishandling hostnames when processing usernames and passwords.
+
PoC:
+
const parseUrl = require("parse-url");
+ const express = require('express');
+ const http = require('http');
+ const app = express();
+
+ const isLocal = () => (req, res, next) => (req.connection.remoteAddress === '::ffff:127.0.0.1'|| req.connection.remoteAddress === '::1' ? true:false)
+ ? next()
+ : res.json({'state':'You\'re not locally'});
+
+ parsed = parseUrl("http://google:com:@@127.0.0.1:9999/ssrf_check");
+ console.log(parsed);
+
+ app.get('/', (req, res) => {
+ if(parsed.resource == '127.0.0.1'){
+ res.send('Not good');
+ } else{
+ http.get(parsed.href)
+ res.send('Good');
+ }
+ });
+
+ app.get('/ssrf_check', isLocal(), (req, res) =>{
+ console.log('ssrf bypass');
+ res.send(true);
+ });
+
+ app.listen(9999);
+
+
+
Upgrade parse-url to version 6.0.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Improper Input Validation
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
+
Affected versions of this package are vulnerable to Improper Input Validation due to improper fix of CVE-2020-8124 , it is possible to be exploited via the \b (backspace) character.
+
PoC:
+
const parse = require('./index.js')
+
+ url = parse('\bhttp://google.com')
+
+ console.log(url)
+
+
Output:
+
{
+ slashes: false,
+ protocol: '',
+ hash: '',
+ query: '',
+ pathname: '\bhttp://google.com',
+ auth: '',
+ host: '',
+ port: '',
+ hostname: '',
+ password: '',
+ username: '',
+ origin: 'null',
+ href: '\bhttp://google.com'
+ }
+
+
+
Upgrade url-parse to version 1.5.9 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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 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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade unset-value to version 2.0.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Authorization Bypass Through User-Controlled Key
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
parse-path is a Parse paths (local paths, urls: ssh/git/etc)
+
Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key which is unable to detect the right resource.
+
+
Upgrade parse-path to version 5.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
NULL Pointer Dereference
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to NULL Pointer Dereference in the function Sass::Functions::selector_append which could be leveraged by an attacker to cause a denial of service (application crash) or possibly have unspecified other impact. node-sass is affected by this vulnerability due to its bundled usage of libsass.
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Use After Free
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Use After Free via the SharedPtr class in SharedPtr.cpp (or SharedPtr.hpp) that may cause a denial of service (application crash) or possibly have unspecified other impact. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Improper Verification of Cryptographic Signature
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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.
+
+
Upgrade node-forge to version 1.3.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
moment is a lightweight JavaScript date library for parsing, validating, manipulating, and formatting dates.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the preprocessRFC2822() function in from-string.js, when processing a very long crafted string (over 10k characters).
+
PoC:
+
moment("(".repeat(500000))
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade moment to version 2.29.4 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Prototype Pollution via the validate function, which when given a special payload will pollute Object with undesired attributes.
+
Details
+
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
+
There are two main ways in which the pollution of prototypes occurs:
+
+
Unsafe Object recursive merge
+
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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade json-schema to version 0.4.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Denial of Service (DoS)
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
gopkg.in/yaml.v3 is a YAML support package for the Go language.
+
Affected versions of this package are vulnerable to Denial of Service (DoS) via the Unmarshal function, which causes the program to crash when attempting to deserialize invalid input.
+
PoC
+
package main
+
+ import (
+ "gopkg.in/yaml.v3"
+ )
+
+ func main() {
+ var t interface{}
+ yaml.Unmarshal([]byte("0: [:!00 \xef"), &t)
+ }
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
+
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
+
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
+
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
+
Two common types of DoS vulnerabilities:
+
+ High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
+
+ Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package
+
+
+
+
Upgrade gopkg.in/yaml.v3 to version 3.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Prototype Pollution via the mapValues() method, due to improper check in createObjectIterator function.
+
PoC
+
//when objects are parsed, all properties are created as own (the objects can come from outside sources (http requests/ file))
+ const hasOwn = JSON.parse('{"__proto__": {"isAdmin": true}}');
+
+ //does not have the property, because it's inside object's own "__proto__"
+ console.log(hasOwn.isAdmin);
+
+ async.mapValues(hasOwn, (val, key, cb) => cb(null, val), (error, result) => {
+ // after the method executes, hasOwn.__proto__ value (isAdmin: true) replaces the prototype of the newly created object, leading to potential exploits.
+ console.log(result.isAdmin);
+ });
+
+
Details
+
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
+
There are two main ways in which the pollution of prototypes occurs:
+
+
Unsafe Object recursive merge
+
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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade async to version 2.6.4, 3.2.2 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
ansi-html is an An elegant lib that converts the chalked (ANSI) text to HTML.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). If an attacker provides a malicious string, it will get stuck processing the input for an extremely long time.
+
PoC
+
require('ansi-html')('x1b[0mx1b[' + '0'.repeat(35))
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade ansi-html to version 0.0.9 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ high severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
ajv is an Another JSON Schema Validator
+
Affected versions of this package are vulnerable to Prototype Pollution. A carefully crafted JSON schema could be provided that allows execution of other code by prototype pollution. (While untrusted schemas are recommended against, the worst case of an untrusted schema should be a denial of service, not execution of code.)
+
Details
+
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
+
There are two main ways in which the pollution of prototypes occurs:
+
+
Unsafe Object recursive merge
+
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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade ajv to version 6.12.3 or higher.
+
References
+
+
+
+
+
+
+
+
+
Access Restriction Bypass
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
+
Affected versions of this package are vulnerable to Access Restriction Bypass due to improper parsing process, that may lead to incorrect handling of authentication credentials and hostname, which allows bypass of hostname validation.
+
PoC:
+
// PoC.js
+ var parse = require('url-parse')
+ var cc=parse("http://admin:password123@@127.0.0.1")
+
+ //Output:
+ { slashes: true,
+ protocol: 'http:',
+ hash: '',
+ query: '',
+ pathname: '/',
+ auth: 'admin:password123',
+ host: '@127.0.0.1',
+ port: '',
+ hostname: '@127.0.0.1',
+ password: 'password123',
+ username: 'admin',
+ origin: 'http://@127.0.0.1',
+ href: 'http://admin:password123@@127.0.0.1/' }
+
+
+
Upgrade url-parse to version 1.5.6 or higher.
+
References
+
+
+
+
+
+
+
+
+
Authorization Bypass
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
+
Affected versions of this package are vulnerable to Authorization Bypass via the hostname field of a parsed URL, because "url-parse" is unable to find the correct hostname when no port number is provided in the URL.
+
PoC:
+
var Url = require('url-parse');
+ var PAYLOAD = "http://example.com:";
+
+ console.log(Url(PAYLOAD));
+
+ // Expected hostname: example.com
+ // Actual hostname by url-parse: example.com:
+
+
Output:
+
{
+ slashes: true,
+ protocol: 'http:',
+ hash: '',
+ query: '',
+ pathname: '/',
+ auth: '',
+ host: 'example.com:',
+ port: '',
+ hostname: 'example.com:',
+ password: '',
+ username: '',
+ origin: 'http://example.com:',
+ href: 'http://example.com:/'
+ }
+
+
+
Upgrade url-parse to version 1.5.8 or higher.
+
References
+
+
+
+
+
+
+
+
+
Authorization Bypass Through User-Controlled Key
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
url-parse is a Small footprint URL parser that works seamlessly across Node.js and browser environments.
+
Affected versions of this package are vulnerable to Authorization Bypass Through User-Controlled Key due to incorrect conversion of @ in the protocol field of the HREF.
+
PoC:
+
parse = require('url-parse')
+
+ console.log(parse("http:@/127.0.0.1"))
+
+
Output:
+
{
+ slashes: true,
+ protocol: 'http:',
+ hash: '',
+ query: '',
+ pathname: '/127.0.0.1',
+ auth: '',
+ host: '',
+ port: '',
+ hostname: '',
+ password: '',
+ username: '',
+ origin: 'null',
+ href: 'http:///127.0.0.1'
+ }
+
+
+
Upgrade url-parse to version 1.5.7 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
uglify-js is a JavaScript parser, minifier, compressor and beautifier toolkit.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the string_template and the decode_template functions.
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade uglify-js to version 3.14.3 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to insecure usage of regular expressions.
+
PoC:
+
echo 'console.log(/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX"))' | npx terser -mc unsafe=true
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade terser to version 4.8.1, 5.14.2 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the loadAnnotation() function, due to the usage of insecure regex.
+
PoC
+
var scss = require("scss-tokenizer")
+ function build_attack(n) {
+ var ret = "a{}"
+ for (var i = 0; i < n; i++) {
+ ret += "/*# sourceMappingURL="
+ }
+ return ret + "!";
+ }
+
+ // postcss.parse('a{}/*# sourceMappingURL=a.css.map */')
+ for(var i = 1; i <= 500000; i++) {
+ if (i % 1000 == 0) {
+ var time = Date.now();
+ var attack_str = build_attack(i)
+ try{
+ scss.tokenize(attack_str)
+ var time_cost = Date.now() - time;
+ console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms");
+ }
+ catch(e){
+ var time_cost = Date.now() - time;
+ console.log("attack_str.length: " + attack_str.length + ": " + time_cost+" ms");
+ }
+ }
+ }
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
There is no fixed version for scss-tokenizer.
+
References
+
+
+
+
+
+
+
+
+
Cross-site Scripting (XSS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
prismjs is a lightweight, robust, elegant syntax highlighting library.
+
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) via the command line plugin which does not properly escape its output, leading to the input text being inserted into the DOM as HTML code.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
Upgrade prismjs to version 1.27.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Cross-site Scripting (XSS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
parse-url is an An advanced url parser supporting git urls too.
+
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to improper sanitization of special characters for ASCII that start with \x and also for all Unicodes start with \u.
+
PoC:
+
const http = require("http");
+ const parseUrl = require("parse-url");
+ const url = parseUrl('jav\u000Dascript://%0aalert(1)');
+ console.log(url)
+ const server = http.createServer((request, response) => {
+ response.writeHead(200);
+ if (url.scheme !== "javascript" && url.scheme !== null) {
+ response.end("<a href=\'" + url.href + "\'>Wowww!</a>" );
+ }
+ else{
+ response.end("Nooo!");
+ }
+ });
+ server.listen(80, "127.0.0.1",function(){
+ console.log("http://"+this.address().address+":"+this.address().port);
+ });
+
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
Upgrade parse-url to version 6.0.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Information Exposure
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
parse-url is an An advanced url parser supporting git urls too.
+
Affected versions of this package are vulnerable to Information Exposure due to improper validation.
+
+
Upgrade parse-url to version 6.0.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Cross-site Scripting (XSS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
parse-url is an An advanced url parser supporting git urls too.
+
Affected versions of this package are vulnerable to Cross-site Scripting (XSS) due to improper sanitization of special ASCII characters that start with \r\r or \r.
+ This vulnerability exists due to an incomplete fix for CVE-2022-2217.
+
PoC:
+
const http = require("http");
+ const parseUrl = require("parse-url");
+ const url = parseUrl('jav\r\r\rascript://%0aalert(1)');
+ console.log(url)
+ const server = http.createServer((request, response) => {
+ response.writeHead(200);
+ if (url.scheme !== "javascript" && url.scheme !== null) {
+ response.end("<a href=\'" + url.href + "\'>Wowww!</a>" );
+ }
+ else{
+ response.end("Nooo!");
+ }
+ });
+ server.listen(80, "127.0.0.1",function(){
+ console.log("http://"+this.address().address+":"+this.address().port);
+ });
+
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
Upgrade parse-url to version 6.0.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Improper Certificate Validation
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Improper Certificate Validation. Certificate validation is disabled by default when requesting binaries, even if the user is not specifying an alternative download path.
+
+
Upgrade node-sass to version 7.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Out-of-Bounds
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Out-of-Bounds. A heap-based buffer over-read exists in Sass::Prelexer::parenthese_scope in prelexer.hpp. node-sass is affected by this vulnerability due to its bundled usage of libsass.
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Out-of-bounds Read
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Out-of-bounds Read via Sass::weaveParents in ast_sel_weave.cpp. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Uncontrolled Recursion
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Uncontrolled Recursion via Sass::Eval::operator()(Sass::Binary_Expression*) in eval.cpp. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Denial of Service (DoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Denial of Service (DoS). Uncontrolled recursion is possible in Sass::Complex_Selector::perform in ast.hpp and Sass::Inspect::operator in inspect.cpp. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
NULL Pointer Dereference
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to NULL Pointer Dereference via Sass::Parser::parseCompoundSelectorin parser_selectors.cpp. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Out-of-Bounds
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Out-of-Bounds via Sass::Prelexer::alternatives in prelexer.hpp. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Out-of-bounds Read
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-sass is a Node.js bindings package for libsass.
+
Affected versions of this package are vulnerable to Out-of-bounds Read. The function handle_error in sass_context.cpp allows attackers to cause a denial-of-service resulting from a heap-based buffer over-read via a crafted sass file. Note: node-sass is affected by this vulnerability due to its bundled usage of the libsass package.
+
Details
+
A cross-site scripting attack occurs when the attacker tricks a legitimate web-based application or site to accept a request as originating from a trusted source.
+
This is done by escaping the context of the web application; the web application then delivers that data to its users along with other trusted dynamic content, without validating it. The browser unknowingly executes malicious script on the client side (through client-side languages; usually JavaScript or HTML) in order to perform actions that are otherwise typically blocked by the browser’s Same Origin Policy.
+
Injecting malicious code is the most prevalent manner by which XSS is exploited; for this reason, escaping characters in order to prevent this manipulation is the top method for securing code against this vulnerability.
+
Escaping means that the application is coded to mark key characters, and particularly key characters included in user input, to prevent those characters from being interpreted in a dangerous context. For example, in HTML, < can be coded as < and > can be coded as > in order to be interpreted and displayed as themselves in text, while within the code itself, they are used for HTML tags. If malicious content is injected into an application that escapes special characters and that malicious content uses < and > as HTML tags, those characters are nonetheless not interpreted as HTML tags by the browser if they’ve been correctly escaped in the application code and in this way the attempted attack is diverted.
+
The most prominent use of XSS is to steal cookies (source: OWASP HttpOnly) and hijack user sessions, but XSS exploits have been used to expose sensitive information, enable access to privileged services and functionality and deliver malware.
+
Types of attacks
+
There are a few methods by which XSS can be manipulated:
+
+
+
+ | Type |
+ Origin |
+ Description |
+
+
+
+ | Stored |
+ Server |
+ The malicious code is inserted in the application (usually as a link) by the attacker. The code is activated every time a user clicks the link. |
+
+
+ | Reflected |
+ Server |
+ The attacker delivers a malicious link externally from the vulnerable web site application to a user. When clicked, malicious code is sent to the vulnerable web site, which reflects the attack back to the user’s browser. |
+
+
+ | DOM-based |
+ Client |
+ The attacker forces the user’s browser to render a malicious page. The data in the page itself delivers the cross-site scripting data. |
+
+
+ | Mutated |
+ |
+ The attacker injects code that appears safe, but is then rewritten and modified by the browser, while parsing the markup. An example is rebalancing unclosed quotation marks or even adding quotation marks to unquoted parameters. |
+
+
+
Affected environments
+
The following environments are susceptible to an XSS attack:
+
+ - Web servers
+ - Application servers
+ - Web application environments
+
+
How to prevent
+
This section describes the top best practices designed to specifically protect your code:
+
+ - Sanitize data input in an HTTP request before reflecting it back, ensuring all data is validated, filtered or escaped before echoing anything back to the user, such as the values of query parameters during searches.
+ - Convert special characters such as
?, &, /, <, > and spaces to their respective HTML or URL encoded equivalents.
+ - Give users the option to disable client-side scripts.
+ - Redirect invalid requests.
+ - Detect simultaneous logins, including those from two separate IP addresses, and invalidate those sessions.
+ - Use and enforce a Content Security Policy (source: Wikipedia) to disable any features that might be manipulated for an XSS attack.
+ - Read the documentation for any of the libraries referenced in your code to understand which elements allow for embedded HTML.
+
+
+
There is no fixed version for node-sass.
+
References
+
+
+
+
+
+
+
+
+
Open Redirect
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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: ''
+ }
+
+
+
Upgrade node-forge to version 1.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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 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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade node-forge to version 1.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Improper Verification of Cryptographic Signature
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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.
+
+
Upgrade node-forge to version 1.3.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Improper Verification of Cryptographic Signature
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
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.
+
+
Upgrade node-forge to version 1.3.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Information Exposure
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-fetch is a light-weight module that brings window.fetch to node.js
+
Affected versions of this package are vulnerable to Information Exposure when fetching a remote url with Cookie, if it get a Location response header, it will follow that url and try to fetch that url with provided cookie. This can lead to forwarding secure headers to 3th party.
+
+
Upgrade node-fetch to version 2.6.7, 3.1.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Denial of Service
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
node-fetch is a light-weight module that brings window.fetch to node.js
+
Affected versions of this package are vulnerable to Denial of Service. Node Fetch did not honor the size option after following a redirect, which means that when a content size was over the limit, a FetchError would never get thrown and the process would end without failure.
+
+
Upgrade node-fetch to version 2.6.1, 3.0.0-beta.9 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
marked is a low-level compiler for parsing markdown without caching or blocking for long periods of time.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when passing unsanitized user input to inline.reflinkSearch, if it is not being parsed by a time-limited worker thread.
+
PoC
+
import * as marked from 'marked';
+
+ console.log(marked.parse(`[x]: x
+
+ \\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](\\[\\](`));
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade marked to version 4.0.10 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
marked is a low-level compiler for parsing markdown without caching or blocking for long periods of time.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) when unsanitized user input is passed to block.def.
+
PoC
+
import * as marked from "marked";
+ marked.parse(`[x]:${' '.repeat(1500)}x ${' '.repeat(1500)} x`);
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade marked to version 4.0.10 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
marked is a low-level compiler for parsing markdown without caching or blocking for long periods of time.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The em regex within src/rules.js file have multiple unused capture groups which could lead to a denial of service attack if user input is reachable.
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade marked to version 1.1.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
jsonpointer is a Simple JSON Addressing.
+
Affected versions of this package are vulnerable to Prototype Pollution. A type confusion vulnerability can lead to a bypass of a previous Prototype Pollution fix when the pointer components are arrays.
+
PoC
+
const jsonpointer = require('jsonpointer');
+
+ // jsonpointer.set({}, ['__proto__', '__proto__', 'polluted'], 'yes');
+ // console.log(polluted); // ReferenceError: polluted is not defined
+
+ jsonpointer.set({}, [['__proto__'], ['__proto__'], 'polluted'], 'yes');
+ console.log(polluted); // yes
+
+
Details
+
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
+
There are two main ways in which the pollution of prototypes occurs:
+
+
Unsafe Object recursive merge
+
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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade jsonpointer to version 5.0.0 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
json-pointer is a set of utilities for JSON pointers described by RFC 6901
+
Affected versions of this package are vulnerable to Prototype Pollution. A type confusion vulnerability can lead to a bypass of CVE-2020-7709 when the pointer components are arrays.
+
PoC
+
const pointer = require('json-pointer');
+
+ // pointer.set({}, ['__proto__', 'polluted'], 'yes')
+ // console.log(polluted) // ReferenceError: polluted is not defined
+
+ pointer.set({}, [['__proto__'], 'polluted'], 'yes')
+ 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 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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
A fix was pushed into the master branch but not yet published.
+
References
+
+
+
+
+
+
+
+
+
Out-of-bounds Read
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Out-of-bounds Read due to improper index calculation, an incorrectly formatted language tag can cause Parse to panic. If Parse is used to process untrusted user inputs, this may be used as a vector for a denial of service attack.
+
+
Upgrade golang.org/x/text/internal/language to version 0.3.7 or higher.
+
References
+
+
+
+
+
+
+
+
+
Improper Input Validation
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
go.mongodb.org/mongo-driver/bson/bsonrw is a The MongoDB supported driver for Go.
+
Affected versions of this package are vulnerable to Improper Input Validation. Specific cstrings input may not be properly validated in the MongoDB Go Driver when marshalling Go objects into BSON. A malicious user could use a Go object with specific string to potentially inject additional fields into marshalled documents.
+
+
Upgrade go.mongodb.org/mongo-driver/bson/bsonrw to version 1.5.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Regular Expression Denial of Service (ReDoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
glob-parent is a package that helps extracting the non-magic parent path from a glob string.
+
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). The enclosure regex used to check for strings ending in enclosure containing path separator.
+
PoC by Yeting Li
+
var globParent = require("glob-parent")
+ function build_attack(n) {
+ var ret = "{"
+ for (var i = 0; i < n; i++) {
+ ret += "/"
+ }
+
+ return ret;
+ }
+
+ globParent(build_attack(5000));
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
+
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
+
Let’s take the following regular expression as an example:
+
regex = /A(B|C+)+D/
+
+
This regular expression accomplishes the following:
+
+ A The string must start with the letter 'A'
+ (B|C+)+ The string must then follow the letter A with either the letter 'B' or some number of occurrences of the letter 'C' (the + matches one or more times). The + at the end of this section states that we can look for one or more matches of this section.
+ D Finally, we ensure this section of the string ends with a 'D'
+
+
The expression would match inputs such as ABBD, ABCCCCD, ABCBCCCD and ACCCCCD
+
It most cases, it doesn't take very long for a regex engine to find a match:
+
$ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCD")'
+ 0.04s user 0.01s system 95% cpu 0.052 total
+
+ $ time node -e '/A(B|C+)+D/.test("ACCCCCCCCCCCCCCCCCCCCCCCCCCCCX")'
+ 1.79s user 0.02s system 99% cpu 1.812 total
+
+
The entire process of testing it against a 30 characters long string takes around ~52ms. But when given an invalid string, it takes nearly two seconds to complete the test, over ten times as long as it took to test a valid string. The dramatic difference is due to the way regular expressions get evaluated.
+
Most Regex engines will work very similarly (with minor differences). The engine will match the first possible way to accept the current character and proceed to the next one. If it then fails to match the next one, it will backtrack and see if there was another way to digest the previous character. If it goes too far down the rabbit hole only to find out the string doesn’t match in the end, and if many characters have multiple valid regex paths, the number of backtracking steps can become very large, resulting in what is known as catastrophic backtracking.
+
Let's look at how our expression runs into this problem, using a shorter string: "ACCCX". While it seems fairly straightforward, there are still four different ways that the engine could match those three C's:
+
+ - 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.
+
+
Upgrade glob-parent to version 5.1.2 or higher.
+
References
+
+
+
+
+
+
+
+
+
Denial of Service (DoS)
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Denial of Service (DoS) when handling requests with non-standard HTTP methods.
+
Note: In order to be affected, an instrumented software must:
+
+ use promhttp.InstrumentHandler* middleware except RequestsInFlight
+
+ not filter any specific methods (e.g GET) before middleware
+
+ pass metric with method label name to the middleware
+
+ not have any firewall/LB/proxy that filters away requests with unknown method.
+
+
+
Workarounds:
+
+ removing the method label name from counter/gauge used in the InstrumentHandler
+
+ turning off affected promhttp handlers
+
+ adding custom middleware before promhttp handler that will sanitize the request method given by Go http.Request
+
+ using a reverse proxy or web application firewall, configured to only allow a limited set of methods.
+
+
+
Details
+
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its intended and legitimate users.
+
Unlike other vulnerabilities, DoS attacks usually do not aim at breaching security. Rather, they are focused on making websites and services unavailable to genuine users resulting in downtime.
+
One popular Denial of Service vulnerability is DDoS (a Distributed Denial of Service), an attack that attempts to clog network pipes to the system by generating a large volume of traffic from many machines.
+
When it comes to open source libraries, DoS vulnerabilities allow attackers to trigger such a crash or crippling of the service by using a flaw either in the application code or from the use of open source libraries.
+
Two common types of DoS vulnerabilities:
+
+ High CPU/Memory Consumption- An attacker sending crafted requests that could cause the system to take a disproportionate amount of time to process. For example, commons-fileupload:commons-fileupload.
+
+ Crash - An attacker sending crafted requests that could cause the system to crash. For Example, npm ws package
+
+
+
+
Upgrade github.com/prometheus/client_golang/prometheus/promhttp to version 1.11.1 or higher.
+
References
+
+
+
+
+
+
+
+
+
Information Exposure
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Information Exposure by leaking the cookie header to a third party site in the process of fetching a remote URL with the cookie in the request body. If the response contains a location header, it will follow the redirect to another URL of a potentially malicious actor, to which the cookie would be exposed.
+
+
Upgrade follow-redirects to version 1.14.7 or higher.
+
References
+
+
+
+
+
+
+
+
+
Information Exposure
+
+
+
+ medium severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Information Exposure by allowing cookies and the authorization headers to be leaked to external sites.
+
+
Upgrade eventsource to version 1.1.1, 2.0.2 or higher.
+
References
+
+
+
+
+
+
+
+
+
Prototype Pollution
+
+
+
+ low severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
minimist is a parse argument options module.
+
Affected versions of this package are vulnerable to Prototype Pollution due to a missing handler to Function.prototype.
+
Notes:
+
+ This vulnerability is a bypass to CVE-2020-7598
+
+ The reason for the different CVSS between CVE-2021-44906 to CVE-2020-7598, is that CVE-2020-7598 can pollute objects, while CVE-2021-44906 can pollute only function.
+
+
+
PoC by Snyk
+
require('minimist')('--_.constructor.constructor.prototype.foo bar'.split(' '));
+ console.log((function(){}).foo); // bar
+
+
Details
+
Prototype Pollution is a vulnerability affecting JavaScript. Prototype Pollution refers to the ability to inject properties into existing JavaScript language construct prototypes, such as objects. JavaScript allows all Object attributes to be altered, including their magical attributes such as _proto_, constructor and prototype. An attacker manipulates these attributes to overwrite, or pollute, a JavaScript application object prototype of the base object by injecting other values. Properties on the Object.prototype are then inherited by all the JavaScript objects through the prototype chain. When that happens, this leads to either denial of service by triggering JavaScript exceptions, or it tampers with the application source code to force the code path that the attacker injects, thereby leading to remote code execution.
+
There are two main ways in which the pollution of prototypes occurs:
+
+
Unsafe Object recursive merge
+
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
+
+
+
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 Map instead of Object.
+
+
+
+
Arteau, Oliver. “JavaScript prototype pollution attack in NodeJS application.” GitHub, 26 May 2018
+
+
Upgrade minimist to version 1.2.6 or higher.
+
References
+
+
+
+
+
+
+
+
+
Information Exposure
+
+
+
+ low severity
+
+
+
+
+
+
+
+
+
+
Detailed paths
+
+
+
+
+
+
+
+
Overview
+
Affected versions of this package are vulnerable to Information Exposure due a leakage of the Authorization header from the same hostname during HTTPS to HTTP redirection. An attacker who can listen in on the wire (or perform a MITM attack) will be able to receive the Authorization header due to the usage of the insecure HTTP protocol which does not verify the hostname the request is sending to.
+
+
Upgrade follow-redirects to version 1.14.8 or higher.
+
References
+
+
+
+
+
+
+
+