mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3251] docs: docs/EXTENSIONS.md is out of date - install needs admin access, and extension CSS is sanitized #1747
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#1747
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 (Jul 5, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3251
Originally assigned to: @SpicyMarinara on GitHub.
docs/EXTENSIONS.mdhas drifted from the shipped app. Found in a full docs-vs-code audit against v2.1.0. Each item below is independently checkable: open the doc at the noted spot and compare against the app or code. These can all land in one PR that refreshes the file.2 items found.
1. line 5 ("Extensions are imported from Settings -> Extensions...") - and nowhere else in the 261-line doc
(missing)
The doc presents extension import/management as unconditionally available, but installing, updating (including simply toggling enabled/disabled), and deleting extensions are privileged actions: they succeed only from loopback, or remotely only when ADMIN_SECRET is set in the server .env and saved in Settings -> Advanced -> Admin Access. A user reaching Marinara from another device (LAN, Docker host, Tailscale) who follows this doc gets a 403 on every import - and even the IP allowlist and Basic Auth do not unlock it. The doc never mentions loopback, admin access, or ADMIN_SECRET.
Suggested fix: Add a short note near the intro (after line 5): installing, updating/toggling, or removing extensions requires loopback access or ADMIN_SECRET (server .env) pasted into Settings -> Advanced -> Admin Access; otherwise the server returns 403. Cross-link to docs/CONFIGURATION.md § Privileged APIs. (Optional follow-up: CONFIGURATION.md's own "fail closed" bullet list in that section omits extension install/update/delete - and theme writes per #2947 - so consider adding them there too.)
2. line 257 ("CSS is injected as a style block when the extension is enabled.") and the marinara.addStyle row at line 108
(missing)
The doc implies extension CSS is injected verbatim, but every extension CSS path (manifest css/cssPath and marinara.addStyle) runs through the shared sanitizer before injection: all url() references are rewritten to url(about:invalid) unless they are data: URIs with image/font MIME types, @import and @namespace are stripped, @font-face blocks are removed unless every source is a font data: URI (local() sources also disqualify the block), expression()/javascript:/vbscript:/behavior/-moz-binding are removed, and :visited selectors are rewritten to :link. An extension author using an external background image, @import, or a remote web font will see it silently fail, and this - the doc an extension author would consult - never says why.
Suggested fix: Add a sentence under Import Notes (line 257) and mirror it briefly in the addStyle helper row (line 108): extension CSS is sanitized before injection for security - external url(), @import, @namespace, remote/local() web fonts, and script-like constructs are stripped (external URLs become url(about:invalid)); embed images and fonts as data: URIs instead. Optionally note that :visited selectors are rewritten to :link.
@SpicyMarinara commented on GitHub (Jul 5, 2026):
Addressed in #3289.