Miggo Logo

CVE-2024-52587: Harden-Runner has a command injection weaknesses in `setup.ts` and `arc-runner.ts`

8.8

CVSS Score
3.1

Basic Information

EPSS Score
0.64864%
Published
11/18/2024
Updated
11/19/2024
KEV Status
No
Technology
TechnologyGitHub Actions

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
step-security/harden-runneractions< 2.10.22.10.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from improper use of execSync with untrusted environment variables in shell commands. In setup.ts, lines 169 and 229 directly interpolate USER into shell commands without sanitization. In arc-runner.ts, multiple functions (sendAllowedEndpoints, applyPolicy, etc.) use execSync with getRunnerTempDir(), which relies on the RUNNER_TEMP environment variable. Attackers could manipulate these variables to inject arbitrary commands. The commit diff shows these were patched by replacing execSync with safer methods like execFileSync or Node.js filesystem APIs, confirming the vulnerable functions.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Summ*ry V*rsions o* st*p-s**urity/**r**n-runn*r prior to v*.**.* *ont*in multipl* *omm*n* inj**tion w**kn*ss*s vi* *nvironm*nt v*ri**l*s t**t *oul* pot*nti*lly ** *xploit** un**r sp**i*i* *on*itions. *ow*v*r, *u* to t** *urr*nt *x**ution or**r o

Reasoning

T** vuln*r**ility st*ms *rom improp*r us* o* `*x**Syn*` wit* untrust** *nvironm*nt v*ri**l*s in s**ll *omm*n*s. In `s*tup.ts`, lin*s *** *n* *** *ir**tly int*rpol*t* `US*R` into s**ll *omm*n*s wit*out s*nitiz*tion. In `*r*-runn*r.ts`, multipl* *un*ti