# CVE-2026-12540: Foreman command injection in errors:fetch_log via request_id parameter

Source: https://junglewise.ai/threats/cve-2026-12540-a-flaw-was-found-in-foreman-a-command-injection-vulnerability  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-10-01. Updated: 2026-10-05  
License: CC BY 4.0 with a link back

CVE-2026-12540 · Severity: high · CVSS 8.2 · Published 2026-10-01

Foreman is an open-source system management platform used to provision and configure enterprise infrastructure. A command injection vulnerability in the foreman-rake errors:fetch_log task allows users with administrative privileges to execute arbitrary system commands by injecting shell metacharacters into the request_id parameter, potentially compromising the entire managed infrastructure.

Technologies: [Red Hat Foreman](https://junglewise.ai/threats/technologies/red-hat-foreman). Vendors: [Red Hat](https://junglewise.ai/threats/vendors/red-hat).

## Quick answers

**Is CVE-2026-12540 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-12540 being exploited in the wild.

**How severe is CVE-2026-12540?** High severity, with a CVSS score of 8.2, published 1 October 2026.

**Which products and versions are affected?** Red Hat Foreman.

**Is there a fix for CVE-2026-12540?** No fixed version is recorded yet. Check the vendor's advisory in the references below. If you run it, Junglewise drafts a mitigation that fits your setup and applies it once you approve, with senior security engineers behind it.

**How is CVE-2026-12540 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-12540?** Check whether you run Red Hat Foreman. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The foreman-rake errors:fetch_log task passes the request_id parameter unsafely to a system command (typically grep) without proper shell escaping, allowing command injection via shell metacharacters such as semicolons, pipes, and quotes. An attacker with sudo permissions to run this rake task can break out of the intended log-fetching command and execute arbitrary code with the privileges of the Foreman process. This is a remote code execution vector for privileged users or local attackers with task execution access.

## Affected products

- Red Hat Foreman

## Timeline

- 2026-10-01: disclosed

## References

- [https://access.redhat.com/downloads/content/package-browser/](https://access.redhat.com/downloads/content/package-browser/)
- [https://access.redhat.com/errata/RHSA-2026:74503](https://access.redhat.com/errata/RHSA-2026:74503)

## Related threats

- [Foreman authorization bypass in personal access token creation](https://junglewise.ai/threats/cve-2026-86322-a-flaw-was-found-in-foreman-s-api-v2)
- [Foreman incorrect authorization in network interface API](https://junglewise.ai/threats/cve-2026-107203-an-incorrect-authorization-flaw-has-been-found-in-network)
- [Foreman permission filter authorization bypass](https://junglewise.ai/threats/cve-2026-107193-a-flaw-has-been-found-in-permission-filters-in-the-foreman)
- [Foreman foreman-tail command injection via eval](https://junglewise.ai/threats/cve-2026-12542-a-flaw-was-found-in-foreman-the-foreman-tail-utility-is)
- [Foreman template preview SSTI and credential disclosure](https://junglewise.ai/threats/cve-2026-96659-a-flaw-was-found-in-foreman-this-vulnerability-allows-an)
