Pac4jCsrfSupport.tokenFor builds a body-reading web context, a latent re-entry point for the SUPP-53 body drain #55
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
iterative-works/support#55
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Noticed while working SUPP-53 (see #53).
Pac4jCsrfSupport.Live.tokenFor(Pac4jCsrfSupport.scala:100-103) builds a secondHttp4sWebContextwhose extractor reads the live request body. Today it only callssessionStore.get, so thelazy val getRequestContentis never forced and the bodysurvives.
The risk is latent: adding any
getRequestParametercall there would force theextractor and drain the body again — the exact defect of #53 — on a path that the
UrlEncodedBodyBuffermiddleware added in #53 does not cover.Out of scope for #53, recorded so the trap is visible before someone touches
tokenFor.