CVE-2026-86323: Foreman: authorization flaw in the mail-notification endpoints implemented by api::v2::mailnotificationscontroller
A flaw was found in Foreman’s Api::V2::MailNotificationsController, where authorization checks on user-specific mail-notification resources are insufficient. The GET /api/v2/users/:id/mailnotifications endpoint resolves the target account using User.find(params[:id]) without verifying that the authenticated user is authorized to access that user’s notification configuration. Additionally, the POST and PUT /api/v2/users/:userid/mailnotifications paths call denyaccess when the requester is unauthorized but fail to halt execution, allowing the request to continue and persist the unauthorized change despite a 403 response or subsequent DoubleRenderError. This can allow a user to disclose another user’s mail-notification configuration, including mailquery values, and, where write permissions apply, modify or create notification settings for another user.
Other sources
Foreman contains an authorization flaw in the mail-notification endpoints implemented by Api::V2::MailNotificationsController. The controller resolves the target user directly from the request parameter without verifying that the authenticated user is authorized to access or modify that user's mail-notification configuration.
For the read operation, GET /api/v2/users/:id/mailnotifications assigns @user = User.find(params[:id]) without an ownership or parent-user authorization check. Because the viewmailnotifications permission is included in the default Viewer role, a user with Viewer privileges can retrieve another user's mail-notification subscriptions, including configured mailquery search strings. This results in cross-user disclosure of notification configuration and potentially sensitive information about the resources or activity being monitored by the victim. The same controller also fails to correctly enforce authorization for mail-notification creation and modification through POST and PUT /api/v2/users/:userid/mailnotifications. The validateparams method invokes denyaccess when the requester is neither the target user nor an administrator, but does not halt execution after denying access. Consequently, the controller action continues and may persist the unauthorized notification configuration despite returning a 403 response or subsequently triggering a DoubleRenderError (HTTP 500).
An attacker can therefore use the affected API to read another user's mail-notification configuration and, with the required permissions for the write path, modify or create mail-notification records for that user. The underlying issue is improper authorization of the target user combined with failure to terminate request processing after an authorization denial.
— Red Hat
Affected Software
Event History
Frequently Asked Questions
Who can exploit this issue?
An authenticated user can target another user's mail-notification resources through the affected API endpoints. Exploitation does not require user interaction and can be performed over the network.
What information or changes could an attacker obtain?
The GET endpoint can disclose another user's mail-notification configuration, including mail_query values. The POST and PUT endpoints may allow unauthorized creation or modification of another user's notification settings because processing can continue after deny_access.
How can I identify attempted or successful exploitation?
Review requests to /api/v2/users/:id/mail_notifications and the corresponding POST or PUT paths for user IDs that do not belong to the authenticated requester. Investigate cases where a 403 response or DoubleRenderError coincides with persisted changes to another user's mail-notification settings.