CVE-2023-5115 Ansible: malicious role archive can cause ansible-galaxy to overwrite arbitrary files

Medium 6.3 Published Updated

Attackers can craft malicious Ansible roles to overwrite arbitrary files on the victim's system via symlink-based path traversal during role installation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2023-5115?

CVE-2023-5115 is a medium-severity path traversal vulnerability in Debian Debian Linux, published on 18 Dec 2023. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

Official description

An absolute path traversal attack exists in the Ansible automation platform. This flaw allows an attacker to craft a malicious Ansible role and make the victim execute the role. A symlink can be used to overwrite a file outside of the extraction path.

Weakness: CWE-22, CWE-36

Which versions are affected by CVE-2023-5115?

3 open source packages ship an affected version, including ansible. It affects 4 products.

PackageAffectedFixed in
ansible PyPIAll versions8.5.0
ansible PyPIAll versions8.5.0
ansible PyPIAll versions8.5.0

Products include Debian Debian Linux, Redhat Ansible Automation Platform, Redhat Ansible Developer, Redhat Ansible Inside.

How do I fix CVE-2023-5115?

Upgrade ansible to 8.5.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2023-5115 being exploited?

There is no known exploitation of CVE-2023-5115 in the wild and no public exploit code.

All Debian Debian Linux vulnerabilities

Sources

Also known as AZL-32279, AZL-34540, DEBIAN-CVE-2023-5115, GHSA-jpvw-p8pr-9g2x, PYSEC-2026-1120, UBUNTU-CVE-2023-5115 and 1 more.

Is CVE-2023-5115 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free