mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-20 09:09:35 +02:00
feat(html-view): open network access for rendered pages (owner decision)
Owner decision 2026-10-13 (#547): a rendered .html page behaves like a file opened from disk in a browser. It may load scripts, styles, fonts, images and media from any host and make fetch, XHR, WebSocket, beacon and form requests to any host. The /html-view Content-Security-Policy is therefore the `sandbox` directive alone (HTML_VIEW_CSP, now exported and documented): the same sandbox flags as before, never `allow-same-origin`, and no fetch directive. It replaces Codeman's own `default-src 'self'` policy on these responses. Everything that confines a page stays: the opaque origin (no Codeman cookies or document, API writes with `Origin: null` refused, API reads not readable cross-origin), and the capability serving only the page's own folder under every path, symlink, dot, extension and confinement rule. A new test builds the route behind registerSecurityHeaders, as in production, and pins the exact header: one `sandbox` directive with the current flags, no `allow-same-origin`, no `-src` directive. The security architecture, architecture invariants, API reference, CLAUDE.md and the Working With Files wiki page now say what a page can do (reach the network, read its own folder) and cannot do (Codeman's origin, cookies, API, other folders), and that this is the owner's decision. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
c1fde8e639
commit
ba5649bcd4
7 files changed
+70
-12
No files matched your search
@@ -106,7 +106,15 @@ was never what kept anything secret; the path guard is. Types outside the list (
|
||||
|
||||
An `.html` file opens as a rendered page by default, with its relative CSS, scripts, images and
|
||||
data files. The page is served from a separate `/html-view/...` address in a sandbox with no
|
||||
origin of its own, so its scripts can never read Codeman's page, cookies or API. The **Page**
|
||||
origin of its own, so its scripts can never read Codeman's page, cookies or API.
|
||||
|
||||
By the project owner's decision, a rendered page has the same network access as a file you open
|
||||
from disk in your browser. It **can** load scripts, styles, fonts, images and media from
|
||||
anywhere on the internet (a dashboard that pulls Chart.js from a CDN works), send requests to
|
||||
any host, and read the files in its own folder. It **cannot** act as Codeman: it has no access
|
||||
to Codeman's page, cookies or API, and no access to any folder other than its own. Since a page
|
||||
can send what it can read to any host, open HTML only from sources you trust, as you would on
|
||||
your own desktop. The **Page**
|
||||
pill in the viewer header switches to the source view (where **Edit** works as for any text
|
||||
file), and the viewer falls back to source on its own when a page cannot be rendered: a remote
|
||||
(SSH) case, an HTML file inside a hidden folder, or one sitting directly in a broad folder such
|
||||
|
||||
Reference in new issue
Block a user