Skip to content

Harden upload handling and storage quota checks - #243

Merged
clbotdev merged 2 commits into
mainfrom
security/harden-uploads-verify
Nov 1, 2026
Merged

clbotdev merged 2 commits into
mainfrom
security/harden-uploads-verify

Conversation

@clbotdev

@clbotdev clbotdev commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Run ffmpeg for video thumbnails without a shell, and restrict stored file extensions to [A-Za-z0-9]{1,10} (REST, tus and MCP uploads)
  • Write MCP upload_media temp files to a server-chosen path instead of one built from the caller's file name
  • Count unsealed uploads toward storage usage, and re-check the limit when sealing (a seal over the limit returns 403)

Testing

  • Regression tests for each change: src/media/utils/__tests__, src/mcp/tools/__tests__/upload.test.ts, src/media/__tests__/quota.test.ts
  • API suite: 160 tests passing, tsc clean
  • Ran the API locally against Postgres and MinIO: uploads and thumbnails still work over REST, tus and MCP, and the quota gate refuses uploads once unsealed uploads reach the limit

Note: the dashboard storage figure now includes unsealed uploads.

- Run ffmpeg without a shell and restrict file extensions to [A-Za-z0-9]{1,10}
- Keep MCP upload temp files at a server-chosen path
- Count unsealed uploads toward storage and re-check the limit on seal
- Add regression tests
@clbotdev
clbotdev merged commit 446bfd5 into main Nov 1, 2026
5 of 6 checks passed
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.

2 participants