mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2535] [MERGED] fix(backup): redact custom_tools.webhookUrl from profile exports #5637
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#5637
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/2535
Author: @Romuromylus
Created: 6/9/2026
Status: ✅ Merged
Merged: 6/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/profile-export-webhook-redact📝 Commits (2)
4bc939ffix(backup): redact custom_tools.webhookUrl from profile exports9a663afMerge branch 'staging' into fix/profile-export-webhook-redact📊 Changes
1 file changed (+9 additions, -1 deletions)
View changed files
📝
packages/server/src/routes/backup.routes.ts(+9 -1)📄 Description
Linked issue
Closes #2525
Why this change
sanitizeProfileTableRows()is the single chokepoint that scrubs secrets for every profile-export sink (JSON export, ZIP export, and the on-disk backup envelope). It redactsapi_connections.apiKeyEncryptedandagent_configssecrets, then passes every other table through verbatim.custom_toolsfell through, so itswebhookUrlcolumn was exported in plaintext. ForexecutionType="webhook"tools the webhook URL is a bearer credential — a Discord webhook embeds its token in the URL path — so every exported/sharedmarinara-profile.json(and ZIP, and backup envelope) leaked the live secret.What changed
packages/server/src/routes/backup.routes.ts:custom_toolsbranch tosanitizeProfileTableRows()that blankswebhookUrl, mirroring theapi_connectionsapiKeyEncryptedbranch.webhookUrlonly:scriptBody/staticResultare user-authored tool bodies, not credentials, so they are preserved.exported so it can be unit-tested directly without the Fastify/DB stack.webhook_urlis a nullable column and the import path inserts rows as-is, so a round-tripped export imports cleanly with an emptywebhookUrl(the user re-enters the URL — the same accepted trade-off already applied toapi_connections.apiKeyEncrypted).Not a regression: byte-identical on
main; long-standing shared bug.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
pnpm checkpasses locally. Added a local-only node:test (backup-sanitize.test.ts, gitignored):custom_tools.webhookUrlis blanked (the fix),scriptBody/staticResultare preserved (not over-scrubbed), theapi_connectionsbranch still blanksapiKeyEncrypted, and unrelated tables pass through untouched. Local run: 4/4 pass.Still to verify manually against the deploy:
custom_toolsentry'swebhookUrlis empty while name/description/parametersSchema/executionType remain intact.Docs and release impact
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.