Plug-in Library: a package downloads only release assets of its repository

A catalog release's url was checked only for its host: any https:// URL
on GitHub's hosts was downloaded, from any repository and any path,
including a raw file on a branch or a path with dot segments that curl
resolves to another repository.

library.install, library.update and library.preview now refuse a url
that isn't https://github.com/<owner>/<repo>/releases/download/<tag>/<file>.
When the package's repo is a https://github.com/<owner>/<repo> URL, the
asset must be in that repository (owner and name compared without case).
Dot segments, also percent-encoded, empty segments, backslashes, queries
and fragments are refused. file:// releases from a local catalog are
read as before, and the SHA-256 and size checks are unchanged.

A catalog other than the community one is still read only when
library.refresh names it (https:// on GitHub's hosts, or a local
file://). docs/plugins.md, docs/publishing-plugins.md and the
library.install params text describe the rules.
This commit is contained in:
dotCooCoo committed 2026-11-05 21:51:04 -08:00
1 parent 3102b6e632
commit 75fed052e3
4 files changed
+134 -4

No files matched your search

+5 -1
View File
@@ -374,7 +374,11 @@ package can't read files, open the network or crash the app.
Install (`library.install`) downloads the package's `.wasm`, checks its SHA-256 (and its size, when the
catalog gives one) against the catalog and loads it. Downloads use the system's `curl`,
`https://` only and starting on GitHub's hosts (redirects stay on `https://`; the SHA-256 check
is what guarantees the file).
is what guarantees the file). A package's `url` must be a release asset
(`https://github.com/<owner>/<repo>/releases/download/…`), in the package's `repo` when that is
a GitHub repository URL. A catalog other than the community one is read only when
`library.refresh {catalog}` names it: an `index.json` on GitHub's hosts over `https://`, or a
local `file://` path.
* **Where it goes.** `<Plug-ins>/Library/<id>/<version>/<id>.wasm` (the `Plug-ins` folder next to
the settings), listed in `Library/installed.json`. Installed packages load at start-up, each
checked against the SHA-256 it was installed with. The catalog last fetched is kept as
+1 -1
View File
@@ -193,7 +193,7 @@ Release fields (one per entry in `versions`):
| `version` | yes | Dotted numbers only, at most 32 characters: `1.0.0`, `1.2`. No `v` and no suffixes such as `-beta`. |
| `api` | yes | The plug-in API the module implements: `1`. |
| `minApp` | no | The oldest EffectCraft version the release needs (`0.17.0`). Leave it out if any version with this API works. |
| `url` | yes | The release asset's `https://` URL on GitHub. |
| `url` | yes | The release asset's `https://` URL on GitHub: `https://github.com/<owner>/<repo>/releases/download/<tag>/<file>`. When `repo` is a `https://github.com/<owner>/<repo>` URL, the asset must be in that repository. Install and Preview refuse any other `https://` URL. |
| `sha256` | yes | The file's SHA-256, 64 hex digits. |
| `size` | no, but reviewed | The file's size in bytes. When it is given, a download of another size is refused. |
| `effects` | yes | The effect ids the module registers (its manifest's `id`). EffectCraft uses them to find the package that provides an effect a project needs. |