mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7818] [MERGED] fix(security): harden ssrf #7944
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#7944
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7818
Author: @SpicyMarinara
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/harden-ssrf📝 Commits (1)
1e7c611fix(security): keep chat outside addresses on the install that set them📊 Changes
6 files changed (+357 additions, -5 deletions)
View changed files
📝
packages/server/src/routes/backup.routes.ts(+66 -0)📝
packages/server/src/routes/chat-presets.routes.ts(+8 -2)📝
packages/server/src/routes/chats.routes.ts(+3 -1)📝
packages/server/src/services/import/st-chat.importer.ts(+3 -1)📝
packages/shared/src/types/chat-preset.ts(+21 -1)➕
scripts/regressions/chat-local-destination-security.regression.ts(+256 -0)📄 Description
Linked issue
No public issue. This is pre-release hardening the maintainer asked for.
Why this change
A few chat settings tell the server where to send chat text, or hold the key for such a service: the Discord mirror webhook, the DeepLX address, the DeepL API key and the Intiface (haptics) server address. Until now these settings travelled with shared files. A chat log or settings profile made on another install could set them when imported, and exports included the owner's own webhook token and DeepL key. Only the person who set up an install should decide where its chats are sent. This change keeps those settings on the install where they were entered, the same way connection API keys and custom tool webhooks already stay local.
What changed
packages/shared: addedCHAT_METADATA_LOCAL_DESTINATION_KEYS(discordWebhookUrl,translationDeeplxUrl,translationDeeplApiKey,hapticIntifaceUrl) and anomitChatMetadataLocalDestinationshelper. Updated the comment on the settings profile type.importSTChat, which covers/import/st-chat,/import/st-chat-into-groupand SillyTavern bulk import): drops these keys from the imported Marinara metadata./chat-presets/import,/chat-presets/:id/export): leaves them out. Profiles saved on this install still keep them, so applying your own profile still sets your Discord mirror.sanitizeProfileTableRows): leaves them out of chat metadata, settings profile metadata and the translator defaults for new chats.scripts/regressions/chat-local-destination-security.regression.ts. It covers every path above, checks that ordinary settings (auto-translate, provider, context limit) still carry over, and checks that local profiles keep the mirror.Behaviour change: when you move a chat, settings profile or full profile to another install, the Discord mirror webhook, DeepLX address, DeepL key and Intiface address have to be entered again there. Restoring a full profile onto the same install keeps them.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdCommands run by the agent:
pnpm check: passed. The only lint output is one existing client warning in a file this PR does not touch.pnpm regression:security: passed, including the new regression.No browser or container testing was done.
Manual verification notes
discordWebhookUrl.marinara_metadatacontains a Discord webhook, DeepLX URL, DeepL key and Intiface URL. Open Chat Settings on the new chat and confirm the Discord Mirror, DeepLX URL, DeepL key and Intiface address fields are empty. Auto-translate and the provider choice should still come through..marinara-settings-profile.jsonthat contains those keys while a chat is open. Confirm the chat's Discord Mirror and translator address fields are not filled from the file.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)No user-facing doc mentions the Discord mirror or translator settings travelling with exports, so no docs were changed.
UI evidence (if applicable)
No UI changes.
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.