mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5647] Import hardening, preview-token transport, and lastMessageAt on createMessageWithSwipe #3128
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#3128
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 @Gunterlie on GitHub (Aug 29, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5647
Originally assigned to: @Gunterlie on GitHub.
Context
CodeRabbit's review of PR #5583 reported six "outside diff range" findings. Two were in that PR's scope and are fixed there. The remaining four are pre-existing on
stagingand unrelated to the character-identity feature, so they were deliberately left out of that PR.Findings to address
1. Unbounded import upload size —
packages/server/src/routes/import.routes.ts:35UNBOUNDED_IMPORT_BYTESisNumber.MAX_SAFE_INTEGER, and the import endpoints buffer uploads withtoBuffer(). Uncontrolled resource consumption (CWE-400). Replace with a finite, configurable limit and enforce a total batch budget before buffering.2. Unbounded zTXt decompression —
packages/server/src/routes/import.routes.ts:243inflateSyncexpands attacker-controlled zTXt data from uploaded PNGs before JSON parsing (CWE-409, decompression bomb). Use bounded decompression and return a controlled import error when the limit is exceeded.3. Preview token sent over cleartext —
packages/client/src/components/panels/SettingsPanel.tsx:6853api.rawuses relative URLs, so the profile-importpreviewTokentravels over plain HTTP when the app is served over HTTP (CWE-319). Require HTTPS for production and reverse-proxy deployments before sending this bearer-like token.4.
createMessageWithSwipe()does not updatelastMessageAt—packages/server/src/routes/chats.routes.ts:750CapabilityPersistenceSession.createMessageWithSwipe()inserts messages without touchingchats.lastMessageAt. If the one-timestorage.list()backfill runs before this write,/autonomous-candidatescan skip a non-empty Roleplay DM with a null timestamp. Update the chat timestamp in the same transaction, matchingcreateMessage.Notes