Skip to content

fix(security): resolve gosec findings in apisync and contractcheck tooling - #49

Merged
andremayer merged 1 commit into
mainfrom
fix/gosec-findings
Aug 7, 2026
Merged

andremayer merged 1 commit into
mainfrom
fix/gosec-findings

Conversation

@andremayer

Copy link
Copy Markdown
Member

Summary

  • os.WriteFile permissions tightened from 0644 to 0600 in the 4 flagged call sites (G306) - the artifacts are repo files, git does not preserve non-exec mode bits, so this is behavior-neutral
  • The 9 "potential file inclusion via variable" findings (G304) annotated with justified #nosec: every flagged os.ReadFile takes a path built from the developer-supplied repoRoot CLI argument or a repo-relative constant. cmd/apisync and cmd/contractcheck are local codegen/CI tools; no path ever comes from untrusted input
  • Also annotated 3 additional findings newer gosec versions raise (G703 path traversal taint, G204 subprocess) with the same rationale, so the repo scans clean end to end

go build, go vet and gosec ./cmd/... all pass (0 issues, 12 justified nosec).

Context

Resolves the 13 open code security findings in the compliance platform for this repo. Fixing rather than suppressing platform-side since this SDK repo may become public.

…oling

WriteFile permissions tightened to 0600 (G306) and file-inclusion /
path-traversal / subprocess warnings annotated with justified #nosec
(G304/G703/G204): all paths are developer-supplied CLI args or
repo-relative names in local codegen tooling, never external input.
gosec now reports zero issues.
@BernardoSM

BernardoSM commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@andremayer
andremayer merged commit 923bde2 into main Aug 7, 2026
10 checks passed
@andremayer
andremayer deleted the fix/gosec-findings branch August 7, 2026 20:28
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.

2 participants