Skip to content

fix(media): allow HTML file uploads as downloadable attachments - #3597

Open
Chessing234 wants to merge 1 commit into
block:mainfrom
Chessing234:fix/allow-html-file-uploads
Open

fix(media): allow HTML file uploads as downloadable attachments#3597
Chessing234 wants to merge 1 commit into
block:mainfrom
Chessing234:fix/allow-html-file-uploads

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

Summary

  • Remove text/html and application/xhtml+xml from the relay and desktop generic-file deny lists
  • Keep SVG, JavaScript, and native executables blocked
  • Map sniffed HTML to a .html / .xhtml extension and assert serve_inline stays false (forced download)

Generic files are already served with Content-Disposition: attachment, X-Content-Type-Options: nosniff, and CSP: default-src 'none', so HTML documents are safe as downloadable attachments (#3453).

Test plan

  • cargo test -p buzz-media --lib test_validate_file_html
  • Upload an .html report in Desktop — succeeds and downloads rather than rendering inline
  • SVG / .exe uploads still rejected

Fixes #3453

Made with Cursor

Agents commonly produce HTML reports; the generic file path already serves
them with attachment + nosniff + CSP. Drop text/html and xhtml from the
deny lists (keep SVG/JS/executables blocked) and pin the download path
with regression tests.

Signed-off-by: Taksh <takshkothari09@gmail.com>
@Chessing234
Chessing234 requested a review from a team as a code owner July 29, 2026 18:34
@Chessing234

Copy link
Copy Markdown
Contributor Author

@tlongwell-block @wesbillman @wpfleger96 mind taking a look when you get a chance?

@Chessing234
Chessing234 force-pushed the fix/allow-html-file-uploads branch from 7898b22 to f160f79 Compare August 5, 2026 10:37
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.

Allow text/html file uploads on the relay generic file path (served as download)

1 participant