REDHAT-BUG-2535942: Medium severity foreman_remote_execution vulnerability

Published Sep 17, 2026
·
Updated

The showtemplateinvocationbyhost action in TemplateInvocationsController resolves the job invocation via JobInvocation.find(params[:id]) and the host via Host.find(params[:hostid]) without performing an object-level authorization check against the caller's viewjobinvocations permission filter. The controller-level beforeaction :authorize checks only that the caller holds a viewjobinvocations permission covering the controller action; it does not evaluate the permission's search filter against the specific record. The sibling show action in the same controller explicitly performs User.current.can?(:viewjobinvocations, @templateinvocation.jobinvocation), which is the object-level form.

JobInvocation includes Authorizable but not Taxonomix and has no taxonomy default scope, so the job invocation ID is unconstrained. Host::Base carries defaultscope -> { where(taxonomyconditions) }, which limits host lookup to the caller's organizations. The attacker must supply a hostid within their organizations that was targeted by the job invocation.

The action returns live output (stdout/stderr), the rendered script preview, template input values (hidden values are masked via inputsafevalue), task details, and host/proxy information.

The V2 API controller has a related gap: the output and rawoutput actions in Api::V2::JobInvocationsController resolve the JobInvocation via findoptionalnestedobject (bare find) rather than findresource (which applies authorized(:viewjobinvocations)). The host IS properly scoped via authorized(:viewhosts), so the V2 gap is bounded by host authorization.

Introduced in foremanremoteexecution v15.0.0 by commit 45bd8b894424c9316516001fa0c44a0cedd70a2b (MariaAga, 2025-01-24, Fixes #38123, "add template invocation info to new job details"). The sibling show action has had the object-level User.current.can? check since 2016 (commit d194bf0, Fixes #13287). The new action added in 2025 did not replicate the check. All versions from v15.0.0 through v18.0.0 (current HEAD) are affected.

Affected Software

1 affected component
foreman_remote_execution>=15.0.0<=18.0.0

Event History

Sep 17, 2026
Data Sourced
via Red Hat·11:18 AM
DescriptionSeverityAffected Software

Frequently Asked Questions

1

What access and conditions are required to retrieve another job invocation's details?

The caller must have permission to access the controller action and must provide a host_id for a host in their organizations that was targeted by the job invocation. The job invocation ID itself is not constrained by the caller's organizations or by the permission's object-level search filter.

2

What information can the affected action disclose?

The action returns live job output, including stdout and stderr, along with the rendered script preview and template input values. Hidden input values are masked.

3

Does the host organization restriction prevent cross-organization job invocation access?

No. The host lookup is limited to the caller's organizations, but the job invocation lookup is not taxonomy-scoped and does not perform the required object-level authorization check. A qualifying in-organization host targeted by the invocation is still required.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203