Skip to content

ci: harden the pipeline, fuzz the sync envelope, document the network surface - #232

Open
kzhx666 wants to merge 11 commits into
TooonyChen:mainfrom
kzhx666:chore/hardening
Open

kzhx666 wants to merge 11 commits into
TooonyChen:mainfrom
kzhx666:chore/hardening

Conversation

@kzhx666

@kzhx666 kzhx666 commented Nov 22, 2026

Copy link
Copy Markdown

Closes #231.

Eleven commits, each doing one thing.

What changes

fix(importer) fix(monitor) fix(sshx) test(app) The 7 staticcheck findings on main (SA4000, SA4006 ×2, SA1019, ST1005 ×3). staticcheck ./... is clean after them, so the new CI step can be blocking.
test(cloudsync) FuzzOpen: Open reads a file another machine wrote. Seeds cover a real envelope, a truncated one, and two with out-of-range KDF parameters, which must be refused before Argon2id allocates anything.
test(sshx,monitor) goleak in the two packages that run a goroutine per session.
ci staticcheck, govulncheck, coverage (printed, not enforced), a 30 s fuzz pass.
ci Release: build provenance and an SPDX SBOM attestation. The SBOM is written before SHA256SUMS, so the checksums cover it too.
chore(deps) Dependabot for gomod and actions.
docs SECURITY.md (what is stored where, every endpoint the app can reach, what is signed) and a README Privacy section.
fix(deps) Go 1.27.4, x/net 0.62.0, brotli 1.2.7 — see below.

The part worth reading

govulncheck, added by this branch, found two vulnerabilities the code reaches:

  • GO-2026-6888 — github.com/andybalholm/brotli@v1.2.2, reached through x/net while reading an HTTP body (updates, the IP database, Gist/S3 sync). Fixed in v1.2.7.
  • GO-2026-6859 — net/http@go1.27.3 (MaxBytesReader header race, CVE-2026-97054). Fixed in go1.27.4.

After the upgrade: Your code is affected by 0 vulnerabilities. The two x/net/html advisories and the x/crypto/openpgp one were in modules but not reachable; they go with the same upgrade.

Verification

gofmt -l .            clean
go vet ./...          pass
go tool mygo vet      pass
staticcheck ./...     0 findings (was 7)
govulncheck ./...     0 reachable (was 2)
go test ./...         13 packages pass; internal/app: 3 failures

The three internal/app failures (TestBackgroundImage, TestBackgroundReadsOffUIThread, TestCommandBarPage) reproduce on main at 78c2f91 in the same headless container — that baseline shows five failures, this branch three, and TestSysInfoPopover/TestSysInfoStaleReads pass 3/3 when run alone. They look environmental (font/image decoding without a display), not a regression.

Not done here

  • Code signing (Apple Developer ID, Authenticode): needs certificates and your money, not code. SECURITY.md now says the installers are unsigned while the update channel is signed, so the gap is at least written down.
  • The plaintext ip-api.com fallback: fixing it properly means a paid HTTPS endpoint or dropping batch lookups — a design decision, documented as a trade-off rather than changed.
  • Performance (terminal frame buffers, monitor polling when hidden, the host tree at hundreds of hosts): needs profiling data to change safely; not touched.
  • CHANGELOG.md: left alone, the release tooling owns it.

Happy to split this into separate PRs if you would rather review them one at a time.

staticcheck's ST1005: these are error strings, and Go style keeps them
lowercase. The one test that pinned the capitalised form follows.
SA4006: rest was set before the switch and reassigned in each case, so
the first value was never read.
ssh.InsecureKeyAlgoDSA is deprecated (SA1019); the wire name it holds is
stable and is what the label switch compares.
SA4000/SA4006: CloseRequested was called twice in the same ||, and the
first deploy.sh lookup was never read.
Open reads a file another machine wrote, so it is the one parser here a
stranger feeds. The seeds cover a real envelope, a truncated one and two
with out-of-range KDF parameters, which must be refused before Argon2id
allocates anything.
Both packages run one goroutine per session; a leak there only shows up
as memory that grows on a long-running app. goleak turns it into a test
failure.
staticcheck and govulncheck cover what go vet does not; the coverage
figure is printed rather than enforced, and the fuzz pass spends 30s on
the sync envelope per run.
Release files now carry GitHub-signed build provenance and an SPDX SBOM
attestation, so gh attestation verify can say this workflow built them.
The SBOM is written before the checksums, so SHA256SUMS covers it.
A pinned dependency is only as safe as how fast it is patched, and this
app holds passwords and speaks SSH.
The list of endpoints the app can reach was only in the source. It is
the project's best argument against the closed-source client it replaces,
and the plaintext ip-api fallback deserves saying out loud.
govulncheck, which this branch adds to CI, found two vulnerabilities the
code reaches: GO-2026-6888 in brotli (reached through x/net while reading
an HTTP body) and GO-2026-6859 in net/http (fixed in 1.27.4). The two
x/net html advisories and the x/crypto/openpgp one were not reachable;
they go with the same upgrade.
@kzhx666 kzhx666 closed this Nov 22, 2026
@kzhx666 kzhx666 reopened this Nov 22, 2026

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.

Harden CI and document the network surface

1 participant