CVE-2017-2809: Ansible vault Code Injection Vulnerability
HIGHCVE-2017-2809 is a HIGH (CVSS 7.8) code injection vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Ansible vault libraries in the PyPI ecosystem. The issue involves code injection in ansible. Remediation is available by upgrading affected packages to version 1.0.5.
CVE-2017-2809 at a Glance
Security Impact
CVSS: 7.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2017-2809
To remediate this vulnerability, upgrade all affected Ansible vault dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install ansible-vault>=1.0.5
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ansible-vault
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2017-2809, inspect your installed packages using pip:
pip show ansible-vault
Analyze the terminal output to locate any version of Ansible vault in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.5), your application is affected.
Note: The pip show ansible-vault command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Ansible vault, 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-2017-2809 Affected Ansible vault Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ansible-vault
|
PyPI |
< 1.0.5
|
1.0.5
|
References
Frequently Asked Questions
What is CVE-2017-2809?
Which Ansible vault versions are affected?
What version fixes CVE-2017-2809?
Is ansible-vault affected?
What is the CVSS score of CVE-2017-2809?
What CWE is associated with CVE-2017-2809?
How can I check PyPI dependencies for CVE-2017-2809?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-c2w9-48qc-qpj4",
"modified" : "2024-09-03T21:23:13Z",
"published" : "2018-07-13T15:16:54Z",
"aliases" : [ "CVE-2017-2809" ],
"summary" : "Code injection in ansible",
"details" : "An exploitable vulnerability exists in the yaml loading functionality of ansible-vault before 1.0.5. A specially crafted vault can execute arbitrary python commands resulting in command execution. An attacker can insert python into the vault to trigger this vulnerability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
}, {
"type" : "CVSS_V4",
"score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible-vault"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.0.5"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-2809"
}, {
"type" : "WEB",
"url" : "https://github.com/tomoh1r/ansible-vault/issues/4"
}, {
"type" : "WEB",
"url" : "https://github.com/tomoh1r/ansible-vault/commit/3f8f659ef443ab870bb19f95d43543470168ae04"
}, {
"type" : "ADVISORY",
"url" : "https://github.com/advisories/GHSA-c2w9-48qc-qpj4"
}, {
"type" : "WEB",
"url" : "https://github.com/pypa/advisory-database/tree/main/vulns/ansible-vault/PYSEC-2017-5.yaml"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/tomoh1r/ansible-vault"
}, {
"type" : "WEB",
"url" : "https://github.com/tomoh1r/ansible-vault/blob/v1.0.5/CHANGES.txt"
}, {
"type" : "WEB",
"url" : "https://web.archive.org/web/20171206173637/http://www.securityfocus.com/bid/100824"
}, {
"type" : "WEB",
"url" : "https://www.talosintelligence.com/vulnerability_reports/TALOS-2017-0305"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-94" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2020-06-16T21:30:09Z",
"nvd_published_at" : "2017-09-14T19:29:00Z"
}
}