Skip to content

fix(security): land CORS warn-on-malformed + '*' wildcard fail-closed (F-8 follow-up, card 0aa14d62) - #304

Merged
SabaTech-dev merged 3 commits into
mainfrom
fix/f8-cors-warn-land
Nov 11, 2026
Merged

SabaTech-dev merged 3 commits into
mainfrom
fix/f8-cors-warn-land

Conversation

@SabaTech-dev

Copy link
Copy Markdown
Owner

Landing the two residual F-8 CORS commits from stale branch (never merged, no PR, heavily diverged from main) cherry-picked onto current origin/main:

  • c5027a9 fix(security): warn on malformed CORS_ORIGINS + benign normalization (F-8) — cards a23bb749, 94969304
  • 89652b3 fix(security): reject CORS_ORIGINS='*' wildcard — fail closed (CVE-2026-68517 pattern) — cards a23bb749, 94969304

Context: core config-driven CORS hardening already landed via merged PR #236 (feature/cors-f8-hardening). PR #106 referenced in card title is CLOSED and unrelated (rate-limit). Branch names in dispatch (feat/cors-config, feat/gh-actions-secrets) do not exist in the repo.

Verification: dashboard/backend/tests/unit/test_cors_hardening.py — 20/20 PASSED (local, fresh py3.12 venv, worktree cors-warn-land).,

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

PR Check Results

✅ Code Formatting: Passed
✅ Linting: Passed
✅ Type Checking: Failed
✅ Tests: Failed

⚠️ Some checks failed. Please review the details above.

@github-actions

github-actions Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

❌ FAIL Trivy Security Scan Results

Severity Count
🔴 CRITICAL 5
🟠 HIGH 81
Total 86

Scans performed:

  • 📁 Filesystem (vulnerabilities, secrets, misconfigurations)
  • 🐳 Backend Docker image
  • 🐳 Frontend Docker image
  • 🏗️ IaC misconfiguration detection

❌ CRITICAL vulnerabilities must be resolved before merge.

📋 View detailed SARIF reports

Download artifacts from this workflow run for full SARIF reports.
Results are also available in the GitHub Security tab.


Trivy v0.71.0 | aquasecurity/trivy

@github-actions

github-actions Bot commented Nov 4, 2026

Copy link
Copy Markdown

PR Check Results

✅ Code Formatting: Passed
✅ Linting: Passed
✅ Type Checking: Failed
✅ Tests: Failed

⚠️ Some checks failed. Please review the details above.

Joker added 3 commits November 11, 2026 15:56
…(F-8) — cards a23bb749, 94969304

- Trim + rstrip '/' per entry (idempotent, never widens allowlist);
  explicit boot WARN listing normalized/discarded entries — fail-closed
  semantics unchanged, only observability added.
- CorsMethodGuardMiddleware: strip access-control-allow-origin from
  actual responses with non-allowed methods (Starlette only enforces
  the method allowlist on preflights).
- Tests: dev-defaults branch (with/without CORS_ORIGINS), negatives
  (disallowed method, unlisted origin -> no aco header), rstrip
  normalization + idempotency + boot WARN assertion.
…26-68517 pattern) — cards a23bb749, 94969304

- _parse_cors_origins: '*' goes to discarded, never to origins (REWORK
  finding: '*' parsed as literal origin -> allow-all via ACAO echo).
- Tests: wildcard preflight in production has no access-control-allow-
  origin; '*' asserted in _cors_discarded + boot WARN lists it.
…odeQL py/incomplete-url-substring-sanitization) — card 0aa14d62
@github-actions

Copy link
Copy Markdown

PR Check Results

✅ Code Formatting: Passed
✅ Linting: Passed
✅ Type Checking: Failed
✅ Tests: Failed

⚠️ Some checks failed. Please review the details above.

@SabaTech-dev
SabaTech-dev merged commit a0d3c6f into main Nov 11, 2026
63 of 67 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.

2 participants