fix(security): close final code-scanning findings + fix Security Heavy fuzz job#480
Merged
Conversation
CodeQL go/clear-text-logging (query_translation.go): stop logging auth.principal entirely. The Basic-Auth username is credential material; the earlier sha256 fingerprint still tripped CodeQL's dataflow. Now no credential-derived value reaches the log in any path — only auth.source (a constant mechanism label). Trusted-proxy enduser.* fields still carry identity for audit. Semgrep httpsconnection-detected (check-vl-ast-coverage.py): replace http.client.HTTPSConnection with urllib.request using the default verified TLS context and a fixed URL. The resulting dynamic-urllib-use-detected (false positive for a constant URL) is added to the security-heavy --exclude-rule allowlist. Security Heavy / fuzz: anchor all -fuzz patterns. -fuzz=FuzzExtractLogPatterns also matched FuzzExtractLogPatternsFromWindowEntries, and Go refuses to fuzz when the pattern matches more than one target. Also adds a fuzz run for the previously-uncovered window-entries target. Verified: go build/test ok, anchored fuzz targets each run standalone, semgrep CI config -> 0 findings on the script.
szibis
force-pushed
the
fix/codescanning-final-two
branch
from
July 22, 2026 19:14
9029de8 to
ff02567
Compare
Contributor
PR Quality ReportCompared against base branch Coverage and tests
Compatibility
Performance smokeLower CPU cost (
State
|
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.
Closes the last two open alerts on the code-scanning page.
1. CodeQL HIGH
go/clear-text-logging—internal/proxy/query_translation.goThe request log no longer emits
auth.principalat all. The Basic-Auth username is credential material read from theAuthorizationheader; the previous sha256 fingerprint still tripped CodeQL's dataflow (it doesn't treat the custom hash as a sanitizer). Now no credential-derived value reaches the log in any path — onlyauth.source(a constant mechanism label likebasic_auth). Trusted-proxyenduser.*fields still carry identity for audit.Test updated:
TestRequestLogger_DoesNotLogBasicAuthPrincipalasserts the principal never appears (default and-debug-log-raw-queries), and neither username nor password leak.2. Semgrep
httpsconnection-detected—scripts/check-vl-ast-coverage.pyReplaced
http.client.HTTPSConnectionwithurllib.requestusing the default verified TLS context and a fixed, non-user-controlled URL. The resultingdynamic-urllib-use-detected(a false positive for this constant URL) is added to the existing Semgrep--exclude-ruleallowlist insecurity-heavy.yaml.Verification
go build ./...✅,go test ./internal/proxy/✅semgrep scanwith the CI config (p/default+ owasp + secrets) + the new exclude → 0 findings on the script ✅3.
Security Heavy / fuzzjob (was failing on main)go test -fuzz=FuzzExtractLogPatternsrefused to run — the unanchored pattern also matched the newerFuzzExtractLogPatternsFromWindowEntriestarget, and Go's-fuzzmust match exactly one. All-fuzzpatterns are now anchored (^...$), and the previously-uncovered window-entries target is now fuzzed. Verified each target runs standalone.