spring-projects / spring-projects/spring-security

Consider preventing SecurityContextHolder.getContext().setAuthentication

Open
#3,798 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

in: core
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

Invoking this can cause race conditions and should not be done. We should consider preventing this behavior. See http://docs.spring.io/spring-security/site/docs/4.0.x/reference/htmlsingle/#tech-intro-sec-context-persistence

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the linked Spring Security 4.0 reference section on security-context persistence and identify how SecurityContextHolder.getContext().setAuthentication is currently used. The issue does not name files, tests, or a specific prevention mechanism; completion would require an agreed design for preventing the race-prone behavior and corresponding verification.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
authentication, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.