# CVE-2019-14905: Externally Controlled Reference to a Resource in Another Sphere, Improper Input Validation, and External Control of File Name or Path in Ansible

> Attackers can inject OS commands via the filename parameter in Ansible's nxos_file_copy module, leading to code execution and data exposure on NXOS devices.

- **Severity:** High 7.3 (`CVSS:3.0/AV:L/AC:L/PR:H/UI:N/S:C/C:H/I:L/A:L`)
- **Exploited in the wild:** Not known
- **Login needed:** An administrator
- **Attackable:** Local or same network only
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 31 Mar 2020
- **Updated:** 5 Aug 2024
- **Also known as:** ALPINE-CVE-2019-14905, DEBIAN-CVE-2019-14905, GHSA-frxj-5j27-f8rf, PYSEC-2020-206, UBUNTU-CVE-2019-14905

## What is CVE-2019-14905?

CVE-2019-14905 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 31 Mar 2020. It can only be exploited from the same machine or local network, with no action from the victim.

### Official description

A vulnerability was found in Ansible Engine versions 2.9.x before 2.9.3, 2.8.x before 2.8.8, 2.7.x before 2.7.16 and earlier, where in Ansible's nxos_file_copy module can be used to copy files to a flash or bootflash on NXOS devices. Malicious code could craft the filename parameter to perform OS command injections. This could result in a loss of confidentiality of the system among other issues.

Weakness: CWE-668 (Exposure of Resource to Wrong Sphere), CWE-73 (External Control of File Name or Path), CWE-20 (Improper Input Validation)

## Which versions are affected by CVE-2019-14905?

7 open source packages ship an affected version, including ansible. It affects 8 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `ansible` | PyPI | From 2.7.0 | 2.7.16, 2.8.8, 2.9.3 |
| `ansible` | PyPI | From 2.7.0a1 | 2.7.16 |
| `ansible` | PyPI | From 2.7.0a1 | 2.7.16 |
| `ansible` | PyPI | From 2.8.0a1 | 2.8.8 |
| `ansible` | PyPI | From 2.8.0a1 | 2.8.8 |
| `ansible` | PyPI | From 2.9.0a1 | 2.9.3 |
| `ansible` | PyPI | From 2.9.0a1 | 2.9.3 |

Products: Fedoraproject Fedora, Opensuse Backports Sle, Opensuse Leap, Redhat Ansible Engine, Redhat Ansible Tower, Redhat Ceph Storage, Redhat Cloudforms Management Engine, Redhat Openstack.

## How do I fix CVE-2019-14905?

Upgrade ansible to a fixed version for your release line: 2.7.16, 2.8.8 or 2.9.3.

## Is CVE-2019-14905 being exploited?

There is no known exploitation of CVE-2019-14905 in the wild and no public exploit code.

## Other vulnerabilities in Fedoraproject Fedora

- [CVE-2024-4577](https://insights.sbomify.com/CVE-2024-4577/): PHP-CGI OS Command Injection (critical 9.8, exploited in the wild)
- [CVE-2021-39226](https://insights.sbomify.com/CVE-2021-39226/): Grafana Authentication Bypass (critical 9.8, exploited in the wild)
- [CVE-2019-5544](https://insights.sbomify.com/CVE-2019-5544/): VMware ESXi and Horizon DaaS OpenSLP Heap-Based Buffer Overflow (critical 9.8, exploited in the wild)
- [CVE-2024-4947](https://insights.sbomify.com/CVE-2024-4947/): Google Chromium V8 Type Confusion (critical 9.6, exploited in the wild)
- [CVE-2024-4671](https://insights.sbomify.com/CVE-2024-4671/): Google Chromium Visuals Use-After-Free (critical 9.6, exploited in the wild)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2019-14905 and fix it if it is affected.

What it is: CVE-2019-14905 is a high-severity command injection vulnerability in Fedoraproject Fedora, published on 31 Mar 2020. It can only be exploited from the same machine or local network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2019-14905 in the wild and no public exploit code.

Affected packages and fixed versions:
- ansible (PyPI): affected from 2.7.0; fixed in 2.7.16, 2.8.8, 2.9.3
- ansible (PyPI): affected from 2.7.0a1; fixed in 2.7.16
- ansible (PyPI): affected from 2.7.0a1; fixed in 2.7.16
- ansible (PyPI): affected from 2.8.0a1; fixed in 2.8.8
- ansible (PyPI): affected from 2.8.0a1; fixed in 2.8.8
- ansible (PyPI): affected from 2.9.0a1; fixed in 2.9.3
- ansible (PyPI): affected from 2.9.0a1; fixed in 2.9.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2019-14905/ (Markdown: https://insights.sbomify.com/CVE-2019-14905/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2019-14905
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2019-14905
- OSV: https://osv.dev/vulnerability/CVE-2019-14905

---
From sbomify Insights: https://insights.sbomify.com/CVE-2019-14905/
Summaries are generated and may contain mistakes; the official description above is the record.
