A security release. An opal.lock can no longer choose where a tarball comes from, the shared store is checked before a package is linked from it, and downloads go over https:// only.
To install Opal
curl -fsSL https://opalx.dev/install.sh | bash
To upgrade Opal
opal upgrade
Security
opal.lockcan no longer choose where a tarball comes from. A lockfile line carries a package's tarball URL and the integrity it is checked against, so an edited line could install any bytes as any package, under--frozen-lockfiletoo. Each package is now fetched only from where the registry keeps it,<registry>/<name>/-/<name>-<version>.tgzor the URL the registry itself lists for that version, and this is checked before the local store is used.- Downloads go over
https://only (orfile://from a registry on this machine), redirects included, and a response stops at 256 MiB for a packument and 512 MiB for a tarball instead of being read without end. - The shared store is checked before a package is linked from it. Its files are hardlinked into projects, so a file changed in place under one project's
node_modules(as root, or after achmod) was changed for every project installed after it. Every stored file is now sealed (read-only, with npm's fixed 1985 timestamp, which is what files undernode_modulesshow), so a changed one is found with onestat, and its package is downloaded again with a warning. A store written by an earlier release is re-hashed once, on first use. opal installno longer follows a symlink out ofnode_modules. Withnode_modules/<name>linked to another project, asnpm linkdoes, packages inside that project were removed as stale; a symlinked scope directory was written through. Symlinks there are now left alone, or replaced when a package belongs at that path.opal xasks before installing a package to run it, when run at a terminal; onlyygoes ahead.--yesskips the question, and with no terminal on stdin, in a script or CI, there is none, as withnpx.opal upgradereads releases from GitHub only. A release build ignoresOPAL_INTERNAL_RELEASES_URL, which let anything able to set an environment variable choose the binary an upgrade installs, with aSHA256SUMSfrom the same place.- The runtime no longer lets JavaScript free memory a native call is using. A vectored read or write (
fs.readv,fs.writevand their sync forms) reads every buffer of its array before using any, then holds each one's memory until the call ends, so an array element that is a getter freeing an earlier buffer can't makereadvwrite into freed memory. That was a heap use-after-free onmasterbefore the asynchronous fs rewrite, found under AddressSanitizer, and never in a release; a nightly AddressSanitizer job now runs the attack.Buffer's native operations take their numeric arguments only from primitives, for the same reason. - Release archives carry signed build provenance, checked with
gh attestation verify <archive> --repo saintparish4/opal, and the release workflow verifies it before publishing. Every action in CI is pinned to a commit hash, and a lint step refuses one that isn't.
Breaking
- A registry configured as
http://is refused. - An
opal.lockwritten against one registry is refused when installing from another. Delete it and install again.
No opal.lock format change. Affected: 0.4.2 and earlier. Upgrade with opal upgrade.
Full Changelog: https://github.com/saintparish4/opal/compare/v0.4.2...v0.4.3