mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #5899] Five capability permissions are declared in package manifests and enforced nowhere #3256
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#3256
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 @kolacheee on GitHub (Sep 6, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/5899
Originally assigned to: @SpicyMarinara on GitHub.
A capability package manifest can declare nine permissions. Four of them are actually checked before
the matching capability is handed out; the other five —
chat-read,chat-write,network,storageandui— are never checked anywhere in the server. They are strings a package writes intoits manifest and a user reads on the install screen, and nothing behind them changes based on what
they say. In particular, any package with a server entrypoint already receives the full persistence
host — read and write, across every chat, not scoped to its own — whether or not its manifest asked
for anything.
Where it is. The permission enum is
packages/shared/src/schemas/capability-package.schema.ts:9-20. A repo-wide search for permissiongates returns five call sites covering four permissions:
agent-runtime(
packages/server/src/services/capability-packages/capability-agent-runtime.service.ts:15),conversation-actionsandprompt-context(
packages/server/src/services/capability-packages/capability-module-runtime.service.ts:220and:234), androutes(
packages/server/src/services/capability-packages/capability-route-registration.service.ts:71,packages/server/src/services/capability-packages/package-manager.service.ts:447). Nothing checks theother five. The persistence host is attached unconditionally in the same activation context that does
the other gating —
capability-module-runtime.service.ts:98,persistence: createCapabilityPersistenceHost(app.db)— and that host includes whole-chat metadata writers(
packages/server/src/services/capability-packages/capability-persistence.service.ts:507-545). Thepermission list is shown to the user in the catalog detail pane before install
(
packages/client/src/components/agents/AgentCatalogView.tsx:731-742) and nowhere after it. Packagesdo declare these strings in good faith — the Pixelforge build script declares
chat-read,chat-write,uiwith a comment saying the point is to disclose access to users(
scripts/build-pixelforge-package.mjs:126-130in the Pixelforge package repo).Why it matters. The install screen makes a promise the engine does not keep. A user reading a package's
permissions is being told what it can reach, and for five of the nine that list is decoration — a
package that declares nothing can still write every chat's metadata. It also means the disclosure runs
backwards: the honest packages that list
chat-writelook more dangerous than a package that listsnothing and has identical access.
The smallest honest fix is probably not "enforce all five at once" —
uiandnetworkin particularwould need a definition of what enforcement even means for a client bundle — but to close the gap
between what the list claims and what the list does, one permission at a time, starting with the ones
that gate a real server-side capability.
chat-readandchat-writeare the two with an obviousenforcement point: the persistence host could be built per-package from the manifest rather than handed
out whole. Two things are worth deciding alongside that. First, every gate that exists today guards a
server entrypoint registration, so a gate on a package with no server code at all would be a new kind
of check, not the existing kind applied once more. Second, permissions are displayed pre-install only,
so any change that widens what an already-granted permission means reaches existing users with no
re-consent — the write-back channel in #5798 will be the first thing to actually enforce
chat-write,and it widens the meaning from "this package's own code writes chat data" to "the engine will execute
writes on this package's behalf, from model output". That widening is worth an answer here rather than
inside that PR.
@SpicyMarinara commented on GitHub (Sep 9, 2026):
@SpicyMarinara owns this fix in draft #5985. I am gating chat persistence reads/writes and spatial snapshots by the package manifest, preserving the checks inside transactions. The existing trusted-code disclosure will remain explicit: these are Engine API gates, not a sandbox for downloaded JavaScript.