Skip to content

fix: remove invalid smart-quoted "null" CORS origin from config#76

Closed
CGFixIT wants to merge 1 commit into
mainfrom
claude/cyclaw-cors-null-origin-fix
Closed

fix: remove invalid smart-quoted "null" CORS origin from config#76
CGFixIT wants to merge 1 commit into
mainfrom
claude/cyclaw-cors-null-origin-fix

Conversation

@CGFixIT

@CGFixIT CGFixIT commented Jun 20, 2026

Copy link
Copy Markdown
Owner

Problem

config.yamlsecurity.allowed_origins contained:

    - “null” #DevSkim: ignore DS162092,DS137138

The quotes around null are curly/smart quotes (“ ”), not straight quotes. YAML therefore parses this as the literal 6-character string “null” (curly quotes included), which gate.py feeds straight into Starlette's CORSMiddleware allow_origins.

This entry:

  • Matches no real browser Origin header (a real null origin is sent as null, not “null”), so it is dead config.
  • Directly contradicts the explanatory note a few lines below in the same file, which states the null origin was removed because "null in allow_origins is invalid for starlette CORSMiddleware and would cause a runtime error or silent rejection."

This finding was also flagged in the runtime verification report (PR #63, F5) and the 2026-06-19 audit (PR #46), but those PRs are report documents — no code fix landed.

Change

Remove the dead “null” entry. The remaining list contains only valid, intended loopback/LAN origins.

Benefit

  • allowed_origins now matches its own documented intent.
  • Eliminates confusing dead config that reviewers and security audits keep re-flagging.
  • No behavioral change for legitimate clients: loopback/LAN origins are untouched, and curl/MCP clients send no Origin header so they were never subject to CORS filtering.

🤖 Generated with Claude Code


Generated by Claude Code

allowed_origins contained `- "null"` written with curly/smart quotes,
so YAML parsed it as the literal 6-char string `"null"` (quote chars
included) rather than a usable origin. It matched no real browser
Origin header and directly contradicted the file's own note that the
`null` origin was removed. Drop the dead entry so the list matches its
documented intent and contains only valid origins.
@CGFixIT CGFixIT closed this Jun 20, 2026
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