mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #2471] [Issue]: Professor Mari commits write actions with no approval (type:none), enabling prompt-injection code execution #1213
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#1213
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/2471
Originally assigned to: @SpicyMarinara on GitHub.
Summary
Severity: Medium — security (indirect prompt injection → code execution). Professor Mari's write tools (
edit_marinara_code_file,create_marinara_extension,create_marinara_custom_agent) execute autonomously inside the ReAct loop with no human-in-the-loop, and the response always returnsaction.type: "none"so no approval modal is ever shown. Combined withcreate_marinara_extensiondefaultingenabled: true(whose JS auto-runs), untrusted text fed to Mari can drive a silent arbitrary-JS-execution chain.Expected behavior
Write actions should not commit without explicit user approval. Either the write tools should return a real
create_record/edit_recordaction contract that the existing frontend approval path gates, or created extensions should be forcedenabled: falseuntil the user manually enables them. The wire contract should not be labeled read-only /type: "none"when a write actually occurred.Actual behavior
The frontend only surfaces an approval UI for
create_record/edit_recordactions;type: "none"shows nothing, so these writes are silent.CustomThemeInjectorruns every enabled extension'sjsviaimport()of a Blob URL, handing itstorageApi.create/update/delete— arbitrary JS in the desktop renderer. Untrusted text reaches the model on the same turn it can call write tools: attachment contents, theread_marinara_librarysnapshot of imported characters/personas/lorebooks (free-text fields), and the contents of any file read viaread_marinara_code_file. A crafted persona/character/lorebook/attachment that instructs Mari to "create an enabled extension with this js" yields silent JS execution with zero confirmation.Steps to reproduce
create_marinara_extensionwith a JS payload andenabled: true.type: "none"; no confirmation appears; the extension's JS auto-runs.Impact area
Environment
1fae2c42Logs, screenshots, or video
Static trace:
mari.rs:455-462(tools),:527-540(read_only_mari_action_contract/type:"none"),:379(default_true),:1094-1121(create_marinara_extension); execution sinkCustomThemeInjector.tsx(import()of extension JS +storageApiexposure).Regression notes
Not a regression — this autonomous-write Mari agent is a refactor-only surface with no main equivalent. Filing as a refactor
bug. The chain is conditional (requires a tool-capable connection and the model obeying the injected text over its system prompt), which is why it is Medium rather than High; but indirect-prompt-injection → tool abuse is a recognized class and the RCE is one obeyed injection away.Additional context
Note:
edit_marinara_code_fileis correctly path-guarded (resolve_repo_file+is_code_text_path), so out-of-repo writes are prevented; in-repo source mutation is still unconfirmed. Strongest fix: forcecreate_marinara_extensionto persistenabled: falseregardless of the model-supplied flag, and route edit/create tools through a realcreate_record/edit_recordaction contract so the existingmari-entry.tsapproval path gates the commit. At minimum, stop returningtype:"none"/read_only_mari_action_contractwhen a write tool fired.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.Professor Mari write tools now require explicit approval and autonomous no-approval write execution is disabled; helper-created extensions and agents are forced disabled if that path is used.
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.