REDHAT-BUG-2489180: Command Injection
A command injection vulnerability was found in galaxyng's legacy role import functionality. The dogitcheckout() function in galaxyng/app/api/v1/tasks.py constructs shell commands via f-string interpolation using unsanitized git ref names (branch/tag names from the githubreference parameter) and executes them with subprocess.run(cmd, shell=True). An authenticated user who controls a git repository can create a branch or tag with shell metacharacters (such as ;, |, $(), &, >) in the name, and when the legacy role import processes this reference, the shell metacharacters are interpreted by the shell, achieving remote code execution on the pulp worker process.
The vulnerability requires GALAXYENABLELEGACYROLES to be set to True, which is NOT the default configuration in any shipped version of Red Hat Ansible Automation Platform (2.4 through 2.6). When this setting is False (the default), the v1 API routes are not registered in Django URL routing and the vulnerable endpoint returns 404. However, any deployment that explicitly enables legacy role support (e.g., community-galaxy profile or custom configurations) is exposed to authenticated RCE.
A secondary vector exists via the alternatecloneurl parameter, which accepts arbitrary URLs with no validation (enabling SSRF), though the git clone operation on that path uses shell=False, preventing shell injection via that specific parameter.
Affected Software
Event History
Frequently Asked Questions
What is the severity of REDHAT-BUG-2489180?
The severity of REDHAT-BUG-2489180 is medium with a rating of 4.
What is the description of REDHAT-BUG-2489180?
REDHAT-BUG-2489180 describes a command injection vulnerability found in galaxy_ng's legacy role import functionality.
How do I fix REDHAT-BUG-2489180?
To fix REDHAT-BUG-2489180, ensure that git ref names are properly sanitized before use in shell commands.
What software is affected by REDHAT-BUG-2489180?
The software affected by REDHAT-BUG-2489180 includes galaxy_ng and Red Hat Ansible Automation Platform.
What type of vulnerability is REDHAT-BUG-2489180 classified under?
REDHAT-BUG-2489180 is classified under Command Injection and SSRF.