Skip to content

validate samesite attribute in ResponseCookie#36905

Open
dxbjavid wants to merge 1 commit into
spring-projects:mainfrom
dxbjavid:responsecookie-samesite-validation
Open

validate samesite attribute in ResponseCookie#36905
dxbjavid wants to merge 1 commit into
spring-projects:mainfrom
dxbjavid:responsecookie-samesite-validation

Conversation

@dxbjavid

Copy link
Copy Markdown

ResponseCookie validates the cookie name, value, domain and path but the SameSite attribute is appended to the Set-Cookie value as-is, so a value carrying control characters or a semicolon (for instance one taken from an upstream Set-Cookie by the reactive client cookie parsers) can add further attributes or split the header. It seemed safer to check it the same way as the other attributes, so this adds a SameSite check alongside the existing ones in the constructor. Control characters, non-ASCII and ';' are rejected while the usual Strict, Lax and None values still pass.

Signed-off-by: dxbjavid <dxbjavid@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants