fix(security): close GitHub code scanning alerts - #223
Merged
Conversation
Remediate the findings uploaded to code scanning (93 gosec + 13 trivy): bound integer conversions, quote retention identifiers, detach background work with context.WithoutCancel, allowlist the backup-test script, and patch x/crypto plus workspace JS advisories. False-positive gosec hits on CLI/operator paths and env-var names are annotated so the next SARIF upload is empty. Docker Engine CVE-2026-33997 is ignored with justification — we only consume the frozen client module. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Santosh kumar <santoshkumarradha@users.noreply.github.com>
CodeQL flagged the three ReadFile sites in installLocal as path injection (user-controlled source). Read only skill.toml / skill.json through os.OpenRoot so the basename is a constant and sibling files cannot be opened. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Santosh kumar <santoshkumarradha@users.noreply.github.com>
santoshkumarradha
marked this pull request as ready for review
September 9, 2026 15:55
Review follow-up: resolve BACKUP_TEST_SCRIPT under the working tree (basename-only was bypassable) and add a json-only local skill install test so the OpenRoot confinement path is covered for both manifests. Signed-off-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Santosh kumar <santoshkumarradha@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clears the open GitHub code scanning alerts from gosec + trivy + CodeQL in a single PR.
The latest
securityworkflow onmainuploaded 93 gosec findings and 13 trivy advisories. Localgosec -exclude G104 ./services/...is now 0 issues. JS/Go dependency advisories that had a patch are bumped; the one Docker Engine CVE that cannot be bumped viago getis documented in.trivyignore.PR CI then reported 3 new high CodeQL alerts (
go/path-injectionon the skills installer). Those reads now go throughos.OpenRootand only the constant namesskill.toml/skill.json.A focused review approved the change. Follow-up: confine
BACKUP_TEST_SCRIPTto the working tree (basename-only was bypassable) and add askill.json-only install test.Related issue
Closes the open code-scanning alerts on
main. They auto-close when this SARIF upload replaces the previous one (after merge, or on this PR’s security job).Changes
Real remediations
int→int32/uint32conversions (db, e2b frame length, docker memory peak)#nosec G201only after thatcontext.WithoutCancel(audit, secrets, LLM cache, key touch, docker cleanup/stop)backup-restore-test.shunder the process working directory beforeexecX-Content-Type-Options: nosniffMkdirAllto0o750; write new.envfiles as0o600os.OpenRoot+ canonical manifest names (CodeQLgo/path-injection)Dependency patches (trivy)
golang.org/x/cryptov0.55.0→v0.56.0(CVE-2026-56855, CVE-2026-78662)hono@4.12.34,@hono/node-server@1.19.15,qs>=6.16.0,body-parser>=2.3.0,prismjs>=1.30.0,postcss-selector-parser>=7.1.3Documented false positives
git/goose/tscwrappers (G304/G204/G703)G101)G404)sha1HMAC (G505) — still required for GitHub-stylesha1=signaturesgithub.com/docker/dockerCVE-2026-33997— daemonplugin installflaw; the Go module is deprecated and frozen at v28.5.2. We only use it as a client.Test plan
gosec -exclude G104 ./services/...→ 0 issuesgo buildforservices/runtime/cmd/af-stackandservices/cli/cmd/af-stackNotes for reviewers
GitHub code scanning alerts close automatically when a later analysis no longer contains them. This token cannot dismiss alerts via the API (
403). After merge, the scheduled/pushsecurityworkflow onmainis what flips them to Fixed.github.com/docker/dockercannot bego get’d to Engine 29.3.1 (module frozen; v29 lives undergithub.com/moby/moby/{client,api}). A full SDK migration is a separate breaking change and still would not ship the daemon plugin-install path.