Repository navigation
fix(security): adjudicate the identifier interpolations, lock down the workflow - #16
Merged
Merged
Conversation
- `persist-credentials: false` on checkout (Aikido prio 30). Nothing here pushes, tags or opens a PR, so the token checkout writes into .git/config by default is only an extra thing for a later step — or for the dependency code `go test` runs — to find. - Dropped `id-token: write`. It had no consumer: nothing in this workflow does OIDC to a cloud provider. - `actions/setup-go@v4` -> v5. v4 runs on the node16 runtime GitHub removed; actionlint reports it on main. Same inputs, so a runtime bump only. checkout v4 -> v5 at the same time, matching the rest of the fleet. Verified: actionlint 0 (1 on main), go build, go vet and go test -short -p=1 -count=1 all pass. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Aikido AIK_go_G202 on the insert and update query builders. Adjudicated a false positive: what is interpolated is SQL identifiers — the table name and the two column names — which cannot be bound as query parameters. Neither is request data. tableName comes from the embedding application (a constant, or its own configuration — the same configuration that carries the database DSN, so whoever can set it can already reach the database directly), the column names are this package's own. Every request-derived value is bound with `?` in attempt; Aikido auto-ignored that line for exactly that reason. Per the repo-over-dashboard rule the suppression lives in the source with its reason on the line, not as a dashboard click. Two more sites have the same shape and were not flagged: the select query in New and the CREATE TABLE in Migrate. Left unmarked — silencing lines nothing reported is how a suppression habit starts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical workflow pinning and SQL validation issues remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (4)
What changed in this PR
This PR aims to secure SQL identifier handling and harden the GitHub Actions workflow.
Changes:
- Documents SQL identifier interpolation and adds suppression annotations.
- Restricts workflow permissions and disables persisted checkout credentials.
- Updates checkout and Go setup actions.
| File | Review summary |
|---|---|
sqlrl/sql.go |
tableName remains insufficiently validated before SQL interpolation (critical, 2 votes). The nosec suppressions are invalid on both calls (nit, 2 votes). |
.github/workflows/go.yml |
actions/checkout@v5 and actions/setup-go@v5 remain mutable tags and should be pinned to verified full-length commit SHAs (critical, 2 votes each). |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| # persist-credentials: false — checkout writes a token into .git/config by | ||
| # default and nothing here pushes, tags or opens a PR, so the credential is | ||
| # only an extra thing for a step (or a dependency this workflow runs) to find. | ||
| uses: actions/checkout@v5 |
| # v4 runs on the node16 action runtime, which GitHub has removed — actionlint | ||
| # reports it as "too old to run on GitHub Actions". Same inputs on v5 | ||
| # (go-version-file + cache), so this is a runtime bump only. | ||
| uses: actions/setup-go@v5 |
Comment on lines
+67
to
+70
| // of them is request data: tableName is what the embedding application passes to | ||
| // New (a constant, or a value from its own configuration — the same configuration | ||
| // that carries the database DSN, so whoever can set it can already reach the | ||
| // database directly), and the column names are package-level values this package |
| s.insertQuery = fmt.Sprintf(` | ||
| INSERT INTO %s (%s, %s) VALUES (?, ?) | ||
| `, s.tableName, ColumnKey, ColumnTimeToAct) | ||
| `, s.tableName, ColumnKey, ColumnTimeToAct) // nosec — SQL identifier, not request data (see above) |
molon
approved these changes
Sep 24, 2026
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.


No description provided.