# CVE-2026-12398: Galaxy_ng: shell injection in legacy role import via unsanitized git ref names

- Severity: High 7.5 (CVSS:3.1, scored by redhat) `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.89%, higher than 60% of CVEs (2026-12-01)
- Published: 2026-06-16T14:52:06.734Z
- Modified: 2026-11-05T17:02:37.551Z
- Also known as: GHSA-6hw7-j4jw-wpff, PYSEC-2026-2486
- Weaknesses: CWE-78
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: redhat

## Description

A command injection vulnerability was found in galaxy_ng. The do_git_checkout() function in the legacy role import API (v1) interpolates unsanitized git ref names (branch/tag names) into shell commands executed via subprocess.run() with shell=True. An authenticated user who controls a git repository can create a branch or tag with shell metacharacters in the name to achieve remote code execution on the pulp worker. The vulnerable endpoint is only reachable when GALAXY_ENABLE_LEGACY_ROLES is set to True, which is not the default configuration.

(As written by CVE List.)

## Affected

- ansible-automation-platform-24/hub-rhel8: no versions given
- ansible-automation-platform-25/hub-rhel8: no versions given
- ansible-automation-platform-26/hub-rhel9: no versions given
- ansible-automation-platform-27/hub-rhel9: no versions given
- automation-hub: no versions given
- python3.11-galaxy-ng: no versions given
- python3.12-galaxy-ng: no versions given
- python3x-galaxy-ng: no versions given
- python-galaxy-ng: no versions given
- galaxy-ng (PyPI): up to 4.9.2

## Every score

- redhat: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- GitHub: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://access.redhat.com/security/cve/CVE-2026-12398> (vdb-entry, web)
- <https://bugzilla.redhat.com/show_bug.cgi?id=2489180> (issue-tracking, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-12398> (advisory)
- <https://github.com/ansible/galaxy_ng> (package)
- <https://pypi.org/project/galaxy-ng> (package)
- <https://github.com/advisories/GHSA-6hw7-j4jw-wpff> (advisory)

## Sources

- CVE List: [CVE-2026-12398](https://www.cve.org/CVERecord?id=CVE-2026-12398), CVE Terms of Use, modified 2026-11-05
- GitHub Advisory Database: [GHSA-6hw7-j4jw-wpff](https://github.com/advisories/GHSA-6hw7-j4jw-wpff), CC-BY-4.0, modified 2026-07-13
- NVD: [CVE-2026-12398](https://nvd.nist.gov/vuln/detail/CVE-2026-12398), Public domain, modified 2026-10-25
- PyPA Advisory Database: [PYSEC-2026-2486](https://osv.dev/vulnerability/PYSEC-2026-2486), CC-BY-4.0, modified 2026-07-13

---

Page: https://cve.day/CVE-2026-12398 · Whole record: https://cve.day/CVE-2026-12398.json · Rebuilt by cve.day 2026-11-25T22:59:24.757Z
