CVE-2017-7481
Ansible fails to properly mark lookup-plugin results as unsafe
Reported by redhat · Published July 19, 2018
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.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| ansible | Ubuntu:16.04:LTS | 2.0.0.2-2ubuntu1.3 |
| ansible_engine | redhat | 2.4.0.0, 2.3.1.0 |
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| [UNKNOWN] | ansible | ansible 2.3.1.0, ansible 2.4.0.0 |
| [UNKNOWN] | ansible | 2.3.1.0, 2.4.0.0 |
| PyPI | ansible | 2.3.0.0, 0, 2.2.0.0 |
Timeline
- May 17, 2017 CVE Published
- Apr 14, 2021 EPSS Score (30 in total, the first dated here)
- Mar 6, 2026 Distribution Patch (7 in total, the first dated here)
- Mar 6, 2026 Security Advisory (11 in total, the first dated here)
- Sep 20, 2026 CVE Updated
- Sep 28, 2026 Coalition ESS Score
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2017-7481
vulnetix vdb fixes CVE-2017-7481
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2017-7481/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart
References
- RHSA-2017:1599 vendor-advisoryx_refsource_REDHAT
- x_refsource_CONFIRM
- RHSA-2017:1334 vendor-advisoryx_refsource_REDHAT
- 98492 vdb-entryx_refsource_BID
- x_refsource_CONFIRM
- RHSA-2017:1244 vendor-advisoryx_refsource_REDHAT
- RHSA-2017:1499 vendor-advisoryx_refsource_REDHAT
- RHSA-2017:2524 vendor-advisoryx_refsource_REDHAT
- RHSA-2017:1476 vendor-advisoryx_refsource_REDHAT
- USN-4072-1 vendor-advisoryx_refsource_UBUNTU
- [debian-lts-announce] 20210127 [SECURITY] [DLA 2535-1] ansible security update mailing-listx_refsource_MLIST
- https://nvd.nist.gov/vuln/detail/CVE-2017-7481 advisory
- https://github.com/advisories/GHSA-w578-j992-554x advisory
- https://github.com/ansible/ansible/commit/fd30f5328986f9e1da434474481f32bf918a600c patch
- https://github.com/ansible/ansible/commit/f0e348f5eeb70c1fb3127d90891da43b5c0a9d29 patch
- https://github.com/ansible/ansible/commit/a1886911fcf4b691130cfc70dfc5daa5e07c46a3 patch
- https://web.archive.org/web/20170801122609/http://www.securityfocus.com/bid/98492 url
- https://usn.ubuntu.com/4072-1 url
- https://github.com/pypa/advisory-database/tree/main/vulns/ansible/PYSEC-2018-41.yaml advisory
- https://github.com/ansible/ansible url