mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #1534] [Issue]: Image uploads trust declared MIME type without validating bytes #780
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#780
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?
Originally created by @Xelvanis on GitHub (May 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/1534
Originally assigned to: @Romuromylus on GitHub.
Summary
Shared Rust upload decoding rejects empty payloads, oversized payloads, and non-image declared content types, but it still trusts a declared
image/*MIME type without validating the decoded bytes.Expected behavior
Image upload decoding should validate actual image bytes with magic-byte and/or decoder checks before accepting the payload.
Actual behavior
A payload can declare an
image/*content type and pass the shared decoder without a byte-level image validation step.Steps to reproduce
image/*content type.decode_uploaded_image_filerejects the payload before storage/use.Impact area
Environment
src-tauri/src/commands/storage/shared.rsLogs, screenshots, or video
No screenshot. Existing evidence:
decode_uploaded_image_filevalidates empty/non-image declared content types and size limits, but still trusts declaredimage/*type for the actual bytes.Regression notes
Unknown.
Additional context
Keep existing size/content-type tests as regression coverage and add invalid-byte/magic-byte tests.
Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@Romuromylus commented on GitHub (May 30, 2026):
Fixed by #1636, merged into
refactor.