Summary
Versions of step-security/harden-runner prior to v2.10.2 contain multiple command injection weaknesses via environment variables that could potentially be exploited under specific conditions. However, due to the current execution order of pre-steps in GitHub Actions and the placement of harden-runner as the first step in a job, the likelihood of exploitation is low as the Harden-Runner action reads the environment variable during the pre-step stage. There are no known exploits at this time.
Details
setup.ts:169 1 performs
execSyncwith a command that gets
invoked after interpretation by the shell. This command includes an
interpolatedprocess.env.USERvariable, which an attacker could
modify (without actually creating a new user) to inject arbitrary
shell expressions into thisexecSync. This may or may not be likely
in practice, but I believe the hygienic way to perform the underlying
operation is to useexecFileSyncor similar and bypass the
underlying shell evaluation.setup.ts:229 2 has a nearly identical
execSyncto (1) above,
but with$USERfor shell-level interpolation rather than string
interpolation. However, this is still injectable and would be best
replaced by anexecFileSync, per above.arc-runner:40-44 3 has an
execSyncwith multiple string
interpolations. Most of these do not appear immediately injectible
(since they appear to come from presumed trusted API responses), but
the expansion ofgetRunnerTempDir()may be injectable due to its
dependence on potentially attacker-controllable environment variables
(e.g.RUNNER_TEMP). The underlying operation appears to be a trivial
file copy, so this entire subprocess should in theory be replaceable
with ordinary NodeJSfsAPI calls instead.arc-runner:53 4 demonstrates the same weakness, and has the same
resolution as (3).arc-runner:57 demonstrates the same weakness as (3) and (4), and
has the same resolution.arc-runner:61 demonstrates the same weakness as (3), (4), and (5),
and has the same resolution.
Impact
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
CVE-2024-52587 has a CVSS score of 8.8 (Low). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (2.10.2); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2024-52587? CVE-2024-52587 is a low-severity OS command injection vulnerability in step-security/harden-runner (actions), affecting versions < 2.10.2. It is fixed in 2.10.2. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- How severe is CVE-2024-52587? CVE-2024-52587 has a CVSS score of 8.8 (Low). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of step-security/harden-runner are affected by CVE-2024-52587? step-security/harden-runner (actions) versions < 2.10.2 is affected.
- Is there a fix for CVE-2024-52587? Yes. CVE-2024-52587 is fixed in 2.10.2. Upgrade to this version or later.
- Is CVE-2024-52587 exploitable, and should I be worried? Whether CVE-2024-52587 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-52587 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-52587? Upgrade
step-security/harden-runnerto 2.10.2 or later.