Plug-in Library: a file URL cannot name a network path

A local catalog's file:// URLs were decoded into a path without checking
how the path starts. A URL such as file:////server/share/x.wasm, or one
whose path holds a backslash or a percent-encoded / or \, could become a
network path on Windows, so reading the catalog or a release named in it
contacted that host.

file_url_path now refuses a decoded path that starts with two separators
or holds a backslash, and a percent-encoded / or \, with an error that
names the reason. Local paths and drive-letter paths are read as before.
The library.refresh params text, docs/plugins.md and
docs/publishing-plugins.md say so.
This commit is contained in:
dotCooCoo committed 2026-11-05 21:02:33 -08:00
1 parent 3102b6e632
commit 55dc4a6d9e
3 files changed
+72 -15

No files matched your search

+2 -1
View File
@@ -369,7 +369,8 @@ package can't read files, open the network or crash the app.
[`storytold/effectcraft-plugins`](https://github.com/storytold/effectcraft-plugins) repository;
packages are added by pull request and reviewed there. The app has no field for another
catalog; `library.refresh {catalog}` (for plug-in authors testing an entry) takes an `index.json`
on GitHub or a local file, and the page then says it shows a test catalog until Refresh.
on GitHub or a local file, and the page then says it shows a test catalog until Refresh. A file
URL that names a network path (`file:////server/share/…`) is refused.
* **Nothing is downloaded until you ask.** Fetch Catalog (`library.refresh`) reads the catalog;
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`,
+3 -1
View File
@@ -226,7 +226,9 @@ Make a folder with an `index.json` that holds only your package:
```
File URLs are absolute: `file:///home/me/glow-rings/index.json` on Linux and macOS,
`file:///C:/Users/me/glow-rings/index.json` on Windows. Write a space as `%20`.
`file:///C:/Users/me/glow-rings/index.json` on Windows. Write a space as `%20`. Separate folders
with `/`: a file URL that holds a `\` or a percent-encoded `/` or `\`, or names a network path
(`file:////server/share/…`), is refused.
Use a separate settings folder, so the test doesn't touch your real installation: