Quantum Secular Labs / Blog / Advisories

CVE-2017-7481: Ansible: Code execution

CVE-2017-7481 is rated critical with a CVSS v3.1 base score of 9.8 and NVD lists 9 affected products, including Red Hat Openshift Container Platform. Per its scoring, it can be exploited over the network, without authentication, without any user interaction. The scored impact on confidentiality, integrity and availability is the highest available.

Vulnerability 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.

Severity breakdown

CVSS v3.1 9.8: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

  • Attack vector: Network. Exploitable remotely over the network, with no need for local or physical access.
  • Attack complexity: Low. No special conditions; the attack can be repeated reliably.
  • Privileges required: None. No account or prior access is needed.
  • User interaction: None. No action from any user is needed.
  • Scope: Unchanged. Impact stays within the vulnerable component.
  • Confidentiality impact: High. Total loss of confidentiality; sensitive data can be fully disclosed.
  • Integrity impact: High. Total loss of integrity; data or system state can be fully modified.
  • Availability impact: High. Total loss of availability; the component can be shut down.

Underlying weakness

CWE-20: Improper Input Validation

The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.

Affected products

  • Red Hat Openshift Container Platform: 3.3; 3.4; 3.5
  • Red Hat Openstack: 10; 11
  • Red Hat Storage Console: 2.0
  • Red Hat Virtualization: 4.1
  • Red Hat Virtualization Manager: 4.1
  • Red Hat Gluster Storage: 3.2
  • Red Hat Ansible Engine: before 2.3.1.0; from 2.3.2.0 before 2.4.0.0
  • Canonical Ubuntu Linux: 16.04; 18.04; 19.04
  • Debian Linux: 9.0

References