CVE-2026-86322: Foreman: authorization flaw in the foreman::controller::useraware#find_user handling used by api::v2::personalaccesstokenscontroller

Published Sep 7, 2026
·
Updated

A flaw was found in Foreman’s Api::V2::PersonalAccessTokensController, where Foreman::Controller::UserAware#finduser resolves the target account using User.find(params[:userid]) without applying the required parent-user authorization check. An attacker with the createpersonalaccesstokens permission can therefore invoke POST /api/v2/users/:userid/personalaccesstokens with another user’s ID and create a Personal Access Token on their behalf. The resulting plaintext token is returned in the API response, while PersonalAccessToken#checkpermissionsaftersave only validates createpersonalaccesstokens on the token and does not enforce editusers authorization on the target user. The attacker can then use the forged token to authenticate as the victim, potentially resulting in complete account takeover, including administrator accounts.

Other sources

Foreman contains an authorization flaw in the Foreman::Controller::UserAware#finduser handling used by Api::V2::PersonalAccessTokensController. The controller resolves the target account directly with User.find(params[:userid]) without enforcing the parent-user authorization that normally restricts access to the target user. As a result, a user who has the createpersonalaccesstokens permission can create a Personal Access Token for another user whose account is accessible by ID within the user's taxonomy scope.

The vulnerable endpoint is POST /api/v2/users/:userid/personalaccesstokens. During token creation, the controller builds the Personal Access Token from the attacker-supplied userid and returns the plaintext token value in the API response.

The PersonalAccessToken#checkpermissionsaftersave model validation does not prevent this cross-user operation: when the token belongs to another user, it verifies the createpersonalaccesstokens permission on the token itself but does not require editusers authorization on the target user.

An attacker with the required createpersonalaccesstokens permission can therefore forge a valid PAT belonging to another user and subsequently authenticate as that user using the generated token. This can result in complete account takeover, including takeover of administrator accounts that are visible within the attacker's taxonomy scope.

— 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 access does an attacker need to exploit this issue?

The attacker needs an account with the create_personal_access_tokens permission. No user interaction is required, and the affected API endpoint is reachable over the network.

2

Can an attacker create tokens for users they would not normally be allowed to manage?

Yes. The affected request does not apply the required authorization check on the target user, so an attacker can supply another user’s ID when creating a personal access token.

3

What is the impact after a forged token is created?

The plaintext token is returned in the API response, allowing the attacker to authenticate as the targeted user. Targeting an administrator account could result in complete administrator account takeover.

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