CVE-2022-39321: Actions/runner Docker Command Escaping Vulnerability
HIGHCVE-2022-39321 is a HIGH (CVSS 8.8) docker command escaping vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Actions/runner libraries in the GitHub Actions ecosystem. The issue involves docker command escaping in the github actions runner. Remediation is available by upgrading affected packages to version 2.296.2, 2.293.1, 2.289.4, 2.285.2, 2.283.4.
CVE-2022-39321 at a Glance
Security Impact
CVSS: 8.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2022-39321
To remediate this vulnerability, upgrade all affected Actions/runner dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade actions/runner to 2.296.2
Upgrade actions/runner to 2.293.1
Upgrade actions/runner to 2.289.4
Upgrade actions/runner to 2.285.2
Upgrade actions/runner to 2.283.4
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for actions/runner
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-39321, inspect your project dependencies for Actions/runner:
inspect dependencies for actions/runner
Analyze the terminal output to locate any version of Actions/runner in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.296.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Actions/runner, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-39321 Affected Actions/runner Versions
5 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
actions/runner
|
GitHub Actions |
≥ 2.294.0
< 2.296.2
|
2.296.2
|
|
actions/runner
|
GitHub Actions |
≥ 2.290.0
< 2.293.1
|
2.293.1
|
|
actions/runner
|
GitHub Actions |
≥ 2.286.0
< 2.289.4
|
2.289.4
|
|
actions/runner
|
GitHub Actions |
≥ 2.284.0
< 2.285.2
|
2.285.2
|
|
actions/runner
|
GitHub Actions |
< 2.283.4
|
2.283.4
|
References
Frequently Asked Questions
What is CVE-2022-39321?
Which Actions/runner versions are affected?
What version fixes CVE-2022-39321?
Is actions/runner affected?
What is the CVSS score of CVE-2022-39321?
What CWE is associated with CVE-2022-39321?
How can I check GitHub Actions dependencies for CVE-2022-39321?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2c6m-6gqh-6qg3",
"modified" : "2022-10-25T19:54:27Z",
"published" : "2022-10-25T19:54:27Z",
"aliases" : [ "CVE-2022-39321" ],
"summary" : "Docker Command Escaping in the GitHub Actions Runner",
"details" : "### Impact\n\nThe actions runner invokes the docker cli directly in order to run job containers, service containers, or container actions. A bug in the logic for how the environment is encoded into these docker commands was discovered that allows an input to escape the environment variable and modify that docker command invocation directly. Jobs that use [container actions](https://docs.github.com/en/actions/creating-actions/creating-a-docker-container-action), [job containers](https://docs.github.com/en/actions/using-jobs/running-jobs-in-a-container), or [service containers](https://docs.github.com/en/actions/using-containerized-services/about-service-containers) alongside untrusted user inputs in environment variables may be vulnerable.\n\n### Patches\nThe Actions Runner has been patched, both on `github.com` and hotfixes for GHES and GHAE customers. Please update to one of the following versions of the runner:\n- 2.296.2\n- 2.293.1\n- 2.289.4\n- 2.285.2\n- 2.283.4\n\nGHES and GHAE customers may want to patch their instance in order to have their runners automatically upgrade to these new runner versions.\n\n### Workarounds\nYou may want to consider removing any container actions, job containers, or service containers from your jobs until you are able to upgrade your runner versions.\n\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the actions runner](https://github.com/actions/runner)\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "actions/runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.294.0"
}, {
"fixed" : "2.296.2"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "< 2.296.1"
}
}, {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "actions/runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.290.0"
}, {
"fixed" : "2.293.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "actions/runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.286.0"
}, {
"fixed" : "2.289.4"
} ]
} ]
}, {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "actions/runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.284.0"
}, {
"fixed" : "2.285.2"
} ]
} ]
}, {
"package" : {
"ecosystem" : "GitHub Actions",
"name" : "actions/runner"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.283.4"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/actions/runner/security/advisories/GHSA-2c6m-6gqh-6qg3"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39321"
}, {
"type" : "WEB",
"url" : "https://github.com/actions/runner/pull/2107"
}, {
"type" : "WEB",
"url" : "https://github.com/actions/runner/pull/2108"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/actions/runner"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-78" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2022-10-25T19:54:27Z",
"nvd_published_at" : "2022-10-25T17:15:00Z"
}
}