fix: add X-Content-Type-Options nosniff header to downloads (Closes #173) #184

Merged
shahondin1624 merged 1 commits from feature/issue-173-download-security-headers into main 2026-04-10 16:25:41 +02:00
Owner

Summary

  • Creates SecurityHeadersMiddleware that adds X-Content-Type-Options: nosniff to all DownloadResponse instances
  • Prevents MIME-type sniffing attacks on exported CSV, PDF, and ZIP files
  • Content-Disposition: attachment is already handled by Nextcloud's DownloadResponse

Test plan

  • All 1012 tests pass

Closes #173

## Summary - Creates `SecurityHeadersMiddleware` that adds `X-Content-Type-Options: nosniff` to all `DownloadResponse` instances - Prevents MIME-type sniffing attacks on exported CSV, PDF, and ZIP files - `Content-Disposition: attachment` is already handled by Nextcloud's `DownloadResponse` ## Test plan - [x] All 1012 tests pass Closes #173
shahondin1624 added 1 commit 2026-04-10 16:25:36 +02:00
Creates SecurityHeadersMiddleware that adds X-Content-Type-Options: nosniff
to all DownloadResponse instances, preventing MIME-type sniffing attacks
on exported CSV, PDF, and ZIP files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shahondin1624 merged commit 089a775b84 into main 2026-04-10 16:25:41 +02:00
shahondin1624 deleted branch feature/issue-173-download-security-headers 2026-04-10 16:25:41 +02:00
Sign in to join this conversation.