CVE-2017-7481: Input Validation
Ansible before versions 2.1.6.0, 2.2.3.0, 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.
Other sources
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.
— Launchpad
Jason McKerr of Red Hat reports:
Data returned in lookup() variables is not marked as unsafe and could result in unicode strings being passed through to the jinja2 templating system.
— Red Hat
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
redhat/ansibleto a version that resolves this vulnerability.Fixed in 2.3.1.0 - Upgrade
Upgrade
redhat/ansibleto a version that resolves this vulnerability.Fixed in 2.4.0.0 - Upgrade
Upgrade
pip/ansibleto a version that resolves this vulnerability.Fixed in 2.2.3.0 - Upgrade
Upgrade
pip/ansibleto a version that resolves this vulnerability.Fixed in 2.1.6.0 - Upgrade
Upgrade
pip/ansibleto a version that resolves this vulnerability.Fixed in 2.3.1.0 - Upgrade
Upgrade
debian/ansibleto a version that resolves this vulnerability.Fixed in 2.10.7+merged+base+2.10.17+dfsg-0+deb11u1Fixed in 2.10.7+merged+base+2.10.17+dfsg-0+deb11u4Fixed in 7.7.0+dfsg-3+deb12u1Fixed in 12.0.0+dfsg-0+deb13u1Fixed in 13.4.0+dfsg-1 - Upgrade
Upgrade
Ansibleto a version that resolves this vulnerability.Fixed in 2.1.6.0
Event History
Frequently Asked Questions
What is CVE-2017-7481?
CVE-2017-7481 is a vulnerability in Ansible before versions 2.3.1.0 and 2.4.0.0 that allows an attacker to execute code by injecting Unicode strings in the jinja2 templating system through certain lookup() calls.
How severe is CVE-2017-7481?
CVE-2017-7481 has a severity rating of 9.8 (critical).
Which versions of Ansible are affected by CVE-2017-7481?
Ansible versions before 2.3.1.0 and 2.4.0.0 are affected by CVE-2017-7481.
How can I fix CVE-2017-7481?
To fix CVE-2017-7481, upgrade to Ansible version 2.3.1.0 or 2.4.0.0.
Where can I find more information about CVE-2017-7481?
You can find more information about CVE-2017-7481 at the following references: [NIST NVD](https://nvd.nist.gov/vuln/detail/CVE-2017-7481), [GitHub Advisory](https://github.com/advisories/GHSA-w578-j992-554x), [Ansible Commit](https://github.com/ansible/ansible/commit/a1886911fcf4b691130cfc70dfc5daa5e07c46a3).