Miggo Logo

GHSA-fm76-w8jw-xf8m: @saltcorn/plugins-loader unsanitized plugin name leads to a remote code execution (RCE) vulnerability when creating plugins using git source

7.2

CVSS Score
3.1

Basic Information

CVE ID
-
EPSS Score
-
Published
10/3/2024
Updated
10/4/2024
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
@saltcorn/plugins-loadernpm<= 1.0.0-beta.131.0.0-beta.14

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability chain starts with user-controlled plugin.name being used in PluginInstaller to construct directory paths. When the source is 'git', these unsanitized paths are passed to gitPullOrClone which uses execSync with string interpolation. The combination of: 1) user input flowing into command arguments without validation, 2) use of execSync which executes in a shell context, and 3) lack of proper sanitization of plugin.name containing special characters, allows command injection. The patch confirms this by replacing execSync with execFileSync and proper argument handling.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry W**n *r**tin* * n*w plu*in usin* t** `*it` sour**, t** us*r-*ontroll** v*lu* `r*q.*o*y.n*m*` is us** to *uil* t** plu*in *ir**tory w**r* t** lo**tion will ** *lon**. T** *PI us** to *x**ut* t** `*it *lon*` *omm*n* wit* t** us*r-*ontroll*

Reasoning

T** vuln*r**ility ***in st*rts wit* us*r-*ontroll** `plu*in.n*m*` **in* us** in `Plu*inInst*ll*r` to *onstru*t *ir**tory p*t*s. W**n t** sour** is '*it', t**s* uns*nitiz** p*t*s *r* p*ss** to `*itPullOr*lon*` w*i** us*s `*x**Syn*` wit* strin* int*rpo