Skip to content

[JENKINS-64465] Race condition on setSecurityRealm #11860

Closed

Description

@jenkins-infra-bot

If Jenkins#setSecurityRealm is called concurrently from multiple threads there is a potential race condition on the authentication filters registration.

Jenkins#setSecurityRealm calls filter.reset(), HudsonFilter#reset is not synchronized however it is replacing the old filter with the new filter (if there was one) which is not thread a thread safe operation.

The effect of this race condition is the wrong auth filter being registered.


Originally reported by amuniz, imported from: Race condition on setSecurityRealm
  • assignee: amuniz
  • status: Closed
  • priority: Major
  • component(s): core
  • resolution: Fixed
  • resolved: 2020-12-22T14:18:45+00:00
  • votes: 0
  • watchers: 1
  • imported: 2025-11-24
Raw content of original issue

If Jenkins#setSecurityRealm is called concurrently from multiple threads there is a potential race condition on the authentication filters registration.

Jenkins#setSecurityRealm calls filter.reset(), HudsonFilter#reset is not synchronized however it is replacing the old filter with the new filter (if there was one) which is not thread a thread safe operation.

The effect of this race condition is the wrong auth filter being registered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions