mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #8771] [MERGED] fix(server): hold Professor Mari's direct mari CLI and raw DB writes to her file and key boundaries #8794
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#8794
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/8771
Author: @SpicyMarinara
Created: 11/3/2026
Status: ✅ Merged
Merged: 11/3/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/hardening-mari-db-cli📝 Commits (2)
b0060d4fix(server): hold Professor Mari's direct mari CLI to her file and key boundariesb3fd0c9fix(server): keep chat text destinations out of raw Mari DB writes📊 Changes
4 files changed (+355 additions, -1 deletions)
View changed files
📝
packages/server/src/services/mari-db/mari-db.service.ts(+55 -0)📝
packages/server/src/services/professor-mari/workspace-commands.ts(+14 -0)📝
scripts/regressions/mari/db-execution-security.regression.ts(+204 -1)➕
scripts/regressions/professor-mari/direct-mari-file-flags.regression.ts(+82 -0)📄 Description
Linked issue
Closes #8769
Why this change
Professor Mari's read tool and both shell sandboxes already refuse paths outside the workspace, as well as .env, the encryption key and Git internals. Simple
mari ...commands run in the server process, outside the sandbox, and their text-file flags did not follow that rule. Rawmari dbwrites are also applied before the Keep/Restore review. For Models, Connections and the speech server settings, which keep a stored key next to the address it is sent to, that skipped the checks the Connections editor and profile import make. The same was true for the chat settings that send chat text to an outside address or hold its key (Discord mirror, DeepLX address, DeepL key, haptics server), which profile import strips. This change applies the same rules the app already enforces elsewhere to the direct CLI and to raw DB writes.What changed
mari dbcommands or transforms. These writes are refused with a message pointing the user to Connections and Settings. This also blocks harmless edits she could make before, for example a connection's prompt preset override. Like the other Mari DB floors, it also applies to the loopbackmariCLI.mari dbwrites and transforms can no longer set or change a chat's Discord mirror webhook, DeepLX address, DeepL key or haptics server address, in a chat, a chat settings profile, or the translator defaults for new chats. This includes copying them into a new row. The refusal points the user to Chat Settings. Her other chat-settings edits still apply, and clearing one of these values is still allowed.maricommands now refuse --json-file, --file and --css-file paths that are outside the workspace or point at .env, the encryption key or Git internals, with the same message the read tool gives. A missing file now reports the read tool's 'Path not found' text instead of a raw ENOENT.Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Agent-run checks (for reference; each regression was shown to fail without its fix):
node ./scripts/pnpm-runner.mjs build:shared: succeedednode ./scripts/run-regressions.mjs --filter mari/db-execution-security (this round's mari-db.service.ts change stashed): FAILED as expected: the chats translationDeeplxUrl patch returned ok:true, mode applyscratch probe (temp FILE_STORAGE_DIR) running each new destination write with and without the floor: without the floor all 5 writes applied (ok:true); with it all 5 were refused with only the new message; clearing translationDeeplxUrl applied in bothnode ./scripts/run-regressions.mjs --filter mari/db-execution-security (with fix): 1/1 passed (macos-seatbelt)node ./scripts/run-regressions.mjs --filter direct-mari-file-flags: 1/1 passednode ./scripts/run-regressions.mjs --filter mari: 87/87 passednode ./scripts/run-regressions.mjs --filter <name> for chat-local-destination-security, extension-security, open-issues, chat-diagnose, package-table-registrati: each 1/1 passedcd packages/server && node ../../scripts/pnpm-runner.mjs run lint (tsc -b ../shared && tsc --noEmit && tsc -p ../../scripts/regressions/tsconfig.character-activ: exit 0npx prettier --write on the 2 files changed this round; npx prettier --check on all 4 branch files: All matched files use Prettier code styleeslint: not run: ESLint is configured only for packages/client; no client files changed, so pnpm localization:check was not needed and was not runfull pnpm check / full regression suite: not run (server type-check, prettier and the targeted regressions above only)Independent adversarial review: changes, 1 issue(s), all addressed in a fix-up pass.
Known limits and risks:
--, so it can only refuse more than the CLI would read. A future mari flag that reads files must be added to DIRECT_MARI_TEXT_FILE_FLAGS, which is marked with a ponytail: comment.mariCLI, as the existing permissions and runtime floors do.mari dbreads. Also, the verifier noted a pre-existing gap in the shared workspace path guard: Windows 8.3 short names are not resolved. That affects the read tool too and was not introduced here.pnpm check, prettier on the changed files and the targeted regressions above were run. The fullpnpm checkand the full regression suite were not run. Nothing was pushed and no PR was opened.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.