security: force attachment or block active uploaded content (ai:gpt-5) #52
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#52
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:
Content-Typefor single-file uploads.application/ziptype for generated archives.Content-Disposition: attachmentwhen the type does not start withtext/.Impact:
An authenticated uploader can upload active text content such as
text/htmland send the once link to another user. After the recipient confirms the POST download, the browser may render the response as same-origin HTML/JavaScript because the server deliberately omitsContent-Dispositionfortext/*. For users who also have Basic-auth credentials cached for the same origin, that script can make same-origin authenticated requests.Suggested fix:
Content-Disposition: attachmentfor all downloads, includingtext/*.X-Content-Type-Options: nosniff.application/octet-streamunless the type is server-detected and known safe.text/htmluploads to assert they are not rendered inline as active same-origin content.