CVE-2026-71465 in Ansible Automation Platforminfo

Summary

by MITRE • 09/23/2026

RunAdHocCommand.build_args() appends limit as bare positional (args.append(limit)) instead of using args.extend(['-l', limit]) like RunJob. A limit beginning
with - is parsed as an ansible CLI option. Currently limited to short-circuit flags (--version, --help) since injected element displaces required pattern positional. Would escalate if ansible-core ever defaults pattern.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 09/23/2026

The vulnerability identified in the RunAdHocCommand.build_args() function represents a critical input validation and argument parsing flaw within Ansible automation frameworks. This issue stems from an inconsistent implementation of command-line argument construction compared to other components such as RunJob. Specifically, when constructing the execution arguments for ad-hoc commands, the system appends the limit parameter directly as a bare positional argument using args.append(limit). In contrast, standard practices and implementations like those in RunJob utilize args.extend(['-l', limit]) to explicitly define the flag and its associated value. This discrepancy creates a significant security gap because it fails to properly isolate user-supplied input from command-line options, allowing for potential injection attacks if the input is not strictly validated against expected formats.

The operational impact of this flaw is primarily observed through argument parsing anomalies that can lead to unexpected behavior or denial of service conditions. When an attacker provides a limit value that begins with a hyphen, such as -version or --help, the underlying Ansible CLI parser interprets this input not as data but as a command-line flag. Because the injected element displaces required positional arguments like pattern, it causes immediate short-circuiting of normal execution flow. The system may exit prematurely by displaying version information or help text instead of executing the intended administrative task. This behavior effectively disrupts service availability and can be exploited to interfere with automated workflows that rely on predictable command outputs for subsequent processing steps.

From a threat modeling perspective, this vulnerability aligns with CWE-78 Improper Neutralization of Special Elements used in an OS Command, specifically regarding argument injection. The lack of proper quoting or flag separation allows external input to alter the interpretation of system commands. Furthermore, this behavior can be mapped to MITRE ATT&CK techniques related to command and script interception or execution manipulation, where an attacker influences the parameters passed to a legitimate process to achieve unintended outcomes. While current exploitation is limited to short-circuit flags due to the displacement of required positional arguments, the risk profile escalates significantly if future versions of ansible-core change default behaviors regarding pattern handling. If patterns become optional by default, attackers could potentially inject arbitrary commands or options that execute with elevated privileges, leading to remote code execution or privilege escalation scenarios depending on the context in which Ansible is running.

Mitigation strategies must focus on enforcing strict input validation and standardizing argument construction across all command-building modules. Developers should immediately refactor RunAdHocCommand.build_args() to mirror the secure implementation found in RunJob by using args.extend(['-l', limit]) or equivalent explicit flag-value pairing mechanisms. This ensures that user-supplied limits are always treated as data values rather than executable flags regardless of their content. Additionally, implementing rigorous input sanitization checks that reject any strings beginning with hyphens before they reach the argument builder is essential. Security teams should also review other areas of the codebase for similar inconsistencies in how external inputs are passed to subprocesses or CLI tools to prevent analogous injection vectors from being exploited elsewhere in the automation pipeline.

Responsible

Redhat

Reservation

08/06/2026

Disclosure

09/23/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Do you want to use VulDB in your project?

Use the official API to access entries easily!