CVE-2017-7481
Ansible fails to properly mark lookup-plugin results as unsafe
Also known as GHSA-w578-j992-554x, PYSEC-2018-41
Mitigation
- Upgrade ansible to one of 2.3.1.0, 2.1.6.0, 2.2.3.0, 2.4.0.0 (or later in the same release line).
Who should check
- Projects that depend on PyPI package ansible (>= 2.3.0.0, < 2.3.1.0)
- Anyone running [UNKNOWN] ansible ansible 2.3.1.0; ansible 2.4.0.0
Vulnerability facts
- Affected
- ansible >= 2.3.0.0, < 2.3.1.0
- Fixed in
- 2.3.1.0, 2.1.6.0, 2.2.3.0, 2.4.0.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 5.3 (v3.0, CNA)CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:NOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: High
- Privileges required: None
- User interaction: Required
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: High
- Availability impact: None
- EPSS
- 4.58% chance of exploitation in 30 days (percentile 92, 2026-11-26)
- CWE
- CWE-20
- Modified
Description
Ansible before versions 2.3.1.0 and 2.4.0.0 fails to properly mark lookup-plugin results as unsafe. If an attacker could control the results of lookup() calls, they could inject Unicode strings to be parsed by the jinja2 templating system, resulting in code execution. By default, the jinja2 templating language is now marked as 'unsafe' and is not evaluated.
Affected and fixed versions
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2017-7481. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2017-7481.md Affected: ansible >= 2.3.0.0, < 2.3.1.0 Fixed in: 2.3.1.0, 2.1.6.0, 2.2.3.0, 2.4.0.0 Steps: 1. Search this machine and project for ansible (PyPI), [UNKNOWN] ansible: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Vendor advisories
- https://access.redhat.com/errata/RHSA-2017:1599
- https://access.redhat.com/errata/RHSA-2017:1334
- https://access.redhat.com/errata/RHSA-2017:1244
- https://access.redhat.com/errata/RHSA-2017:1499
- https://access.redhat.com/errata/RHSA-2017:2524
- https://access.redhat.com/errata/RHSA-2017:1476
- https://usn.ubuntu.com/4072-1/
- https://nvd.nist.gov/vuln/detail/CVE-2017-7481
- https://github.com/advisories/GHSA-w578-j992-554x
Patches
- https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2017-7481
- https://github.com/ansible/ansible/commit/ed56f51f185a1ffd7ea57130d260098686fcc7c2
- https://github.com/ansible/ansible/commit/fd30f5328986f9e1da434474481f32bf918a600c
- https://github.com/ansible/ansible/commit/f0e348f5eeb70c1fb3127d90891da43b5c0a9d29
- https://github.com/ansible/ansible/commit/a1886911fcf4b691130cfc70dfc5daa5e07c46a3
Other
- http://www.securityfocus.com/bid/98492
- https://lists.debian.org/debian-lts-announce/2021/01/msg00023.html
- https://web.archive.org/web/20170801122609/http://www.securityfocus.com/bid/98492
- https://usn.ubuntu.com/4072-1
- https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-41.yaml
- https://github.com/ansible/ansible
FAQ
Is CVE-2017-7481 being exploited?
There is no confirmed exploitation: CVE-2017-7481 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 4.58% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2017-7481?
Medium: CVSS 5.3 (v3.0, scored by CNA). Remote, no login needed. A user has to take an action, such as opening a link, for the attack to work. The attack needs conditions outside the attacker's control, which makes it harder.
Which versions are affected by CVE-2017-7481?
ansible >= 2.3.0.0, < 2.3.1.0.
Is there a fix for CVE-2017-7481?
Yes. Fixed in 2.3.1.0, 2.1.6.0, 2.2.3.0, 2.4.0.0. Upgrade ansible to one of 2.3.1.0, 2.1.6.0, 2.2.3.0, 2.4.0.0 (or later in the same release line).
How do I check if I'm affected by CVE-2017-7481?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.