mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2481] [Issue]: Backup / profile zip ships raw apiKeyEncrypted in connections.json, defeating the profile.json masking #1224
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#1224
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 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2481
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Severity: Low — security (secret export) regression. Managed backup / download-profile zip masks
apiKeyEncryptedin themarinara-profile.jsonsnapshot, but then also copies the rawdata/directory verbatim into the same archive — sodata/collections/connections.jsonships the realapiKeyEncryptedciphertext, defeating the masking applied to its sibling file.Expected behavior
The backup/profile zip should not contain
apiKeyEncrypted. Either excludedata/collections/connections.jsonfrom the rawdata/copy (rely on the maskedmarinara-profile.jsonfor connections), or pass it throughmask_connection_for_readbefore copying — so both members of the archive agree.Actual behavior
marinara-profile.jsonis masked (connections routed throughconnections_for_export→mask_connection_for_read, which removesapiKeyEncrypted), butcopy_dir_contentscopiesdata/collections/connections.jsonunfiltered, and that on-disk row carries the real AES-256-GCMapiKeyEncrypted. The test atbackup.rs:325-327confirmsdata/collections/*.jsonlands in the archive. All three entry points (create_backup,download_backup,download_profile_zip) route throughwrite_backup_payload.Steps to reproduce
data/collections/connections.jsoninside the resulting zip —apiKeyEncryptedis present, even thoughmarinara-profile.jsonshowsapiKey: "••••••••".Impact area
Environment
1fae2c42Logs, screenshots, or video
Static trace:
backup.rs:11(BACKUP_DIRSincludesdata),:101-117(masked profile.json + verbatimdata/copy),copy_dir_contents:76-99, masking pathconnection_secrets.rs:82-92+:28; test:325-327.Regression notes
Regression vs main, whose ZIP export carries no
apiKeyEncryptedat all. The refactor's verbatimdata/copy reintroduced the encrypted-credential material into the archive, defeating the intended masking.Additional context
Severity caveat (not a refutation):
apiKeyEncryptedis AES-256-GCM ciphertext and the master key lives atdata/secrets/connection-master.key, which is not inBACKUP_DIRS— so the zip alone is not plaintext-decryptable. This is therefore a hardened-but-real export-sanitization-contract break (defense-in-depth), hence Low. Fix: exclude or maskdata/collections/connections.jsoninwrite_backup_payloadto matchprofile_collections().Template check
Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:
@SpicyMarinara commented on GitHub (Jun 6, 2026):
Fixed on refactor in
038b7220.Backup/profile export now masks connections.json through the connection secret masking path, so raw apiKeyEncrypted values are not shipped in managed backups.
Verification: pnpm typecheck; pnpm build; pnpm check:architecture; cargo check --manifest-path src-tauri/Cargo.toml --workspace; focused Rust backup/profile tests; git diff --check; no .test.ts/.test.tsx files present.