Skip to content

Conversation

alexander-alderman-webb
Copy link
Contributor

Description

Prevent mutating cookies on incoming HTTP requests if the cookie name is in the scrubbers denylist.

Cookies like token=... were replaced with AnnotatedValue because a shallow reference of the request information was held by the client. A deep copy is introduced so scrubbing does not interfere with Litestar, and in particular does not break JWTCookieAuth. Other HTTP integrations already create a deep copy. For instance,

event["request"] = deepcopy(request_info)

Issues

Closes #4882

Reminders

@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner October 3, 2025 11:57
@alexander-alderman-webb alexander-alderman-webb changed the title fix(litestar): Copy request body to prevent cookies mutation fix(litestar): Copy request info to prevent cookies mutation Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[litestar] AnnotedValue partition error
1 participant