mirror of
https://github.com/Pasta-Devs/Marinara-Agents.git
synced 2026-12-03 18:55:07 +07:00
[GH-ISSUE #1476] Slurp: validate media restored from a backup #748
Labels
No labels
agent: chess
agent: conversation-calls
agent: eightball
agent: haptic
agent: hierarchical-maps
agent: hierarchical-maps
agent: illustrator
agent: poker
agent: rock-paper-scissors
agent: tic-tac-toe
agent: uno
artifacts
bug
bugfix
build
catalog
ci
client
dependencies
docs
documentation
enhancement
feature
fixed-in-staging
in-pr
normal-scope
packages
pull-request
qol
regression
roadmap
scope-risk
server
soup
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Agents#748
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 @SpicyMarinara on GitHub (Oct 19, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Agents/issues/1476
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Restoring a Slurp backup writes each
media/file back under the name it has in the archive, after checking only its first bytes. The file's extension is never compared with the image type those bytes show, and the Slurp media routes then serve the stored file with a type taken from its name. Restore and serving should both hold Slurp media to verified pictures.Affected package
slurp2(Slurp) 0.3.48Expected behavior
X-Content-Type-Options: nosniff.Actual behavior
restoreCreatorMediaFile(packages/slurp2/src/engine/packages/server/src/slp/base/media/slp-media.ts) accepts any name undermedia/and callsisAllowedImageBuffer(data)without the extension, so the name and the bytes can disagree. It also never passes the AVIF hint, so AVIF pictures are dropped on restore.reply.sendFile, which names the type from the file extension.Steps to reproduce
restoreCreatorMediaFileinslp-media.tsand the restore job infeatures/maintenance/slp-backup-jobs.ts.sendFilecalls infeatures/feed/slp-feed-post-routes.ts,features/messages/slp-messages-media-routes.ts,features/media/slp-media-routes.tsandfeatures/ads/slp-ads-routes.ts.Environment
Logs, screenshots, or video
None; found by code review.
Additional context
Fix branch:
fix/slurp-restore-media.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Oct 19, 2026):
Fixed on staging by #1477.