Skip to content

treat malformed s-maxage as absent in shared-cache auth check - #874

Open
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:cache-malformed-smaxage-auth
Open

treat malformed s-maxage as absent in shared-cache auth check#874
dxbjavid wants to merge 1 commit into
apache:masterfrom
dxbjavid:cache-malformed-smaxage-auth

Conversation

@dxbjavid

Copy link
Copy Markdown
Contributor

A shared cache must not store a response to a request that carried an Authorization header unless the response permits it through s-maxage, must-revalidate or public (RFC 9111 3.5). The guard treats any s-maxage as qualifying, but a malformed value like s-maxage=foo is parsed as 0 rather than -1, so it looks present and the authenticated response is stored in the shared cache and can later be handed to other clients on a revalidated hit. This tracks whether a valid s-maxage was actually supplied and uses that in the check, so a malformed directive is treated as absent as the spec requires; the numeric value is left unchanged so freshness behaviour is not affected.

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.

1 participant