KeygraphLabs · CVE MCP

CVE-2017-7481 · redhat

CVE-2017-7481

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.

Published 2018-07-19, last changed 2026-06-17. Weakness: CWE-20.

CVSS
9.8
critical, from NVD
EPSS
4.58%
percentile 91.9%, chance of exploitation in 30 days
Exploitation
None known
no KEV listing or public exploit in our indexes

How to fix

Upgrade to a fixed version: ansible 2.1.6.0, 2.2.3.0, 2.3.1.0, 2.4.0.0 (PyPI) (each is the fix for its own release line). For the version that clears every advisory for your installed version, ask an agent for get_remediation.

Where the flaw is in the code

Fixed in ansible/ansible by ed56f51f18, fd30f53289, f0e348f5ee. Functions changed by the fix: __init__, _lookup, do_template, _do_template. Confidence: verified (a record names this commit as the fix, and it changed these functions).

Timeline

2018-07-19Published
2018-07-19Package advisory PYSEC-2018-41
2018-09-06Package advisory GHSA-w578-j992-554x
2026-06-17Record last changed
2026-11-30EPSS when our history starts: 4.58%
2026-12-02Code-level analysis added

Affected packages

AdvisoryPackageFixed in
GHSA-w578-j992-554xansible (PyPI)2.3.1.0
GHSA-w578-j992-554xansible (PyPI)2.1.6.0
GHSA-w578-j992-554xansible (PyPI)2.2.3.0
PYSEC-2018-41ansible (PyPI)2.3.1.0, 2.4.0.0

Also known as: GHSA-w578-j992-554x, PYSEC-2018-41

Related

CVEPublishedCVSSSummary
CVE-2025-140102025-12-045.5Ansible-collection-community-general: ansible-collection-community-general: keycloak user module leaks credentials in verbose output
CVE-2023-51152023-12-186.3Ansible: malicious role archive can cause ansible-galaxy to overwrite arbitrary files
CVE-2022-36972022-10-287.5same package: ansible (PyPI)
CVE-2021-201802022-03-165.5same package: ansible (PyPI)
CVE-2021-36202022-03-035.5same package: ansible (PyPI)
CVE-2021-35832021-09-227.1same package: ansible (PyPI)
CVE-2020-107292021-05-275.5same package: ansible (PyPI)
CVE-2021-201912021-05-265.5same package: ansible (PyPI)

Add it to your agent

One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.

claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp

Then ask for triage_cve CVE-2017-7481, or call /api/v1/vulnerabilities/CVE-2017-7481. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.

NVD · CVE.org