Details
Assignee
Michael OffnerMichael OffnerReporter
Michael OffnerMichael OffnerNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Priority
New
Details
Details
Assignee
Michael Offner
Michael OffnerReporter
Michael Offner
Michael OffnerNew Issue warning screen
Before you create a new Issue, please post to the mailing list first https://dev.lucee.org
Once the issue has been verified, one of the Lucee team will ask you to file an issue
Sprint
Fix versions
Priority
Created 11 March 2025 at 15:52
Updated 17 March 2025 at 12:26
Race condition in
ScopeContext.getCFSessionScope()
can cause a single user to create multiple session objects, leading to session data loss during normal application usage.The session scope management in Lucee has a race condition where multiple simultaneous requests from the same user can create different new session objects. This occurs because the check-then-act pattern in
getCFSessionScope()
is not properly synchronized.When two requests from the same user arrive simultaneously:
Both check if a session exists
Both determine no session exists (or needs recreation)
Both create separate session objects
The last one to complete overwrites the other in the storage map
The user loses data stored in the first session object
The result is that users may experience loss of session data, inconsistent session state across requests, and the need to re-login or re-establish session state unexpectedly.
Proposed Fix
Implement double-checked locking in the
getCFSessionScope()
method. This ensures that for each CFID, only one thread at a time can create or modify the session structure, preventing the creation of multiple session objects for the same user.Impact
This issue can cause:
Loss of session data for users
Unexpected logouts
Shopping cart data disappearing
Form submissions requiring repetition
General inconsistent user experience