Skip to content

Fix OCI dependencies and aligned allocations - #430

Open
kjanat wants to merge 10 commits into
bytecodealliance:mainfrom
kjanat:fix/security-dependencies
Open

kjanat wants to merge 10 commits into
bytecodealliance:mainfrom
kjanat:fix/security-dependencies

Conversation

@kjanat

@kjanat kjanat commented Oct 24, 2026 •

Copy link
Copy Markdown

OCI loading pulls in vulnerable versions of regclient, compress and xz. Update them to 0.11.5, 1.18.7 and 0.5.15 to fix credential forwarding to external blob stores, S2 integer overflow and malformed-LZMA memory exhaustion.

Require Go 1.26 and test Go 1.26/1.27 with TinyGo 0.43. Update checkout, setup-go, setup-tinygo and artifact actions. Fix release-job permissions and shell argument quoting.

Go 1.26 race checks also exposed fabricated pointers in x/cabi tests. Replacing them uncovered aligned allocations smaller than requested. Allocate enough padded backing storage, preserve contents during realignment, and test the entire writable span with real buffers.

Depends on #429, which contains the Windows fixes. Changes after #429.

CI covers Linux and Windows normal/race/CGO-disabled suites, native TinyGo, and WASI Preview 1 and 2. Full Windows normal and race suites passed locally; the updated path and cleanup tests also pass on Windows and TinyGo WASI.

Normalize guest paths so Windows separators do not break WIT loading.
Close the embedded runtime after each load to release directory handles.
Compare each directory with its parent to detect filesystem roots.
The slash-only check looped forever at Windows drive roots when
no go.mod existed. Keep nested package suffixes while ascending.
Build fixture paths with filepath.Rel and filepath.Join. Test
Windows directory creation permissions with an ACL and compare
created permissions with a control directory on the same filesystem.
Remove empty test directories before TinyGo cleanup.
@kjanat
kjanat requested a review from ydnar as a code owner October 24, 2026 19:56
@kjanat
kjanat marked this pull request as draft October 24, 2026 20:01
Keep WIT path fixtures on the checkout volume and WIT goldens
on LF endings. Remove owned temporary files explicitly for TinyGo.
Run the existing Go version matrix on Windows as well as Linux.
Update regclient to 0.11.5, compress to 1.18.7 and xz to 0.5.15.
These fix credential leakage, integer overflow and malformed-input
memory exhaustion in dependencies used for OCI loading.

Test Go 1.26 and 1.27 on Linux and Windows. Use TinyGo 0.43 for
native Linux and WASI jobs, with local toolchain selection.

BREAKING CHANGE: Building the root module now requires Go 1.26.
Grant contents write permission to the release job and read
permission to the build job. Quote workspace and tag arguments;
pass prerelease options through a Bash array.
Typed slices used min(size/align, 1), allocating at most one
element for aligned buffers. Allocate checked, padded byte storage
so every requested byte fits after alignment.

Copy the retained prefix when shrinking requires realignment.
Test writable buffers and preserved bytes using real allocations.
@kjanat
kjanat force-pushed the fix/security-dependencies branch from 3f14f73 to 9360a79 Compare October 24, 2026 20:16
@kjanat kjanat changed the title Fix dependency vulnerabilities and enable Windows CI Fix OCI dependencies and aligned allocations Oct 24, 2026
@kjanat
kjanat marked this pull request as ready for review October 24, 2026 20:42

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