fix: zip-slip hardening in updater + security dependency bumps - #2106
Conversation
… bumps Security fixes from the Aikido remediation pass: - internal/updates: validate archive entry paths stay inside the extraction directory in extractZip and extractTarGZ (zip-slip); also create parent directories for tar file entries before writing - internal/ci/git: write the goreleaser config to a unique os.CreateTemp file instead of the predictable /tmp/.goreleaser.yml - go.mod: bump golang.org/x/crypto to v0.52.0 (AIKIDO-2026-11022 family), golang.org/x/net to v0.55.0 (AIKIDO-2026-11039), google.golang.org/grpc to v1.79.3 (CVE-2026-33186) - internal/defaultcodesamples: npm overrides for jsonpath-plus ^10.3.0 (CVE-2024-21534, CVE-2025-1302) and lodash ^4.18.1 (CVE-2026-4800) go build ./... clean; defaultcodesamples build + vitest pass.
|
Pushed errorlint fix ( |
|
Your PR description lists a different version (The overrides entry says |
|
Good catch — that was a wording slip in the description, not a version mismatch in the code. The override is a range, not a pin:
Both CVEs are covered by |
…r hardening (#2107) Follow-up to #2106 (merged) for [SEC-39](https://linear.app/speakeasy/issue/SEC-39). ## Summary - **CVE-2026-34040** (docker AuthZ plugin bypass, Aikido 456150475): no fixed version exists on the `github.com/docker/docker` module path (fix is only on `github.com/moby/moby/v2`). Resolved by bumping `testcontainers-go` v0.40.0 → v0.43.0, which migrated to `github.com/moby/moby/{api,client}` — `docker/docker` is now removed from the module graph entirely (gone from go.mod and go.sum). - **GHSA-hrxh-6v49-42gf** (grpc xDS RBAC / HTTP/2, Aikido 456150548): first patched version is **1.82.1**, so the 1.79.3 bump in #2106 was insufficient. grpc → v1.82.1. - **Studio server hardening** (Aikido 456152166 + codex review): bind `127.0.0.1` instead of all interfaces (the unauthenticated `/` redirect leaks the studio secret in the `Location` header, so LAN exposure was a real risk), add `ReadHeaderTimeout`/`IdleTimeout` (no Read/WriteTimeout — /run and /health use SSE). - **defaultcodesamples**: replace fixed world-readable `/tmp/defaultcodesamples.js` (executed by node; pre-creatable/swappable by another local user) with a unique owner-only `os.CreateTemp` file, removed after use. ## Verification - `go build ./...` clean - `go vet ./internal/studio/... ./internal/defaultcodesamples/...` clean - `go test ./internal/studio/... ./internal/defaultcodesamples/... ./internal/updates/...` pass <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Removes vulnerable `github.com/docker/docker`, upgrades `google.golang.org/grpc` to v1.82.1, and hardens Studio server and temp file handling. Follow-up for SEC-39 to close outstanding security alerts. - **Dependencies** - Replaced `github.com/docker/docker` by bumping `github.com/testcontainers/testcontainers-go` v0.40.0 → v0.43.0 (migrates to `github.com/moby/moby/{api,client}`). - Upgraded `google.golang.org/grpc` v1.79.3 → v1.82.1. - **Bug Fixes** - Studio server now binds to `127.0.0.1` and sets `ReadHeaderTimeout` and `IdleTimeout` (SSE-safe). - `defaultcodesamples`: use `os.CreateTemp` for a unique, owner-only file and remove it after use. <sup>Written for commit b5b316f. Summary will update on new commits.</sup> <a href="https://cubic.dev/pr/speakeasy-api/speakeasy/pull/2107?utm_source=github" target="_blank" rel="noopener noreferrer" data-no-image-dialog="true"><picture><source media="(prefers-color-scheme: dark)" srcset="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://www.cubic.dev/buttons/review-in-cubic-light.svg"><img alt="Review in cubic" src="https://www.cubic.dev/buttons/review-in-cubic-dark.svg"></picture></a> <!-- End of auto-generated description by cubic. -->
Fixes SEC-39
Summary
Fixes the remaining Aikido Critical/High findings in this repo:
internal/updates/updates.go, 3 findings): archive entries are now validated to stay inside the extraction directory in bothextractZipandextractTarGZvia a sharedsecurePathhelper. Tar file entries also get parent directories created before write.internal/ci/git/releases.go): goreleaser config now written viaos.CreateTempinstead of fixed/tmp/.goreleaser.yml.internal/defaultcodesamples): npm overrides constrain jsonpath-plus to^10.3.0(resolves to 10.4.0 in the lockfile; CVE-2024-21534 fixed in 10.2.0, CVE-2025-1302 in 10.3.0) and lodash ^4.18.1 (CVE-2026-4800).Verification
go build ./...cleannpm run build+ vitest pass (8 passed, 1 skipped, 3 todo)Summary by cubic
Hardened archive extraction to block zip‑slip and removed a predictable temp file in the release flow. Also bumps Go and JS dependencies to address Aikido Critical/High findings (SEC‑34).
Bug Fixes
securePath, create parent dirs for tar entries, and useerrors.Isforio.EOFinextractTarGZ.os.CreateTempfile and useWriteStringinstead of a fixed/tmp/.goreleaser.yml.Dependencies
golang.org/x/crypto→v0.52.0,golang.org/x/net→v0.55.0,google.golang.org/grpc→v1.79.3; also bumpedgolang.org/x/{oauth2,term,text,mod,sys,tools}.internal/defaultcodesamples): addoverridesforjsonpath-plus^10.3.0andlodash^4.18.1.Written for commit c1cf8b9. Summary will update on new commits.
Follow-up (2026-08-04): the grpc 1.79.3 bump here was insufficient for GHSA-hrxh-6v49-42gf (first patched in 1.82.1); that bump, removal of the vulnerable
github.com/docker/dockerdependency (CVE-2026-34040), and studio server hardening landed in #2107.