CVE-2026-12398: Command Injection in galaxy_ng Legacy Role Import API
A command injection flaw in galaxy_ng allows authenticated users to execute arbitrary code on pulp worker systems. The vulnerability exists in the legacy role import API, where unvalidated git branch or tag names are passed directly into shell commands. An attacker who controls a git repository can craft malicious branch or tag names containing shell metacharacters to gain remote code execution. The attack requires authentication and is only possible when legacy role support is explicitly enabled in the configuration.
Source data · NVD / CISA · public domain
- 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
- Weaknesses (CWE)
- CWE-78
- Affected products
- 0 configuration(s)
- Published / Modified
- 2026-06-16 / 2026-06-29
NVD description (verbatim)
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.
2 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
CVE-2026-12398 is a command injection vulnerability in the do_git_checkout() function within galaxy_ng's legacy role import API (v1). The function fails to sanitize git ref names (branches and tags) before interpolating them into shell commands executed via subprocess.run() with shell=True. This allows an authenticated attacker controlling a git repository to inject arbitrary shell commands by creating branches or tags with metacharacter payloads. The vulnerability is only reachable when GALAXY_ENABLE_LEGACY_ROLES is set to True, which is not the default configuration. The attack surface is restricted to authenticated users, but the impact is severe—remote code execution on pulp worker processes.
Business impact
Successful exploitation enables an authenticated attacker to execute arbitrary code with the privileges of the pulp worker process. In production environments, this could lead to data exfiltration, lateral movement, compromise of artifact repositories, or disruption of CI/CD pipelines that depend on galaxy_ng for role distribution. Organizations using galaxy_ng as a central artifact repository face heightened risk if legacy role imports are enabled. The authentication requirement provides some protection, but compromised or malicious insider accounts can weaponize this flaw. The impact severity (HIGH) reflects the combination of remote code execution capability and potential access to sensitive build and deployment workflows.
Affected systems
galaxy_ng installations with GALAXY_ENABLE_LEGACY_ROLES explicitly set to True are vulnerable. The default configuration does not enable legacy roles, so many deployments may be unaffected. However, organizations maintaining backwards compatibility with older role import workflows or those migrating from legacy systems are at risk. The vulnerability targets the pulp worker process, so any system running galaxy_ng with legacy role import enabled and accepting connections from untrusted git repositories should be considered affected. Verify your galaxy_ng configuration to determine if legacy roles are enabled.
Exploitability
Exploitation requires authentication and control over a git repository whose roles are imported via the legacy API. The attacker must create a crafted branch or tag name containing shell metacharacters (e.g., backticks, semicolons, pipes) that will be injected into the git checkout command. Once a user or automated process imports a role from this repository, the malicious payload executes on the pulp worker. The attack complexity is moderate—the attacker must understand the injection point and craft a valid payload, but no user interaction or special network conditions are required beyond authentication. The barrier to entry is relatively low for an insider or a user with repository control.
Remediation
Immediately audit your galaxy_ng configuration to determine whether GALAXY_ENABLE_LEGACY_ROLES is set to True. If legacy role imports are not required, disable this feature. If legacy support must be maintained, apply the security patch released for this vulnerability as soon as testing permits. The fix should sanitize git ref names before shell interpolation, likely by using parameterized subprocess calls or shell escaping. Review git import sources and restrict role imports to trusted, internally-managed repositories. Consider implementing network segmentation to limit pulp worker exposure and monitor worker processes for unexpected command execution.
Patch guidance
Consult the galaxy_ng project advisory and security releases for patched versions addressing CVE-2026-12398. Apply patches to all galaxy_ng instances, prioritizing those with GALAXY_ENABLE_LEGACY_ROLES enabled. Test patches in a staging environment to ensure no regression in legacy role import functionality before production deployment. If patching is delayed, disable legacy role support as an interim control. Verify the patch by confirming that git ref names containing metacharacters no longer result in command injection.
Detection guidance
Monitor pulp worker logs for subprocess execution of unexpected commands or error messages related to malformed git ref names. Look for audit logs indicating role import attempts from repositories with suspicious branch or tag names containing special characters. Network monitoring can flag unusual outbound connections from pulp worker processes that may indicate post-exploitation activity. Endpoint detection and response (EDR) tools should alert on any subprocess spawning from the galaxy_ng or pulp worker process with shell metacharacters in the command line. Review git repository branches and tags for anomalous names created by users without legitimate development roles.
Why prioritize this
This vulnerability merits immediate attention due to its HIGH CVSS score (7.5), the remote code execution impact, and its relevance to artifact supply chain security. Although the default configuration does not enable legacy roles, any deployment with legacy role support active faces a direct code execution risk. The authentication requirement is a mitigating factor, but the low complexity of exploitation and the criticality of pulp worker integrity justify rapid patching and configuration review. Organizations should treat this as a priority based on their actual enablement of legacy roles and the sensitivity of their artifact repositories.
Risk score, explained
The CVSS v3.1 score of 7.5 (HIGH) reflects: Attack Vector Network (code execution across the network via git imports), Access Complexity High (attacker must craft a specific payload and control a repository), Privilege Level Local (authentication required), User Interaction None (no user action needed once authenticated), Scope Unchanged (impact is limited to the pulp worker), and Confidentiality/Integrity/Availability all High (arbitrary code execution grants all three impacts). The score appropriately captures a severe remote code execution risk moderated by the authentication requirement and non-default configuration. Organizations with legacy roles enabled should treat this as effectively CRITICAL in their risk context.
Frequently asked questions
Is my galaxy_ng deployment affected if I have not explicitly enabled GALAXY_ENABLE_LEGACY_ROLES?
No. Legacy role support is disabled by default. Check your galaxy_ng configuration file or environment variables for GALAXY_ENABLE_LEGACY_ROLES=True. If this setting is absent or set to False, your deployment is not exposed to this vulnerability via the legacy API endpoint.
Can this vulnerability be exploited without authentication?
No. The vulnerability requires a valid authenticated user account. This limits the attack surface to insiders, compromised accounts, or users with legitimate access. However, the bar for exploitation is low—any authenticated user who can control a git repository can craft the malicious payload.
What should we do if we need legacy role imports but cannot patch immediately?
Disable GALAXY_ENABLE_LEGACY_ROLES and migrate role imports to the current API version if possible. If migration is not feasible, implement strict network segmentation around pulp workers, restrict git repository sources to a whitelist of internal/trusted systems, and require strong authentication with monitoring. Apply the patch as soon as your testing schedule allows.
How can we detect if this vulnerability has been exploited in our environment?
Review pulp worker logs for unexpected subprocess execution, particularly around git checkout operations. Check for git branches or tags with unusual names containing shell metacharacters. Use EDR or log aggregation tools to flag any shell command execution originating from galaxy_ng or pulp worker processes with suspicious payloads. Audit repository access logs for any role imports from unexpected sources.
This analysis is based on vulnerability data current as of the publication date. Patch versions, vendor advisories, and remediation timelines should be verified directly with the galaxy_ng project and your own vendor documentation. This assessment does not constitute legal or compliance advice. Organizations should conduct their own risk assessment based on their specific configuration, network environment, and threat model. No exploit code or weaponized proof-of-concept is provided; security research should be conducted responsibly and within applicable laws. Source: NVD (public-domain), retrieved 2026-07-23. Analysis generated by SEC.co (claude-haiku-4-5).
Weaknesses (CWE)
Related vulnerabilities
- CVE-2025-41265HIGHWaterfall WF-500 TX Host OS Command Injection (CVSS 7.2)
- CVE-2025-41266HIGHWaterfall WF-500 TX Host Command Injection Vulnerability Analysis
- CVE-2025-41267HIGHWaterfall WF-500 TX Host Command Injection Vulnerability
- CVE-2025-41279HIGHOS Command Injection in Waterfall WF-500 RX Host Administration WebUI
- CVE-2025-41281HIGHWaterfall WF-500 OS Command Injection
- CVE-2025-66273HIGHQNAP Command Injection in QTS and QuTS hero
- CVE-2025-66279HIGHQNAP NAS Command Injection – Admin Authentication Required, HIGH Severity
- CVE-2025-69755HIGHNeterbit NW-431F Router RCE and Data Exposure Vulnerability