~bigbes/sr-ht-dolt: 9660c720

pages: read forms through FormValues

Every mutation on this surface read its fields with r.PostFormValue after a bare
r.ParseForm. PostFormValue was already the right half — r.Form would merge the
query string into the body, which would let a mutation be driven from a URL
somebody was linked to, and that request is exactly the one the same-origin
guard sees nothing wrong with — but the body was bounded only by net/http's
10 MiB default, on pages anyone can reach. FormValues is both properties in one
call, and the values are passed down explicitly instead of each sub-handler
reaching back into the request.

Eugene Blikh <bigbes@gmail.com> — 2026-08-08 21:35:27 UTC

Commit 9660c7204a2b9500e56c7bb2ff47316d50d5fc99view raw patch

Parent(s): 0b1e119a

4 changed file(s)

FileStatus+
web/handlers_keys.go M +9 -6
web/handlers_repo.go M +6 -4
web/handlers_settings.go M +19 -16
web/web_test.go M +41