[GH-ISSUE #8110] [Issue]: Mari Personal Extension drafts that declare full_page_access cannot stay approved #7565

Closed
opened 2026-10-24 04:04:19 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @ylli-selmani on GitHub (Oct 22, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8110

Originally assigned to: @ylli-selmani on GitHub.

Summary

When Professor Mari drafts a Personal Extension through app_data (personal_extension.create or update) and the draft declares the full_page_access capability, the draft is saved anyway. The user can approve it in Settings, but the approval is revoked on the next server start, and Mari reports a different content hash than the one Settings approved.

Personal extensions cannot have full page access (the regular create/update path refuses it with "Professor Mari extensions cannot request full page access"), but the app_data path builds the row itself and skips that check. No DOM access is granted: Settings and the runtime read the extension with full_page_access filtered out. The bug is that the draft cannot stay approved, and nobody is told why.

Expected behavior

personal_extension.create|update refuses a professor_mari draft that declares full_page_access, with an error Mari can act on (drop the capability and retry), and nothing is written.

Actual behavior

  • The row is stored with full_page_access and a content hash computed over it.
  • personal_extension.get reports that hash and lists full_page_access.
  • Settings → Addons filters the capability out for professor_mari drafts and shows a different hash. Approving there works for the current run.
  • On the next server start, preparePersonalExtensionTrust re-hashes the raw row (with full_page_access), sees a mismatch, and disables the extension with approvedHash: null. Each approval is undone at the next start.

Steps to reproduce

  1. Have Professor Mari run {"action":"personal_extension.create","id":"fpa","name":"FPA","runtime":"client","capabilities":["full_page_access"],"css":"body{}","apply":true}.
  2. Run personal_extension.get for fpa; note its contentHash and capabilities.
  3. Open Settings → Addons → Personal Extensions; the draft shows no capabilities and a different hash. Approve it.
  4. Restart the server; the extension is disabled again and no longer approved.

Reproduced against a temporary database on staging at 7217a4b55: create succeeds, Mari's hash sha256:c5c8… vs Settings' sha256:c8c2…, approve → enabled, trust migration → changedRecordsDisabled: 1, enabled false, approvedHash null.

Environment

  • Marinara Engine version: 2.5.1 (staging at 7217a4b55)
  • Install type: source
  • OS + version: Windows 11
  • Browser or app shell: n/a (server-side; reproduced with a script)

Logs, screenshots, or video

No logs; nothing is logged. Output of the reproduction script is summarized above.

Additional context

  • Code: packages/server/src/services/mari-db/mari-db.service.ts, the personal_extension create and update cases, vs. normalizePayload in packages/server/src/services/extensions/personal-extension-storage.service.ts.
  • Related: #7908 (fixed a different app_data Personal Extension write issue: editing External extensions).

Template check

Please uncheck (untick) the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @ylli-selmani on GitHub (Oct 22, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/8110 Originally assigned to: @ylli-selmani on GitHub. ## Summary When Professor Mari drafts a Personal Extension through `app_data` (`personal_extension.create` or `update`) and the draft declares the `full_page_access` capability, the draft is saved anyway. The user can approve it in Settings, but the approval is revoked on the next server start, and Mari reports a different content hash than the one Settings approved. Personal extensions cannot have full page access (the regular create/update path refuses it with "Professor Mari extensions cannot request full page access"), but the `app_data` path builds the row itself and skips that check. No DOM access is granted: Settings and the runtime read the extension with `full_page_access` filtered out. The bug is that the draft cannot stay approved, and nobody is told why. ## Expected behavior `personal_extension.create|update` refuses a `professor_mari` draft that declares `full_page_access`, with an error Mari can act on (drop the capability and retry), and nothing is written. ## Actual behavior - The row is stored with `full_page_access` and a content hash computed over it. - `personal_extension.get` reports that hash and lists `full_page_access`. - Settings → Addons filters the capability out for `professor_mari` drafts and shows a different hash. Approving there works for the current run. - On the next server start, `preparePersonalExtensionTrust` re-hashes the raw row (with `full_page_access`), sees a mismatch, and disables the extension with `approvedHash: null`. Each approval is undone at the next start. ## Steps to reproduce 1. Have Professor Mari run `{"action":"personal_extension.create","id":"fpa","name":"FPA","runtime":"client","capabilities":["full_page_access"],"css":"body{}","apply":true}`. 2. Run `personal_extension.get` for `fpa`; note its `contentHash` and `capabilities`. 3. Open Settings → Addons → Personal Extensions; the draft shows no capabilities and a different hash. Approve it. 4. Restart the server; the extension is disabled again and no longer approved. Reproduced against a temporary database on `staging` at `7217a4b55`: create succeeds, Mari's hash `sha256:c5c8…` vs Settings' `sha256:c8c2…`, approve → enabled, trust migration → `changedRecordsDisabled: 1`, enabled false, approvedHash null. ## Environment - Marinara Engine version: 2.5.1 (`staging` at `7217a4b55`) - Install type: source - OS + version: Windows 11 - Browser or app shell: n/a (server-side; reproduced with a script) ## Logs, screenshots, or video No logs; nothing is logged. Output of the reproduction script is summarized above. ## Additional context - Code: `packages/server/src/services/mari-db/mari-db.service.ts`, the `personal_extension` `create` and `update` cases, vs. `normalizePayload` in `packages/server/src/services/extensions/personal-extension-storage.service.ts`. - Related: #7908 (fixed a different `app_data` Personal Extension write issue: editing External extensions). ## Template check Please **uncheck (untick)** the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-24 04:04:19 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#7565
No description provided.