Skip to content

fix: clear the CodeQL findings on the scanner's own code - #66

Merged
bgard68 merged 1 commit into
mainfrom
fix/codeql-zero
Aug 24, 2026
Merged

fix: clear the CodeQL findings on the scanner's own code#66
bgard68 merged 1 commit into
mainfrom
fix/codeql-zero

Conversation

@bgard68

@bgard68 bgard68 commented Aug 24, 2026

Copy link
Copy Markdown
Owner

The Security tab showed 17 open code-scanning alerts — on a security tool. Sixteen are fixed here; the seventeenth is deliberate and gets dismissed with its reason written down, which is what a triage is.

Alerts Rule Resolution
2 × medium cs/log-forging The request-supplied file name was logged verbatim on the OpenAI failure paths. Console sinks render text lines, so an embedded \n forges a log entry. Control characters stripped once at the top of ExplainAsync.
1 × warning cs/dereferenced-value-may-be-null Handlers used request! after the shared validator established non-null where the analyzer cannot see it. The null test now lives at each call site, the helper takes non-null, every ! on the request is gone — the compiler proves what the assertion used to claim.
1 × note cs/nested-if-statements Flattened to one condition.
12 × note cs/path-combine Eval/test fixture paths moved to Path.Join.
1 × note cs/catch-of-all-exceptions Dismissed, not changed: /api/github/status exists to convert any failure — HTTP, JWT signing, key parsing — into a structured "not connected" status. Narrowing the catch means the next unanticipated exception type turns a status probe into a 500.

Also of note: zero Dependabot vulnerabilities, zero secret alerts, zero advisories — the 17 badge was all CodeQL.

204 tests pass, 0 warnings. Alerts auto-close on the next CodeQL analysis of main.

A security tool with open static-analysis findings on its own repository is
making the argument against itself. Sixteen of seventeen are resolved here; the
seventeenth is a deliberate design, dismissed with the reason recorded rather
than silenced.

Log forging (2, medium): the workflow file name arrives in the request and was
logged verbatim on the OpenAI failure paths. Structured sinks keep it a
property, but console rendering is a text line, and one embedded line break is
enough to forge a log entry. Control characters are stripped once, at the top.

Possible null dereference (1, warning): handlers passed request! after
ValidateWorkflowRequest had established non-null somewhere the analyzer cannot
see. The null test now lives at each call site where the compiler can see the
proof, the helper takes a non-null request, and every null-forgiving operator
on the request is gone.

Nested ifs (1, note): flattened to one condition in the API-key middleware.

Path.Combine (12, note): the eval and test fixture paths move to Path.Join,
which does not silently discard the base when a later segment is rooted.

204 tests pass, 0 warnings.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@bgard68
bgard68 merged commit dd0ee95 into main Aug 24, 2026
10 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.

1 participant