Skip to content

fix(share): security hardening#6

Merged
kvendrik merged 3 commits intomainfrom
fix/share-security
Apr 9, 2026
Merged

fix(share): security hardening#6
kvendrik merged 3 commits intomainfrom
fix/share-security

Conversation

@kvendrik
Copy link
Copy Markdown
Owner

@kvendrik kvendrik commented Apr 9, 2026

Changes

Security fixes identified in code review:

  • Race condition β€” re-read store immediately before decrement to narrow concurrent-request race window
  • HTML XSS β€” serve .html as application/octet-stream instead of text/html to force download and prevent JS execution in browser
  • Header injection β€” sanitize Content-Disposition filename (strip control chars and quotes)
  • Token store moved to /tmp β€” share URLs no longer survive container restarts
  • Caps tightened β€” --minutes capped at 20 (default 5), --times capped at 3 (default 1)

Backoffice added 3 commits April 9, 2026 09:10
- Clamp minutes to 1–20 (default 5), times to 1–3 (default 1)
- Serve HTML as application/octet-stream to prevent browser JS execution
- Sanitize Content-Disposition filename (strip control chars and quotes)
- Re-read store before decrement to narrow concurrent-request race window
@kvendrik kvendrik merged commit 469379d into main Apr 9, 2026
1 check passed
@kvendrik kvendrik deleted the fix/share-security branch April 9, 2026 09:21
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