CVE-2023-4237: Ansible-core - Exposing Private Key

ansible-core Updated 02 Oct 2025

Summary

04/10/2023
No i
Moderate
6.5

CVE-2023-4237: Ansible may expose private key. Affects ansible-core versions >= 2.8.0, <= 2.15.2. No fix is published. How to fix ↓

Also tracked for

The same CVE-2023-4237 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Ansible-core is an open-source automation platform that allows users to automate IT tasks such as configuration management, application deployment, and orchestration. It provides a simple and agentless approach to managing and automating systems. The ec2_key module in Ansible-core is responsible for creating key pairs for EC2 instances. However, a vulnerability in this module exposes the private key directly to the standard output, compromising the system's confidentiality, integrity, and availability.

Vulnerability Detail

The vulnerability (CVE-2023-4237) in Ansible-core allows an attacker to fetch private keys from log files. When creating a new keypair using the ec2_key module, the private key is printed to the standard output. This means that the private key can be easily accessed by an attacker who has access to the log files. The exposure of private keys can lead to unauthorized access, data breaches, and potential compromise of the entire system. The vulnerability affects Ansible-core versions 2.8.0 to 2.15.2.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Workaround

As a workaround, users can modify the ec2_key module to prevent the printing of private keys to the standard output. This can be achieved by commenting out or removing the code responsible for printing the private key. However, this workaround should be considered temporary, and it is strongly advised to apply the official fix by upgrading to a patched version of Ansible-core.

Conclusion

The vulnerability in Ansible-core's ec2_key module exposes private keys, compromising the system's confidentiality, integrity, and availability. Users should upgrade to a patched version of Ansible-core and review log file security. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for ansible-core →

Share this vulnerability

FAQ

Ansible-core is an open-source automation platform used for configuration management, application deployment, and orchestration.

The ec2_key module in Ansible-core is responsible for creating key pairs for EC2 instances.

The vulnerability in Ansible-core's ec2_key module allows the private key to be printed directly to the standard output, making it accessible to attackers who have access to the log files.

The exposure of private keys can lead to unauthorized access, data breaches, and potential compromise of the entire system.

To fix this vulnerability, it is recommended to upgrade to a patched version of Ansible-core and secure log files to prevent unauthorized access.

Related vulnerabilities

Recent vulnerabilities recorded for ansible-core.

How To Fix

No fixed version is published for this vulnerability.

Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback