Skip to content

feat(runtimebundle): verify portable runtime archives - #1756

Merged
joeykchen merged 1 commit into
goplus:devfrom
joeykchen:refactor/runtime-bundle-verification
Aug 21, 2026
Merged

feat(runtimebundle): verify portable runtime archives#1756
joeykchen merged 1 commit into
goplus:devfrom
joeykchen:refactor/runtime-bundle-verification

Conversation

@joeykchen

Copy link
Copy Markdown
Contributor

Summary

Extracts the Driver-independent archive identity and verification foundation from #1753.

  • Strictly decode canonical bundle manifests and reject duplicate or unknown JSON fields.
  • Validate portable entry names, Unicode/case-fold collisions, modes, sizes, and full SHA-256 identities.
  • Verify ZIP offsets, overlap, compression ratio, quotas, file types, and content before extraction.
  • Extract through pinned os.Root handles and fail closed on source mutation, symlink traversal, or destination replacement.
  • Apply private POSIX modes and current-user-only Windows DACLs.

The archive layer no longer depends on cache implementation details: digest helpers and reserved metadata names live with bundle verification. Redundant compatibility aliases and mutable global default limits were removed.

This PR contains no cache, download/acquire, Project Driver, launcher, release, or process-supervision code.

Verification

go test -race ./internal/strictjson ./internal/runtimebundle
go vet ./internal/strictjson ./internal/runtimebundle
go mod tidy -diff
GOOS=windows GOARCH=amd64 go test -c -o /tmp/runtimebundle.test.exe ./internal/runtimebundle
go test ./...

Follow-up

After merge, the transactional cache/lock layer can build on this package in a separate PR, followed by acquire/download. #1753 will rebase and remove each merged foundation from its diff.

@joeykchen
joeykchen marked this pull request as ready for review August 21, 2026 04:24

@fennoai fennoai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifest strictness, archive bounds, ZIP offset checks, content hashing, extraction confinement, and cross-platform build paths were reviewed. The Windows permission seam is not connected to extraction, so the current-user-only DACL contract is not enforced for the extraction root and regular files. Focused tests, race tests, vet, GOOS=windows GOARCH=amd64 go test -c, go mod tidy -diff, and go test ./... passed.

Comment thread internal/runtimebundle/verify.go
@joeykchen
joeykchen force-pushed the refactor/runtime-bundle-verification branch from 0a8752e to 0bc5eae Compare August 21, 2026 04:31
@joeykchen
joeykchen merged commit e8b26bb into goplus:dev Aug 21, 2026
5 checks passed
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