security: enforce upload size limits (ai:gpt-5) #48
Labels
No labels
nagonag
nagonag/ignore
bug
doc
duplicate
enhancement
help wanted
invalid
question
security
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
IUS/once#48
Loading…
Add table
Add a link
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?
Finding from a whole-codebase security review.
Affected code:
Impact:
r.ParseMultipartForm(2 << 20)only controls how much multipart data stays in memory. The request body and copied file content are otherwise unbounded, so an authenticated user, compromised credentials, or an automated client can fill disk and consume CPU by streaming large uploads or large multi-file zip uploads. Partial failures also leave cleanup-dependent store entries.Suggested fix:
r.Bodywithhttp.MaxBytesReaderinUploadbefore parsing.