CVE-2017-7481 json
Ansible fails to properly mark lookup-plugin results as unsafe
published 2018-07-19 8 y ago modified 2026-06-17 4 mo ago also GHSA-w578-j992-554x , PYSEC-2018-41 , EUVD-2018-0014
- cvss
- 5.3
- version 3.0, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 4.7%
- EPSS 4.7% chance of exploitation in 30 days, percentile 91%
- public exploits
- 0
- none known
Summary
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.
Patch / fix
- pypi ansible 2.1.6.0, 2.2.3.0, 2.3.1.0, 2.4.0.0
- redhat ansible_engine 2.3.1.0, 2.4.0.0
- ansible Debian 14, Debian 13, Debian 12 2.3.1.0+dfsg-1
debian advisories DEBIAN-CVE-2017-7481
- ansible Ubuntu 16.04 LTS 2.0.0.2-2ubuntu1.3
ubuntu advisories UBUNTU-CVE-2017-7481
Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0
- ansible rhev manager 4 2.3.1.0-3.el7
- ansible storage 3.2, rhscon 2, openstack 11 +5 more 2.2.3.0-1.el7
- openshift-ansible openshift 3.2 3.2.56-1.git.0.b844ab7.el7
- openshift-ansible openshift 3.3 3.3.82-1.git.0.af0c922.el7
- openshift-ansible openshift 3.4 3.4.89-1.git.0.ac29ce8.el7
- openshift-ansible openshift 3.5 3.5.71-1.git.0.128c2db.el7
- atomic-openshift-utils openshift 3.2 3.2.56-1.git.0.b844ab7.el7
- atomic-openshift-utils openshift 3.3 3.3.82-1.git.0.af0c922.el7
red hat advisories RHSA-2017:2524RHSA-2017:1599RHSA-2017:1476RHSA-2017:1499RHSA-2017:1334RHSA-2017:1244
- ansible OpenStack Cloud 7 2.2.3.0-5.1
- monasca-installer OpenStack Cloud 7 20170912_10.45-5.1
suse advisories SUSE-SU-2017:3029-1
- ansible-14 openSUSE Tumbleweed 14.6.0-1.1
- ansible-13 openSUSE Tumbleweed 13.7.0-1.1
- ansible-12 openSUSE Tumbleweed 12.2.0-1.1
- ansible-11 openSUSE Tumbleweed 11.11.0-1.1
- ansible-10 openSUSE Tumbleweed 10.6.0-1.1
- ansible-9 openSUSE Tumbleweed 9.8.0-1.1
- ansible Package Hub 15 2.7.6-bp150.3.3.1
- ansible Package Hub 12 2.4.1.0-6.1
opensuse advisories openSUSE-SU-2026:12447-1openSUSE-SU-2026:10944-1openSUSE-SU-2025:15753-1openSUSE-SU-2025:15605-1openSUSE-SU-2024:14536-1openSUSE-SU-2024:14244-1
Vendor advisories
What the vendors themselves say about their products: affected, fixed or not affected, and what to do.
red hat product security vex CVE-2017-7481 updated cvss 5.3
ansible: Security issue with lookup return not tainting the jinja2 environment
-
Red Hat Quickstart Cloud Installer 1 ansibleaffected: no fix available
-
Red Hat Gluster Storage Server 3.2 on RHEL-7 ansible 2.2.3.0-1.el7fixed: vendor fix RHSA-2017:1334
-
Red Hat OpenShift Container Platform 3.2 ansible 2.2.3.0-1.el7, openshift-ansible 3.2.56-1.git.0.b844ab7.el7, atomic-openshift-utils 3.2.56-1.git.0.b844ab7.el7, openshift-ansible-roles 3.2.56-1.git.0.b844ab7.el7, openshift-ansible-playbooks 3.2.56-1.git.0.b844ab7.el7, openshift-ansible-filter-plugins 3.2.56-1.git.0.b844ab7.el7, +1 more Red Hat OpenShift Container Platform 3.3 ansible 2.2.3.0-1.el7, openshift-ansible 3.3.82-1.git.0.af0c922.el7, atomic-openshift-utils 3.3.82-1.git.0.af0c922.el7, openshift-ansible-roles 3.3.82-1.git.0.af0c922.el7, openshift-ansible-playbooks 3.3.82-1.git.0.af0c922.el7, openshift-ansible-filter-plugins 3.3.82-1.git.0.af0c922.el7, +2 more Red Hat OpenShift Container Platform 3.4 ansible 2.2.3.0-1.el7, openshift-ansible 3.4.89-1.git.0.ac29ce8.el7, atomic-openshift-utils 3.4.89-1.git.0.ac29ce8.el7, openshift-ansible-roles 3.4.89-1.git.0.ac29ce8.el7, openshift-ansible-playbooks 3.4.89-1.git.0.ac29ce8.el7, openshift-ansible-filter-plugins 3.4.89-1.git.0.ac29ce8.el7, +2 more Red Hat OpenShift Container Platform 3.5 ansible 2.2.3.0-1.el7, openshift-ansible 3.5.71-1.git.0.128c2db.el7, atomic-openshift-utils 3.5.71-1.git.0.128c2db.el7, openshift-ansible-roles 3.5.71-1.git.0.128c2db.el7, openshift-ansible-playbooks 3.5.71-1.git.0.128c2db.el7, openshift-ansible-filter-plugins 3.5.71-1.git.0.128c2db.el7, +2 morefixed: vendor fix RHSA-2017:1244
-
Red Hat OpenStack Platform 10.0 ansible 2.2.3.0-1.el7fixed: vendor fix RHSA-2017:1599
-
Red Hat OpenStack Platform 11.0 ansible 2.2.3.0-1.el7fixed: vendor fix RHSA-2017:1476
-
Red Hat Storage Console Installer 2 ansible 2.2.3.0-1.el7fixed: vendor fix RHSA-2017:1499
-
Red Hat Virtualization Manager 4.1 ansible 2.3.1.0-3.el7fixed: vendor fix RHSA-2017:2524
-
Red Hat OpenStack Platform 12 (Pike) ansiblenot affected: vulnerable code not present
Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf
Exploit prediction
4.74% chance of exploitation in the next 30 days, higher than 91% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.0 | 5.3 | CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N |
| NVD | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
| NVD | 2.0 | 7.5 | AV:N/AC:L/Au:N/C:P/I:P/A:P |
| GitHub | 3.1 | 9.8 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| pypi | ansible | >=2.3.0.0, <2.3.1.0 <2.1.6.0 >=2.2.0.0, <2.2.3.0 <2.3.1.0 >=2.3.2.0, <2.4.0.0 |
2.3.1.0 2.1.6.0 2.2.3.0 2.4.0.0 |
Affected products
- [UNKNOWN] ansible
Classification
- Weakness
-
- CWE-20 Improper Input Validation
References
-
github.com
/ansible/ansible/commit/ed56f51f185a1ffd7ea57130d260098686fcc7c2
web, patch, third-party-advisory
-
bugzilla.redhat.com
/show_bug.cgi?id=CVE-2017-7481
web, issue-tracking, patch, vendor-advisory, report
-
github.com
/ansible/ansible/commit/fd30f5328986f9e1da434474481f32bf918a600c
web
-
github.com
/ansible/ansible/commit/f0e348f5eeb70c1fb3127d90891da43b5c0a9d29
web
-
github.com
/ansible/ansible/commit/a1886911fcf4b691130cfc70dfc5daa5e07c46a3
web
-
access.redhat.com
/errata/RHSA-2017:1599
vendor-advisory, web, advisory
-
access.redhat.com
/errata/RHSA-2017:1334
vendor-advisory, web, advisory
-
access.redhat.com
/errata/RHSA-2017:1244
vendor-advisory, web, advisory
-
access.redhat.com
/errata/RHSA-2017:1499
vendor-advisory, web, advisory
-
access.redhat.com
/errata/RHSA-2017:2524
vendor-advisory, web, advisory
-
access.redhat.com
/errata/RHSA-2017:1476
vendor-advisory, web, advisory
-
usn.ubuntu.com
/4072-1/
vendor-advisory, third-party-advisory, web
-
securityfocus.com
/bid/98492
vdb-entry, third-party-advisory, web
-
lists.debian.org
/debian-lts-announce/2021/01/msg00023.html
mailing-list, web, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2017-7481
advisory
-
web.archive.org
/web/20170801122609/http://www.securityfocus.com/bid/98492
web
-
usn.ubuntu.com
/4072-1
web
-
github.com
/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-41.yaml
web
-
github.com
/ansible/ansible
package
-
github.com
/advisories/GHSA-w578-j992-554x
advisory
Sources
- CVE List CVE-2017-7481
- GitHub Advisory GHSA-w578-j992-554x
- NVD CVE-2017-7481
- OSV PYSEC-2018-41
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.