Skip to content

harden: clear dependency CVEs and top quality-check findings#44

Merged
stxkxs merged 1 commit into
mainfrom
harden/quality-and-security-sweep
Jun 20, 2026
Merged

harden: clear dependency CVEs and top quality-check findings#44
stxkxs merged 1 commit into
mainfrom
harden/quality-and-security-sweep

Conversation

@stxkxs

@stxkxs stxkxs commented Jun 20, 2026

Copy link
Copy Markdown
Member

See the commit message for full details.

Summary

  • Clears all 5 open security advisories (re-locked clean): ws→8.21.0 & form-data→4.0.6 (runtime, via @kubernetes/client-node), vite→8.0.16, esbuild→0.28.1, js-yaml→4.2.0. Overrides live in pnpm-workspace.yaml; read-yaml-file→v2 removes the js-yaml 3.x line. Pins the two @master security-gate actions to commit SHAs.
  • Bounds two no-timeout external-call sites (the REJECT pattern): a default request deadline on the SDK Bedrock messages() path and a 30s HTTP timeout on the operator's AWS clients.
  • Fixes a shared-bucket-policy read-modify-write race, makes unpriced model traffic observable (priceModel/CallEvent.unpriced), removes an aspirational-comment REJECT trigger (ADR 0002), and tidies a hand-rolled string match.
  • Adds tests for the previously-uncovered AWS isolation / partial-failure branches (KMS EncryptionContext, S3 Sid-merge, EventBridge kill-switch) and the SDK messages() orchestration.

Verification

All gates green locally: pnpm test (43 SDK + 19 pricing), prettier, gofmt, golangci-lint ./... (0 issues), go build, operator envtest incl. conformance, changeset valid.

A quality-check sweep plus remediation of the five open GitHub security
advisories. Every gate is green: pnpm lint/typecheck/test, prettier,
gofmt, golangci-lint ./... (0 issues), go build, and the operator
envtest suite including conformance.

─── Supply chain: five advisories cleared ───

Patched transitive versions are forced via pnpm-workspace.yaml overrides
(pnpm 11 reads workspace-level config, not package.json#pnpm, once a
workspace file exists):

  - ws 8.20.1 → 8.21.0           CVE-2026-48779 (memory-exhaustion DoS)
  - form-data 4.0.5 → 4.0.6      CVE-2026-12143 (CRLF header injection)
  - vite 8.0.13 → 8.0.16         GHSA-v6wh-96g9-6wx3, GHSA-fx2h-pf6j-xcff
  - esbuild 0.28.0 → 0.28.1      GHSA-g7r4-m6w7-qqqr
  - js-yaml 3.14.2/4.1.1 → 4.2.0 CVE-2026-53550 (merge-key quadratic DoS)

ws and form-data ship at runtime via @kubernetes/client-node inside the
published @eks-agent/client, so these were live runtime exposure, not
dev-only. read-yaml-file is bumped to v2 (which uses js-yaml 4) so the
vulnerable js-yaml 3.x line drops out entirely; vite is pinned as an
explicit root devDependency to defeat peer-dependency resolution
stickiness. The package.json#pnpm block (peerDependencyRules) moves to
pnpm-workspace.yaml so pnpm config stays single-source.

The security workflow's two @master third-party actions
(aquasecurity/trivy-action, securego/gosec) are pinned to commit SHAs
(v0.36.0 / v2.27.1) — an unpinned mutable ref in the gate itself was a
supply-chain hole.

─── Bounded external calls (two no-timeout sites) ───

packages/sdk bedrock-base.ts: every InvokeModel call now carries a
default request deadline (configurable requestTimeoutMs, default 60s)
even when the caller passes no AbortSignal; a caller signal is combined
with the deadline, earliest fire wins. A deadline fire surfaces as a
TimeoutError and classifies as a retryable Network error, distinct from
a caller-driven Cancelled.

operators/internal/awsclients/clients.go: AWS SDK clients are built with
a 30s HTTP timeout. controller-runtime does not decorate the reconcile
context with a per-call deadline and the default transport sets none, so
a stalled response could otherwise pin a bounded reconcile worker
indefinitely and starve the pool.

─── Correctness & observability ───

platform_kms_s3.go: a bucketPolicyMu serializes the shared
artifacts-bucket-policy read-modify-write in both ensureBucketPolicy and
removeBucketPolicyStatements, so concurrent reconciles
(MaxConcurrentReconciles > 1) can't interleave Get→mutate→Put and drop a
peer tenant's statement.

@eks-agent/pricing gains priceModel() returning {costUsd, priced} so an
unknown model id is observable instead of silently metering as $0;
estimateCost() is unchanged and delegates to it. @eks-agent/core
CallEvent gains an optional `unpriced` flag the SDK sets when a model id
has no pricing entry, so cost dashboards can surface unmetered traffic.

platform_reconcile.go: isNoKindMatch uses apimachinery's typed
meta.IsNoMatchError (with a string fallback) instead of a hand-rolled
substring scan.

─── Docs ───

ADR 0002 and the pricing header no longer claim a weekly Renovate
refresh — the table is hand-curated and the refresh script is a
fail-loud Phase-2 scaffold; the docs now say so.

─── Tests ───

New fakeKMS/fakeS3 cover the cross-tenant-isolation and AWS
partial-failure branches the conformance suite skips (it runs those
clients nil): KMS EncryptionContext + grant idempotency + pagination, S3
Sid-merge preserving a peer tenant's statement while replacing its own,
and NoSuchBucketPolicy → empty doc. A new fakeEventBridge asserts
FailedEntryCount>0 → retryable error so a dropped budget-breach
kill-switch can't regress silently. A new SDK messages() test injects a
fake BedrockRuntimeClient (no module-level SDK mocking) and asserts the
default deadline, emit-once-on-success, the unpriced flag, and
throttling → RateLimit. priceModel gets unit tests.

Also fixes a pre-existing revive lint failure in labels.go (the exported
const block needed a doc comment) that would otherwise block CI.

Co-authored-by: stxkxsbot <275011021+stxkxsbot@users.noreply.github.com>
@stxkxs stxkxs marked this pull request as ready for review June 20, 2026 02:50
@stxkxs stxkxs merged commit dff1aec into main Jun 20, 2026
14 checks passed
@stxkxs stxkxs deleted the harden/quality-and-security-sweep branch June 20, 2026 03:04
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