From 5e5354fb7727e806b24e93f3f0668350ffcdffc3 Mon Sep 17 00:00:00 2001 From: Ryan Min <73128364+kcrmin@users.noreply.github.com> Date: Wed, 11 Nov 2026 14:59:10 +0900 Subject: [PATCH 1/4] ci(go): read toolchain from go.mod Weekly govulncheck fails on stdlib advisories fixed after go1.26.6. Pin go1.26.11 once in cli/go.mod and point setup-go at it. --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 2 +- .github/workflows/security.yml | 4 ++-- cli/go.mod | 2 ++ 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7d92d3..7978480 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Unit and integration tests working-directory: cli @@ -82,7 +82,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Plugin, documentation, security, and strict-profile contracts env: @@ -125,7 +125,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Multi-repository service continuity scenario env: @@ -156,7 +156,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Build all supported targets without CGO shell: bash diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c7cb5d4..5329b30 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,7 +40,7 @@ jobs: test "$(python3 -c 'import json; print(json.load(open(".codex-plugin/plugin.json"))["version"])')" = "${TAG#v}" - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Test exact source working-directory: cli diff --git a/.github/workflows/security.yml b/.github/workflows/security.yml index 86583d8..f486c85 100644 --- a/.github/workflows/security.yml +++ b/.github/workflows/security.yml @@ -23,7 +23,7 @@ jobs: languages: go - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Build for CodeQL working-directory: cli @@ -44,7 +44,7 @@ jobs: persist-credentials: false - uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 with: - go-version: 1.26.6 + go-version-file: cli/go.mod cache-dependency-path: cli/go.sum - name: Race tests working-directory: cli diff --git a/cli/go.mod b/cli/go.mod index 2fdc70d..3471489 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -2,6 +2,8 @@ module github.com/kcrmin/Stackcord/cli go 1.26.0 +toolchain go1.26.11 + require ( github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 github.com/spf13/cobra v1.10.2 From 0081580e54ce5d214f59d4422b42d468f6f1397e Mon Sep 17 00:00:00 2001 From: Ryan Min <73128364+kcrmin@users.noreply.github.com> Date: Wed, 11 Nov 2026 15:07:38 +0900 Subject: [PATCH 2/4] ci(native): move macos job to macos-15 GitHub retired the macos-14 image on 2026-11-02, so the macOS ARM64 job was rejected before it started. --- .github/workflows/ci.yml | 2 +- scripts/validate_ci_test.py | 2 +- scripts/validate_release_config.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7978480..14c2154 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: matrix: include: - name: macOS ARM64 - os: macos-14 + os: macos-15 artifact: stackcord-darwin-arm64 extension: "" - name: Windows x64 diff --git a/scripts/validate_ci_test.py b/scripts/validate_ci_test.py index 2e521e6..141ddd7 100644 --- a/scripts/validate_ci_test.py +++ b/scripts/validate_ci_test.py @@ -29,7 +29,7 @@ def test_ci_runs_product_contract_and_dogfood_checks_without_model_calls(self): def test_pull_request_uses_two_representative_native_full_test_jobs(self): ci = (ROOT / ".github" / "workflows" / "ci.yml").read_text(encoding="utf-8") - for token in ("macos-14", "windows-2025"): + for token in ("macos-15", "windows-2025"): self.assertIn(token, ci) for token in ("macos-15-intel", "windows-11-arm"): self.assertNotIn(token, ci) diff --git a/scripts/validate_release_config.py b/scripts/validate_release_config.py index 92e3421..d58d5b5 100755 --- a/scripts/validate_release_config.py +++ b/scripts/validate_release_config.py @@ -36,7 +36,7 @@ def validate(root: pathlib.Path) -> list[str]: if not re.search(r"@[0-9a-f]{40}$", use): errors.append(f"GitHub Action is not commit-pinned: {path.name}: {use}") ci = (root / ".github" / "workflows" / "ci.yml").read_text(encoding="utf-8") if (root / ".github" / "workflows" / "ci.yml").exists() else "" - for label in ("macos-14", "windows-2025"): + for label in ("macos-15", "windows-2025"): if label not in ci: errors.append(f"representative native CI target missing: {label}") for label in ("macos-15-intel", "windows-11-arm"): From a3e171ac050449a9bd6842ee4f67e8cb97659d5c Mon Sep 17 00:00:00 2001 From: Ryan Min <73128364+kcrmin@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:00:49 +0900 Subject: [PATCH 3/4] fix(ui): reject drive-relative archive paths Check filepath.IsLocal on archive entry names and reject C:foo style names on every platform. --- cli/internal/ui/import.go | 6 ++++-- cli/internal/ui/import_test.go | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/cli/internal/ui/import.go b/cli/internal/ui/import.go index 7a18008..49d94cb 100644 --- a/cli/internal/ui/import.go +++ b/cli/internal/ui/import.go @@ -24,7 +24,9 @@ const maxImportEntries = 4096 var secretPattern = regexp.MustCompile(`(?i)(api[_-]?token|password|secret|private[_-]?key)\s*[:=]\s*[A-Za-z0-9_\-]{16,}`) var sourceIDPattern = regexp.MustCompile(`^ui\.[a-z0-9]+(?:[.-][a-z0-9]+)*$`) -var windowsAbsolutePath = regexp.MustCompile(`^[A-Za-z]:/`) + +// windowsVolumePath matches drive-absolute (C:/x) and drive-relative (C:x) names. +var windowsVolumePath = regexp.MustCompile(`^[A-Za-z]:`) // Source describes an external UI artifact and its authority. type Source struct { @@ -93,7 +95,7 @@ func registerPlan(source Source) (operation.Plan, error) { for _, entry := range reader.File { rawName := strings.ReplaceAll(entry.Name, "\\", "/") name := path.Clean(rawName) - if name == "." || name == ".." || strings.HasPrefix(name, "../") || strings.HasPrefix(rawName, "/") || windowsAbsolutePath.MatchString(rawName) { + if !filepath.IsLocal(name) || name == "." || name == ".." || strings.HasPrefix(name, "../") || strings.HasPrefix(rawName, "/") || windowsVolumePath.MatchString(rawName) { return operation.Plan{}, fmt.Errorf("archive path escapes quarantine: %s", entry.Name) } pathKey := strings.ToLower(name) diff --git a/cli/internal/ui/import_test.go b/cli/internal/ui/import_test.go index 23fc7ce..8e29c1f 100644 --- a/cli/internal/ui/import_test.go +++ b/cli/internal/ui/import_test.go @@ -31,6 +31,28 @@ func TestImportRejectsMaliciousArchives(t *testing.T) { } } +func TestImportRejectsArchivePathsOutsideQuarantine(t *testing.T) { + names := map[string]string{ + "parent": "../escape.txt", + "nested parent": "screens/../../escape.txt", + "posix absolute": "/etc/escape.txt", + "unc share": `\\server\share\escape.txt`, + "drive absolute slash": "C:/escape.txt", + "drive absolute": `C:\escape.txt`, + "drive relative": "C:escape.txt", + "lower drive relative": "c:screens/escape.txt", + "drive relative backslash": `D:screens\escape.txt`, + } + for label, name := range names { + t.Run(label, func(t *testing.T) { + archive := zipFixtureEntries(t, [][2]string{{"LICENSE", "MIT"}, {name, "x"}}) + plan, err := uiimport.ImportPlan(uiimport.Source{Root: t.TempDir(), Archive: archive, ID: "ui.external.escape", Kind: "mockup", Authority: "reference"}) + require.ErrorContains(t, err, "escapes quarantine") + require.Empty(t, plan.Files) + }) + } +} + func TestImportRejectsDuplicateNormalizedPaths(t *testing.T) { archive := zipFixtureEntries(t, [][2]string{{"LICENSE", "MIT"}, {"screens/Recovery.html", "one"}, {"screens/recovery.html", "two"}}) plan, err := uiimport.ImportPlan(uiimport.Source{Root: t.TempDir(), Archive: archive, ID: "ui.external.duplicate", Kind: "mockup", Authority: "reference"}) From bdbef54bb630e5629313f7c106f14022037a8edf Mon Sep 17 00:00:00 2001 From: Ryan Min <73128364+kcrmin@users.noreply.github.com> Date: Wed, 11 Nov 2026 16:00:49 +0900 Subject: [PATCH 4/4] build(deps): bump golang.org/x/text to v0.44.0 --- cli/go.mod | 2 +- cli/go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cli/go.mod b/cli/go.mod index 3471489..a8000f4 100644 --- a/cli/go.mod +++ b/cli/go.mod @@ -16,6 +16,6 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect github.com/spf13/pflag v1.0.9 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/text v0.44.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/cli/go.sum b/cli/go.sum index 58bbd18..ad33d67 100644 --- a/cli/go.sum +++ b/cli/go.sum @@ -18,8 +18,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=