CVE-2022-3697: Ansible Ansible Leaks Password To Logs Vulnerability
HIGHCVE-2022-3697 is a HIGH (CVSS 7.5) ansible leaks password to logs vulnerability (CWE-233: Improper Handling of Parameters) affecting Ansible libraries in the PyPI ecosystem. The issue involves ansible leaks password to logs. Remediation is available by upgrading affected packages to version 7.0.0.
CVE-2022-3697 at a Glance
Security Impact
CVSS: 7.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N).
How to Fix CVE-2022-3697
To remediate this vulnerability, upgrade all affected Ansible 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>=7.0.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show ansible
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-3697, inspect your installed packages using pip:
pip show ansible
Analyze the terminal output to locate any version of Ansible in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 7.0.0), your application is affected.
Note: The pip show ansible command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-233: Improper Handling of Parameters, where the product does not properly handle when the expected number of parameters, fields, or arguments is not provided in input, or if those parameters are undefined. In Ansible, 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-3697 Affected Ansible Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
ansible
|
PyPI |
≥ 2.5.0
< 7.0.0
|
7.0.0
|
References
Frequently Asked Questions
What is CVE-2022-3697?
Which Ansible versions are affected?
What version fixes CVE-2022-3697?
Is ansible affected?
What is the CVSS score of CVE-2022-3697?
What CWE is associated with CVE-2022-3697?
How can I check PyPI dependencies for CVE-2022-3697?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-cpx3-93w7-457x",
"modified" : "2023-08-31T21:28:27Z",
"published" : "2022-10-28T19:00:38Z",
"aliases" : [ "CVE-2022-3697" ],
"summary" : "Ansible leaks password to logs",
"details" : "A flaw was found in Ansible in the amazon.aws collection when using the `tower_callback` parameter from the `amazon.aws.ec2_instance` module. This flaw allows an attacker to take advantage of this issue as the module is handling the parameter insecurely, leading to the password leaking in the logs.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "ansible"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "2.5.0"
}, {
"fixed" : "7.0.0"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-3697"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible-collections/amazon.aws/pull/1199"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible/ansible/pull/35749"
}, {
"type" : "WEB",
"url" : "https://github.com/ansible-community/ansible-build-data/blob/main/6/CHANGELOG-v6.rst"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/ansible/ansible"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/12/msg00018.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-233" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2023-01-24T23:11:22Z",
"nvd_published_at" : "2022-10-28T16:15:00Z"
}
}