mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2525] [Issue]: Profile export ships custom_tools.webhookUrl unredacted (secret leak) #1252
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#1252
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 @Romuromylus on GitHub (Jun 9, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2525
Originally assigned to: @Romuromylus on GitHub.
Summary
Severity: Medium — security (secret leak in export). Profile export ships the
custom_toolstable verbatim, includingwebhookUrl, even though the same export path deliberately scrubs secrets fromapi_connectionsandagent_configs. A webhook URL is a bearer credential (a Discord webhook URL embeds its token in the path), so any exported/shared profile leaks live webhook secrets.Expected behavior
sanitizeProfileTableRows()should redactcustom_tools.webhookUrlbefore it is written into any profile export, mirroring how it already blanksapi_connections.apiKeyEncryptedand redactsagent_configssecrets.Actual behavior
packages/server/src/routes/backup.routes.ts:361-369:custom_toolsis aFILE_BACKED_TABLE(file-backed-store.ts:175) with awebhookUrlcolumn (db/schema/custom-tools.ts:15), sobuildProfileTableSnapshot()dumps it row-for-row. The webhook URL is a secret:discord-webhook.ts:9definesDISCORD_WEBHOOK_REGEX = /^https:\/\/discord(?:app)?\.com\/api\/webhooks\/\d+\/[\w-]+$/, i.e. the token lives in the URL path. The unredacted snapshot reaches all export sinks: profile JSON export (marinara-profile.json,:956), native ZIP export (:859), and the on-disk backup envelope (buildProfileExportEnvelope→:1598).Steps to reproduce
executionType=webhook(e.g. a Discord webhook).marinara-profile.json/ export ZIP — the full secret webhook URL is present in plaintext.Environment
staging @ a9fdae8)Logs, screenshots, or video
Static source audit, cited to file:line above.
Additional context
Fix: add a
custom_toolsbranch tosanitizeProfileTableRows()that blanks/redactswebhookUrl(and reviewscriptBody/staticResultfor sensitivity), mirroring the existing two branches. The reference implementation is the function's ownapi_connections/agent_configshandling; the single skipped sibling call site is thecustom_toolsrow set fed throughbuildProfileTableSnapshot()at:377-378.Note the export is privileged-gated and requires the user to have configured a webhook tool and then shared the export, hence Medium. The on-disk backup additionally copies the raw SQLite DB, so the JSON/ZIP export (intended to be portable and shareable) is the meaningful incremental leak.
Regression notes: found via static audit;
sanitizeProfileTableRowsis byte-identical onmain(65a0395, same two branches andreturn rowsfall-through), so this is a long-standing shared bug, not amain→stagingregression.Template check
Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked: