Skip to content

Don't fetch when loading the config property - #440

Open
augustjk wants to merge 1 commit into
mainfrom
restrict-untrusted-config
Open

augustjk wants to merge 1 commit into
mainfrom
restrict-untrusted-config

Conversation

@augustjk

Copy link
Copy Markdown
Collaborator

Setting the config property on or used to fetch any file listed without content, follow extends, and adopt cdnBaseUrl from the config. The config property is the documented way to load a shared project, so a config from an untrusted source (e.g. decoded from a URL) could make the host page fetch arbitrary URLs with the user's credentials. The responses became project files, which code running in the preview could then read.

The config property now only uses files with inline string content and the importMap. Files without content, extends, and cdnBaseUrl are ignored with a console warning, and malformed file entries are skipped instead of throwing. Manifests loaded with project-src are unchanged.

BREAKING CHANGE: configs set through the config property that rely on fetched files, extends, or cdnBaseUrl must be loaded with project-src instead, with the CDN set through the cdnBaseUrl property or cdn-base-url attribute.

@augustjk
augustjk added this pull request to stack #439 November 18, 2026 19:09
@augustjk
augustjk requested a review from rictic November 18, 2026 19:30
Base automatically changed from release-v0-21-3 to main November 19, 2026 17:27
Setting the `config` property on <playground-ide> or <playground-project>
used to fetch any file listed without `content`, follow `extends`, and
adopt `cdnBaseUrl` from the config. The `config` property is the
documented way to load a shared project, so a config from an untrusted
source (e.g. decoded from a URL) could make the host page fetch arbitrary
URLs with the user's credentials. The responses became project files,
which code running in the preview could then read.

The `config` property now only uses files with inline string `content`
and the `importMap`. Files without `content`, `extends`, and `cdnBaseUrl`
are ignored with a console warning, and malformed file entries are
skipped instead of throwing. Manifests loaded with `project-src` are
unchanged.

BREAKING CHANGE: configs set through the `config` property that rely on
fetched files, `extends`, or `cdnBaseUrl` must be loaded with
`project-src` instead, with the CDN set through the `cdnBaseUrl` property
or `cdn-base-url` attribute.
@augustjk
augustjk force-pushed the restrict-untrusted-config branch from 361e884 to ce7f4eb Compare November 19, 2026 17:27

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant