CVE-2023-4237: Ansible core Ansible May Expose Private Key Vulnerability
MODERATECVE-2023-4237 is a MODERATE (CVSS 6.5) ansible may expose private key vulnerability (CWE-497: Exposure of Sensitive System Information to an Unauthorized Control Sphere) affecting Ansible core libraries in the PyPI ecosystem. The issue involves ansible may expose private key. Remediation is available in the latest vendor maintenance releases.
CVE-2023-4237 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H).
How to Fix CVE-2023-4237
To remediate this vulnerability, upgrade all affected Ansible core 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-core>=Latest secure release
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ansible-core
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2023-4237, inspect your installed packages using pip:
pip show ansible-core
Analyze the terminal output to locate any version of Ansible core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.
Note: The pip show ansible-core command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-497: Exposure of Sensitive System Information to an Unauthorized Control Sphere, where the product does not properly prevent sensitive system-level information from being accessed by unauthorized actors who do not have the same level of access to the underlying system as the product does. In Ansible core, 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-2023-4237 Affected Ansible core Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ansible-core
|
PyPI |
≥ 2.8.0
≤ 2.15.2
|
|
References
Frequently Asked Questions
What is CVE-2023-4237?
Which Ansible core versions are affected?
What version fixes CVE-2023-4237?
Is ansible-core affected?
What is the CVSS score of CVE-2023-4237?
What CWE is associated with CVE-2023-4237?
How can I check PyPI dependencies for CVE-2023-4237?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ww3m-ffrm-qvqv",
"modified" : "2023-10-10T22:29:26Z",
"published" : "2023-10-04T15:30:35Z",
"aliases" : [ "CVE-2023-4237" ],
"summary" : "Ansible may expose private key",
"details" : "A flaw was found in the Ansible Automation Platform. When creating a new keypair, the ec2_key module prints out the private key directly to the standard output. This flaw allows an attacker to fetch those keys from the log files, compromising the system's confidentiality, integrity, and availability.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible-core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.8.0"
}, {
"last_affected" : "2.15.2"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-4237"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHBA-2023:5653"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/errata/RHBA-2023:5666"
}, {
"type" : "WEB",
"url" : "https://access.redhat.com/security/cve/CVE-2023-4237"
}, {
"type" : "WEB",
"url" : "https://bugzilla.redhat.com/show_bug.cgi?id=2229979"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ansible/ansible"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-497" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2023-10-10T22:29:26Z",
"nvd_published_at" : "2023-10-04T15:15:12Z"
}
}