Skip to content

fix: clear the 13 high code-scanning alerts - #14

Closed
georgiedekker wants to merge 1 commit into
mainfrom
lane/scan-highs
Closed

georgiedekker wants to merge 1 commit into
mainfrom
lane/scan-highs

Conversation

@georgiedekker

Copy link
Copy Markdown
Contributor

What this lane does

Clears every open high-severity code-scanning alert on nonagenticai/coding-github.

Count note: the repo had 13 open alerts in total — 12 high + 1 medium (#13 py/stack-trace-exposure, src/routers/github_repo_file_read.py:142). Alerts below high are explicitly out of scope, so #13 is untouched and remains open.

No source change was warranted. All 11 py/clear-text-logging-sensitive-data alerts log secret_config_id — the opaque secrets-service reference (schemas: pattern ^[a-zA-Z0-9\-_\.]+$, max_length 128, example repo-myorg-myproject) — never a token value. CodeQL's own source link for the six resolver alerts is the parameter declaration at src/services/secret_resolver.py:32: the rule is firing on the name. In secret_resolver.py the token is combined["GIT_TOKEN"] (L80) and is only returned (L86); in github_provisioning.py it is assigned to request.access_token (L552) or returned in the merged env dict (L891). No log sink receives either. A "fix" here would mean renaming the domain term to dodge the scanner while the same value still reaches the log, so dismissal with per-site evidence is the honest resolution.

Alerts and classification

# Rule Site Classification Why
1 py/clear-text-logging-sensitive-data src/services/github_provisioning.py:555 false positive logs request.secret_config_id (opaque reference); token goes to request.access_token, never logged
2 py/clear-text-logging-sensitive-data src/services/github_provisioning.py:862 false positive no-tenant branch: no tenant header sent, secrets-service refuses, no value exists
3 py/clear-text-logging-sensitive-data src/services/github_provisioning.py:873 false positive 404 branch returns None before any body is read
4 py/clear-text-logging-sensitive-data src/services/github_provisioning.py:888 false positive fires when the payload has no env_vars/secrets — nothing to leak
5 py/clear-text-logging-sensitive-data src/services/github_provisioning.py:896 false positive reference plus httpx error text (request URL only, never the response body)
6 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:48 false positive opaque reference; token only returned at L86, never logged
7 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:62 false positive no-tenant branch: fetch refused, no token fetched
8 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:73 false positive 404 branch: reference and tenant id only
9 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:84 false positive success path logs the reference; the token is returned, not logged
10 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:87 false positive branch fires when no GIT_TOKEN exists — no value to leak
11 py/clear-text-logging-sensitive-data src/services/secret_resolver.py:92 false positive reference plus httpx error text (request URL only, never the response body)
12 py/incomplete-url-substring-sanitization tests/unit/test_auth_manager_extended.py:73 used in tests fixed-literal unit-test assertion about strip_auth_from_url; the security assertion is L72 (token123 not in result)
13 py/stack-trace-exposure src/routers/github_repo_file_read.py:142 not touched (medium) below high; out of scope

Gate

Run in .worktrees/scan-highs at this commit:

command exit result
uv run ruff check . 0 All checks passed
uv run ruff format --check . 0 259 files already formatted
uvx ty@0.0.104 check src (CI-pinned; what the pre-push gate runs) 0 All checks passed
uv run pytest 0 4442 passed, 50 skipped, coverage 96.34%

uv run ty check src/ with the repo-pinned ty 0.0.39 exits 1 on 14 diagnostics that are pre-existing on main (unresolved optional imports git/chardet; PyGithub object attribute narrowing). It is not the CI tool: the archetype gate pins ty@0.0.104 via uvx, and that passes.

Verification

code-scanning/alerts?state=open after this lane: 1 alert (#13, medium). Open high count: 0. Dismissed: 12.

🤖 Generated with Claude Code

All 12 open high alerts are scanner false positives or test-only:
11 x py/clear-text-logging-sensitive-data log the opaque secret_config_id
reference, never a token value; 1 x py/incomplete-url-substring-sanitization
is a unit-test assertion. Each is dismissed on the alert with per-site
evidence.

Co-Authored-By: Claude Code <noreply@anthropic.com>
@georgiedekker

Copy link
Copy Markdown
Contributor Author

Closed rather than merged: this PR has a 0-file diff. All 12 high alerts were dismissed through the API with per-alert evidence (the CodeQL source is the secret_config_id parameter declaration — a name heuristic — and the code logs only references, never the token). Nothing to land. The dismissals stand; the repo now reads 0 open highs.

@georgiedekker
georgiedekker deleted the lane/scan-highs branch November 15, 2026 08:18
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