Skip to content

security: add CodeQL C# static-analysis workflow + WebAuthn ceremony review - #409

Merged
M0LTE merged 3 commits into
mainfrom
claude/packet-net-security-testing-quwgjf
Jun 13, 2026
Merged

security: add CodeQL C# static-analysis workflow + WebAuthn ceremony review#409
M0LTE merged 3 commits into
mainfrom
claude/packet-net-security-testing-quwgjf

Conversation

@M0LTE

@M0LTE M0LTE commented Jun 13, 2026

Copy link
Copy Markdown
Collaborator

Two follow-on security tracks after the #405 hardening pass, developed in parallel.

1. CodeQL static analysis (C#)

New .github/workflows/codeql.yml:

  • Runs on [self-hosted, Linux, X64] — zero hosted-runner minutes, per the project rule.
  • Triggers: push + PR to main, a weekly cron (Mon 03:37 UTC, clear of the 02:17 fuzz nightly), and workflow_dispatch.
  • build-mode: manual — Central Package Management + the .slnx solution defeat CodeQL autobuild, so a dotnet build Packet.NET.slnx -c Release is driven between init and analyze, wrapped in the exclusive flock -x /tmp/pdn-ci-heavy.lock (same discipline as fuzz.yml, so it never co-runs with another CPU-heavy workflow on the shared box).
  • Local Release build verified clean, so the CodeQL trace build will succeed.

⚠️ Owner action: SARIF upload to the Security → Code scanning tab requires GitHub code scanning enabled on the repo (GitHub Advanced Security on a private/internal repo). If it isn't enabled, the analyze step will fail. The workflow is correct regardless — it just needs that repo setting to surface results.

2. WebAuthn / passkey ceremony review — no exploitable findings

Read the registration + assertion path end to end (PdnWebAuthnApi, WebAuthnFido2Builder, WebAuthnChallengeCache, the credential store). All high-value WebAuthn failure modes are correctly defended — no source change:

  • Challenge single-use (atomic TryRemove), 5-min TTL off the injected clock, user/session-bound, memory-bounded.
  • Origin / RP-id pinned from config; a spoofed Host can't widen the trusted origins; IP-literal RP-id rejected.
  • Sign-count clone detection checked (library + monotonic) and persisted on success.
  • Credential ↔ user binding enforced with a constant-time compare; registration enforces global credential-id uniqueness; delete is ownership-scoped in SQL.
  • Fails closed everywhere behind a single generic 401 (no oracle); no secrets/PII in logs.

Four non-defect observations recorded for the owner (UV Preferred vs Required policy knob; the username-scoped assert/begin is an inherent passkey-existence oracle in the non-discoverable flow; an unused store method; clone-vs-generic log classification keys off an exception substring). Full write-up in docs/webauthn-review-2026-06-13.md.

Verification

No source compiled (a workflow file + two docs + the plan ledger). Both tracks were built/tested green during development: Release build clean; Packet.Node.Tests 793 passed / 4 skipped. docs/plan.md §17 updated.

https://claude.ai/code/session_01GSRLZXowGYeRieqaevEtBb


Generated by Claude Code

claude added 3 commits June 13, 2026 04:49
Adds .github/workflows/codeql.yml running CodeQL against the C# code on
self-hosted runners (zero GitHub-hosted Actions minutes). Triggers on
push/PR to main, a weekly schedule, and workflow_dispatch.

Uses manual build-mode (CPM + .slnx makes autobuild unreliable) and
wraps the Release build in the EXCLUSIVE box-wide flock, matching
fuzz.yml's CPU-heavy discipline.

https://claude.ai/code/session_01GSRLZXowGYeRieqaevEtBb
…ngs)

Focused security review of the passkey registration + assertion ceremonies
(Fido2NetLib 4.0.0-beta.16): challenge lifecycle, origin/RP-id pinning,
sign-count clone detection, UV/UP enforcement, credential<->user binding,
fail-closed error handling, and log hygiene.

Verdict: no clear, exploitable bug — no source changed. All security-critical
properties are correctly defended and already pinned by existing tests. Four
observations flagged for the owner (UV=Preferred policy knob; username-scoped
assert/begin existence-oracle by design; unused GetAllCredentialIds;
message-substring clone classification) — all policy/clarity, none a defect.

[skip-plan]

https://claude.ai/code/session_01GSRLZXowGYeRieqaevEtBb
Ledger entries for the two follow-on security tracks integrated in this PR:
the CodeQL static-analysis workflow and the WebAuthn ceremony review (no
findings). Per the repo hard rule, the plan is updated in the same PR.

https://claude.ai/code/session_01GSRLZXowGYeRieqaevEtBb
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.

2 participants