Miggo Logo

CVE-2022-25860: Remote code execution in simple-git

9.8

CVSS Score
3.1

Basic Information

EPSS Score
0.96628%
CWE
-
Published
1/26/2023
Updated
2/3/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
simple-gitnpm< 3.16.03.16.0

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper input sanitization in Git command argument handling. The commit diffs show added validations in block-unsafe-operations-plugin.ts for --upload-pack, --receive-pack, and -u flags, which were previously unsanitized. These methods directly accept user-controllable arguments that get passed to git CLI without proper validation in vulnerable versions. The advisory explicitly names these four methods as attack vectors, and the Snyk PoC demonstrates RCE through these endpoints. The patch adds validation checks specifically for these arguments in the plugin system that these methods utilize.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

V*rsions o* t** p**k*** simpl*-*it ***or* *.**.* *r* vuln*r**l* to R*mot* *o** *x**ution (R**) vi* t** *lon*(), pull(), pus*() *n* listR*mot*() m*t*o*s, *u* to improp*r input s*nitiz*tion. T*is vuln*r**ility *xists *u* to *n in*ompl*t* *ix o* *V*-***

Reasoning

T** vuln*r**ility st*ms *rom improp*r input s*nitiz*tion in *it *omm*n* *r*um*nt **n*lin*. T** *ommit *i**s s*ow ***** v*li**tions in `*lo*k-uns***-op*r*tions-plu*in.ts` *or --uplo**-p**k, --r***iv*-p**k, *n* -u *l**s, w*i** w*r* pr*viously uns*nitiz