[PR #8113] [MERGED] fix(mari): refuse full_page_access on Personal Extension drafts #8108

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/8113
Author: @ylli-selmani
Created: 10/22/2026
Status: ✅ Merged
Merged: 10/22/2026
Merged by: @ylli-selmani

Base: staging ← Head: fix/mari-extension-full-page-access


📝 Commits (1)

  • b0b8d29 fix(mari): refuse full_page_access on personal extension drafts

📊 Changes

3 files changed (+79 additions, -2 deletions)

View changed files

📝 packages/server/src/assets/mari-skills/extensions.md (+2 -1)
📝 packages/server/src/services/mari-db/mari-db.service.ts (+11 -0)
📝 scripts/regressions/mari/extensions-handbook.regression.ts (+66 -1)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Closes #8110

Why this change

  • When Professor Mari drafted a Personal Extension that declared full_page_access, personal_extension.create / update stored it. Those app_data actions build the row themselves, so they skipped the check in normalizePayload that refuses the capability for professor_mari drafts.
  • Settings drops the capability for Mari's drafts and approves the hash without it. On the next server start, preparePersonalExtensionTrust re-hashed the raw row (with full_page_access), saw a mismatch and disabled the extension. Each approval was undone at the next restart, and Mari reported a different hash than the one the user approved. No DOM access was ever granted, so this is a correctness bug, not a security one.

What changed

Mari refuses the capability up front (mari-db.service.ts)

  • personal_extension.create and personal_extension.update refuse a draft whose capabilities include full_page_access, before anything is written: Personal Extensions cannot request "full_page_access"; only External Extensions can. Nothing was changed. Send "capabilities" without it and retry.
  • An update checks the capabilities the row will end up with, so a draft stored before this fix can only be edited after Mari resends capabilities without the declaration. That repair also makes her hash match the one Settings shows.
  • I refused the capability instead of filtering it out. Filtering would succeed silently, and Mari would report capabilities the extension doesn't have.

Handbook (mari-skills/extensions.md)

  • The "Never declare full_page_access" paragraph described the stuck hash. It now says the actions refuse it and how to repair an old draft. The errors table has the new refusal.

Regression (scripts/regressions/mari/extensions-handbook.regression.ts)

  • Asserts that a create and an update with full_page_access are refused and write nothing, that an old draft carrying it refuses a metadata-only edit, and that after it's removed Mari's get hash equals the hash Settings approves.
  • Fails on staging without the fix (a full_page_access draft is refused).

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run, for reference: pnpm check, node scripts/run-regressions.mjs --filter regressions/mari/ and --filter extension (results in the PR conversation).

Manual verification notes

  • Manually verify in the browser: ask Professor Mari to draft a Personal Extension with full_page_access. She should get the refusal and retry without it. Settings → Addons → Personal Extensions should show the same contentHash as her personal_extension.get.
  • Manually verify in the browser: approve that draft, restart the server, and confirm it is still enabled.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

No docs/ change; the only doc edited is Mari's bundled handbook.

UI evidence (if applicable)

None: server-side only.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/8113 **Author:** [@ylli-selmani](https://github.com/ylli-selmani) **Created:** 10/22/2026 **Status:** ✅ Merged **Merged:** 10/22/2026 **Merged by:** [@ylli-selmani](https://github.com/ylli-selmani) **Base:** `staging` ← **Head:** `fix/mari-extension-full-page-access` --- ### 📝 Commits (1) - [`b0b8d29`](https://github.com/Pasta-Devs/Marinara-Engine/commit/b0b8d29908946612bfc7325e69816fb1cc9ae362) fix(mari): refuse full_page_access on personal extension drafts ### 📊 Changes **3 files changed** (+79 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `packages/server/src/assets/mari-skills/extensions.md` (+2 -1) 📝 `packages/server/src/services/mari-db/mari-db.service.ts` (+11 -0) 📝 `scripts/regressions/mari/extensions-handbook.regression.ts` (+66 -1) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. ## Linked issue Closes #8110 ## Why this change - When Professor Mari drafted a Personal Extension that declared `full_page_access`, `personal_extension.create` / `update` stored it. Those `app_data` actions build the row themselves, so they skipped the check in `normalizePayload` that refuses the capability for `professor_mari` drafts. - Settings drops the capability for Mari's drafts and approves the hash without it. On the next server start, `preparePersonalExtensionTrust` re-hashed the raw row (with `full_page_access`), saw a mismatch and disabled the extension. Each approval was undone at the next restart, and Mari reported a different hash than the one the user approved. No DOM access was ever granted, so this is a correctness bug, not a security one. ## What changed **Mari refuses the capability up front** (`mari-db.service.ts`) - `personal_extension.create` and `personal_extension.update` refuse a draft whose capabilities include `full_page_access`, before anything is written: `Personal Extensions cannot request "full_page_access"; only External Extensions can. Nothing was changed. Send "capabilities" without it and retry.` - An update checks the capabilities the row will end up with, so a draft stored before this fix can only be edited after Mari resends `capabilities` without the declaration. That repair also makes her hash match the one Settings shows. - I refused the capability instead of filtering it out. Filtering would succeed silently, and Mari would report capabilities the extension doesn't have. **Handbook** (`mari-skills/extensions.md`) - The "Never declare `full_page_access`" paragraph described the stuck hash. It now says the actions refuse it and how to repair an old draft. The errors table has the new refusal. **Regression** (`scripts/regressions/mari/extensions-handbook.regression.ts`) - Asserts that a create and an update with `full_page_access` are refused and write nothing, that an old draft carrying it refuses a metadata-only edit, and that after it's removed Mari's `get` hash equals the hash Settings approves. - Fails on `staging` without the fix (`a full_page_access draft is refused`). ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run, for reference: `pnpm check`, `node scripts/run-regressions.mjs --filter regressions/mari/` and `--filter extension` (results in the PR conversation). ### Manual verification notes - Manually verify in the browser: ask Professor Mari to draft a Personal Extension with `full_page_access`. She should get the refusal and retry without it. Settings → Addons → Personal Extensions should show the same `contentHash` as her `personal_extension.get`. - Manually verify in the browser: approve that draft, restart the server, and confirm it is still enabled. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) No `docs/` change; the only doc edited is Mari's bundled handbook. ## UI evidence (if applicable) None: server-side only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:10:26 +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#8108
No description provided.