Skip to content

Commit 51d9d1c

Browse files
Merge pull request #34 from MaddyGuthridge/maddy-child-process-promise-notes
Add notes about child-process-promise vulnerability
2 parents 62b8600 + f32cc28 commit 51d9d1c

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

src/lib/server/git.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ export async function runSshKeyscan(url: string) {
8888
}
8989
}
9090

91+
// NOTE: While this is technically vulnerable due to a ReDoS vulnerability in cross-spawn
92+
// (dependency of child-process-promise), this code will only be executed by admins, so it should
93+
// be ok.
9194
const process = await spawn('ssh-keyscan', [host], { capture: ['stdout'] });
9295

9396
// console.log(process.stdout);

src/lib/server/keys.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@ export async function generateKey(): Promise<string> {
7272
await setLocalConfig(cfg);
7373

7474
// ssh-keygen -t $DEFAULT_KEY_TYPE -f ${defaultPrivateKeyPath()} -N '' -c "Minifolio SSH key"
75+
// NOTE: While cross-spawn (dependency of child-process-promise) is technically vulnerable to a
76+
// ReDoS attack, this is fine here, since the arguments are controlled by us
7577
await spawn(
7678
'ssh-keygen',
7779
[

0 commit comments

Comments
 (0)