Skip to content

feat(security): AST02 supply-chain mitigations#13

Merged
kellenff merged 1 commit into
mainfrom
issue-1
Jul 6, 2026
Merged

feat(security): AST02 supply-chain mitigations#13
kellenff merged 1 commit into
mainfrom
issue-1

Conversation

@kellenff

@kellenff kellenff commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Closes #1.

Four mitigations from the OWASP Agentic Skills Top 10 AST02 entry:

1. Grammar pinning + CI gate

The smacker/go-tree-sitter module is already pseudo-version-pinned to commit dd81d9e9be82, which transitively pins all three grammar bindings (golang, javascript, typescript/typescript). A new go mod verify (pin gate) step in ci.yml runs go mod verify and refuses replace directives in go.mod so any future PR that loosens the pin fails CI.

2. govulncheck

New vuln job in ci.yml runs govulncheck ./... against the Go vulnerability DB. Pinned to golang.org/x/vuln/cmd/govulncheck@v1.1.4 (immutable module tag, not a SHA — Go module tags cannot be moved once published).

3. SLSA re-verify at release

New verify SLSA attestations step in the release job loops over every published tarball and runs gh attestation verify --repo kellenff/yactt against GitHub's attestation store. Fails the release on mismatch — catches an attacker who replaces the attestation between build and publish.

4. Trust-chain documentation

New docs/security.md covers the four trust boundaries (grammar / release / install hook / LSP subprocess) with explicit "what it defends against" and "what it does NOT defend against" sections per boundary, plus an at-a-glance summary table.

Security note on this PR's own workflow changes

Every new run: snippet uses env: for any ${{ }} interpolation. The for tarball in *.tar.gz loop iterates locally-produced artifact names only; no untrusted input is interpolated in a run: block. This follows the OWASP GitHub-Actions-injection guidance flagged on every workflow edit.

Verification

  • go vet ./... — clean
  • go test ./... — all 12 packages pass (cache, contract, domain, id, lsp, mcp, parser, persisted, search, source, store, summarizer, tool, acceptance)
  • go build -trimpath ./cmd/yactt — smoke build OK
  • Both ci.yml and release.yml parse as valid YAML

Files

  • .github/workflows/ci.yml — +43 lines (pin gate + vuln job)
  • .github/workflows/release.yml — +23 lines (attestation verify step)
  • docs/security.md — new, 153 lines

Closes #1.

Four mitigations from the AST02 issue:

1. Grammar pinning + CI gate. The smacker/go-tree-sitter module is
   already pseudo-version-pinned to commit dd81d9e9be82, which transitively
   pins all three grammar bindings (golang, javascript, typescript).
   New 'go mod verify (pin gate)' step in ci.yml runs go mod verify and
   refuses 'replace' directives in go.mod so any future PR that loosens
   the pin fails CI.

2. govulncheck. New vuln job in ci.yml runs govulncheck against the Go
   vulnerability DB. Pinned to golang.org/x/vuln/cmd/govulncheck@v1.1.4
   (immutable module tag).

3. SLSA re-verify at release. New 'verify SLSA attestations' step in the
   release job loops over every published tarball and runs
   'gh attestation verify' against GitHub's attestation store. Fails the
   release on mismatch — catches an attacker who replaces the attestation
   between build and publish.

4. Trust-chain documentation. New docs/security.md covers the four
   trust boundaries (grammar / release / install hook / LSP subprocess)
   with explicit 'what it defends against' and 'what it does NOT defend
   against' sections per boundary, plus an at-a-glance summary table.

All shell snippets use env: for ${{ }} interpolations; no untrusted
input is interpolated in run: blocks (per OWASP Actions-injection
guidance). Verified locally: go vet clean, go test ./... OK, smoke
build OK.
@kellenff
kellenff merged commit c541135 into main Jul 6, 2026
5 checks passed
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.

security: AST02 — Supply chain risk via tree-sitter grammars, LSP servers, and install hook

1 participant