CVE-2026-12398: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Red Hat Red Hat Ansible Automation Platform 2
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.
AI Analysis
Technical Summary
This vulnerability involves improper neutralization of special elements used in OS commands within the galaxy_ng component of Red Hat Ansible Automation Platform 2. Specifically, the do_git_checkout() function in the legacy role import API (v1) uses subprocess.run() with shell=True to execute shell commands that include git ref names (branch or tag names) without sanitization. An authenticated attacker who controls a git repository can craft branch or tag names containing shell metacharacters to execute arbitrary code remotely on the pulp worker. The vulnerable functionality is only accessible if the GALAXY_ENABLE_LEGACY_ROLES configuration is set to True, which is not the default setting.
Potential Impact
Successful exploitation allows an authenticated user with control over a git repository to achieve remote code execution on the pulp worker component of Red Hat Ansible Automation Platform 2. This can lead to full compromise of the affected system, impacting confidentiality, integrity, and availability. The CVSS v3.1 base score is 7.5 (High), reflecting network attack vector, high impact on confidentiality, integrity, and availability, but requiring low privileges and high attack complexity.
Mitigation Recommendations
The vendor advisory does not explicitly state the availability of a patch or official fix at this time. Patch status is not yet confirmed — check the Red Hat advisory at https://access.redhat.com/security/cve/CVE-2026-12398 for current remediation guidance. Mitigation includes ensuring that the GALAXY_ENABLE_LEGACY_ROLES setting remains disabled (the default), which prevents access to the vulnerable endpoint. Avoid enabling legacy roles unless necessary and monitor vendor updates for patches or official fixes.
CVE-2026-12398: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') in Red Hat Red Hat Ansible Automation Platform 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.
CVSS v3.1
Score 7.5high
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
This vulnerability involves improper neutralization of special elements used in OS commands within the galaxy_ng component of Red Hat Ansible Automation Platform 2. Specifically, the do_git_checkout() function in the legacy role import API (v1) uses subprocess.run() with shell=True to execute shell commands that include git ref names (branch or tag names) without sanitization. An authenticated attacker who controls a git repository can craft branch or tag names containing shell metacharacters to execute arbitrary code remotely on the pulp worker. The vulnerable functionality is only accessible if the GALAXY_ENABLE_LEGACY_ROLES configuration is set to True, which is not the default setting.
Potential Impact
Successful exploitation allows an authenticated user with control over a git repository to achieve remote code execution on the pulp worker component of Red Hat Ansible Automation Platform 2. This can lead to full compromise of the affected system, impacting confidentiality, integrity, and availability. The CVSS v3.1 base score is 7.5 (High), reflecting network attack vector, high impact on confidentiality, integrity, and availability, but requiring low privileges and high attack complexity.
Mitigation Recommendations
The vendor advisory does not explicitly state the availability of a patch or official fix at this time. Patch status is not yet confirmed — check the Red Hat advisory at https://access.redhat.com/security/cve/CVE-2026-12398 for current remediation guidance. Mitigation includes ensuring that the GALAXY_ENABLE_LEGACY_ROLES setting remains disabled (the default), which prevents access to the vulnerable endpoint. Avoid enabling legacy roles unless necessary and monitor vendor updates for patches or official fixes.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- redhat
- Date Reserved
- 2026-06-16T13:22:54.012Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
- Vendor Advisory Urls
- [{"url":"https://access.redhat.com/security/cve/CVE-2026-12398","vendor":"Red Hat"}]
Threat ID: 6a31650b0b89be6888c92022
Added to database: 06/16/2026, 15:00:27 UTC
Last enriched: 07/03/2026, 22:21:35 UTC
Last updated: 08/01/2026, 07:17:58 UTC
Views: 95
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.