CVE-2026-86324: Foreman: authorization flaw in the foreman::controller::useraware handling used by api::v2::sshkeyscontroller

Published Sep 7, 2026
·
Updated

A flaw was found in Foreman’s Api::V2::SshKeysController, where the target user is resolved through Foreman::Controller::UserAware#finduser using User.find(params[:userid]) without enforcing the required parent-user authorization check. An attacker with the createsshkeys permission can exploit this authorization bypass by submitting POST /api/v2/users/:userid/sshkeys with another user’s ID and injecting their own public SSH key into the targeted account. The injected key is subsequently propagated to hosts provisioned by that user, potentially allowing the attacker to authenticate to and gain SSH access to the victim’s managed hosts.

Other sources

Foreman contains an authorization flaw in the Foreman::Controller::UserAware handling used by Api::V2::SshKeysController. The controller resolves the target user through User.find(params[:userid]) without enforcing the required parent-user authorization. Consequently, a user with the createsshkeys permission can create an SSH key associated with another user accessible within the attacker's taxonomy scope.

The vulnerable endpoint is POST /api/v2/users/:userid /sshkeys. Because the target user is not validated against the caller's authorization scope before the SSH key is created, an attacker can supply another user's ID and inject their own public SSH key into that account.

The injected key is subsequently used by Foreman when provisioning hosts associated with the victim user through the sshkey provisioning snippet. This can cause the attacker's public key to be installed for the victim's managed systems, allowing the attacker to authenticate to those hosts with the corresponding private key.

Successful exploitation therefore allows a lower-privileged user with createsshkeys permission to modify another user's SSH configuration and potentially obtain SSH access to systems managed or provisioned by that user. The vulnerability results from missing authorization of the parent user before creating the child SSH-key resource.

— Red Hat

Affected Software

1 affected component
Foreman Foreman

Event History

Sep 7, 2026
Data Sourced
via Red Hat·06:27 AM
DescriptionSeverityAffected Software
Nov 12, 2026
CVE Published
via MITRE·08:19 PM
Data Sourced
via MITRE·08:19 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

What level of access does an attacker need to exploit this issue?

The attacker needs the create_ssh_keys permission. They must also be able to target another user who is accessible within the attacker’s taxonomy scope.

2

What is the practical impact after a malicious SSH key is added?

The attacker’s public key can be associated with the targeted user and propagated to hosts provisioned by that user. This may allow the attacker to authenticate to and gain SSH access to those managed hosts.

3

Which API activity is relevant when investigating possible exploitation?

Review POST requests to /api/v2/users/:user_id/ssh_keys, particularly where the user_id identifies a user other than the caller. The vulnerable behavior allows the request to associate a key with that target user without the required parent-user authorization check.

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