Skip to content

[codex] Address CodeQL findings - #79

Closed
shanguangzai wants to merge 5 commits into
developfrom
codex/codeql-alert-fixes
Closed

shanguangzai wants to merge 5 commits into
developfrom
codex/codeql-alert-fixes

Conversation

@shanguangzai

@shanguangzai shanguangzai commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Addresses the open CodeQL findings surfaced while reviewing #78 and adds a security preflight workflow so pull requests targeting develop are scanned before they are promoted to main.

CodeQL findings reviewed

The URL allowlist findings are valid. The existing checks used substring matching for trusted hosts, and one branch in check_url_available was effectively always true for non-internal URLs. This PR switches those decisions to parsed host/path checks and adds regression coverage for spoofed URLs that contain trusted host strings in the wrong part of the URL.

The Paramiko findings are valid in the sense that the code accepted unknown SSH host keys at every call site. These flows are first-contact DevKit workflows, so strict known-host enforcement would break factory-reset or freshly flashed boards. This PR centralizes the behavior in a DevKit SSH helper, loads system host keys, and keeps the first-contact trust behavior explicit and reusable instead of repeating AutoAddPolicy throughout the code.

The bind-to-all-interface findings are mixed. Some port availability probes can safely use loopback, so those are narrowed. Discovery, netboot, and Docker port-collision diagnostics intentionally need all-interface checks; those known findings are documented and excluded from the preflight gate so new CodeQL findings still fail the PR.

Workflow change

Adds .github/workflows/security-pr-preflight.yml with a non-uploading CodeQL preflight for:

  • pull_request into develop and main
  • push to develop and main
  • workflow_dispatch

The workflow is named Security PR Preflight so it does not conflict with GitHub's default CodeQL setup. It runs the python and actions analyzers with upload: never, parses the generated SARIF locally, and fails the check on new warning/error findings. This keeps repository default setup enabled while still catching issues before changes land in develop.

Validation

This branch was previously deployed

2 inactive deployments
prod — 7943b396 Deployed Jun 19, 2026 by shanguangzai via Promote Tested Latest #245
production — 7943b396 Deployed Jun 19, 2026 by shanguangzai via Resolve Vulcan Config / Resolve Vulcan config #246
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