---
id: CVE-2023-5764
aliases:
  - GHSA-7j69-qfc3-2fq9
  - PYSEC-2026-1122
title: Ansible template injection vulnerability
summary: Ansible template injection vulnerability
severity: medium
cvss: 6.6
cvssVector: 'CVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:N'
vendor: ansible-core
product: ansible-core
ecosystem: pip
affected:
  - 'ansible-core >= 2.16.0, < 2.16.1'
  - 'ansible-core >= 2.15.0, < 2.15.8'
  - ansible-core < 2.14.12
patched:
  - ansible-core 2.16.1
  - ansible-core 2.15.8
  - ansible-core 2.14.12
published: '2023-12-13'
updated: '2026-07-07'
source: OSV
sourceUrl: 'https://osv.dev/vulnerability/GHSA-7j69-qfc3-2fq9'
references:
  - url: 'https://nvd.nist.gov/vuln/detail/CVE-2023-5764'
  - url: >-
      https://github.com/ansible/ansible/commit/270b39f6ff02511a2199505161218cbd1a5ae34f
  - url: >-
      https://github.com/ansible/ansible/commit/7239d2d371bc6e274cbb7314e01431adce6ae25a
  - url: >-
      https://github.com/ansible/ansible/commit/fea130480d261ea5bf6fcd5cf19a348f1686ceb1
  - url: 'https://access.redhat.com/errata/RHSA-2023:7773'
  - url: 'https://access.redhat.com/security/cve/CVE-2023-5764'
  - url: 'https://bugzilla.redhat.com/show_bug.cgi?id=2247629'
  - url: 'https://github.com/ansible/ansible'
  - url: >-
      https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/X7Q6CHPVCHMZS5M7V22GOKFSXZAQ24EU
tags:
  - osv
  - pip
epss: 0.00544
epssPercentile: 0.4458
ingestedAt: '2026-07-08T18:25:47.026Z'
---

## Overview

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.

## Affected packages

- `ansible-core >= 2.16.0, < 2.16.1`
- `ansible-core >= 2.15.0, < 2.15.8`
- `ansible-core < 2.14.12`

## Remediation

Upgrade to a patched release:

- `ansible-core 2.16.1`
- `ansible-core 2.15.8`
- `ansible-core 2.14.12`
