CVE-2023-5764 Ansible: template injection

High 7.1 Published Updated

An attacker can execute arbitrary code via template injection in Ansible by crafting malicious template data, affecting automation platform users.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2023-5764?

CVE-2023-5764 is a high-severity code injection vulnerability in Fedoraproject Extra Packages for Enterprise Linux, published on 12 Dec 2023. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

A template injection flaw was found in Ansible where a user's controller internal templating operations may remove the unsafe designation from template data. This issue could allow an attacker to use a specially crafted file to introduce templating injection when supplying templating data.

Weakness: CWE-1336

Which versions are affected by CVE-2023-5764?

7 open source packages ship an affected version, including ansible-core. It affects 6 products.

PackageAffectedFixed in
ansible-core PyPIAll versions2.14.12, 2.15.8, 2.16.1
ansible-core PyPIAll versions2.14.12
ansible-core PyPIAll versions2.14.12
ansible-core PyPIFrom 2.15.02.15.8
ansible-core PyPIFrom 2.15.02.15.8
ansible-core PyPIFrom 2.16.02.16.1
1 more packages
ansible-core PyPIFrom 2.16.02.16.1
Linux distribution packages (1)
ansible-documentation openSUSE:TumbleweedAll versions2.15.7-1.1

Products include Fedoraproject Extra Packages for Enterprise Linux, Fedoraproject Fedora, Redhat Ansible, Redhat Ansible Automation Platform, Redhat Ansible Developer, Redhat Ansible Inside.

How do I fix CVE-2023-5764?

Upgrade ansible-core to a fixed version for your release line: 2.14.12, 2.15.8 or 2.16.1.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2023-5764 being exploited?

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

All Fedoraproject Extra Packages for Enterprise Linux vulnerabilities

Sources

Also known as AZL-32158, AZL-34538, CLSA-2024-1716272658, CLSA-2024-1716287930, CLSA-2024-1716485825, CLSA-2025-1761901881 and 10 more.

Is CVE-2023-5764 in your software?

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

Check your SBOMs for free