Skip to content

Harden Local Proxy browser origin boundary - #710

Merged
AnthonyRonning merged 1 commit into
masterfrom
codex-maple-proxy-origin-hardening-maple
Jul 28, 2026
Merged

AnthonyRonning merged 1 commit into
masterfrom
codex-maple-proxy-origin-hardening-maple

Conversation

@AnthonyRonning

Copy link
Copy Markdown
Contributor

Security/product policy

This PR makes the smallest policy change needed for #654:

  • New configs, and old configs without an enable_cors field, default browser access off.
  • With CORS off, Maple keeps the saved credential fallback for originless local/native clients but rejects requests carrying browser-controlled Origin or Sec-Fetch-Site headers before the proxy can use that credential.
  • Explicit existing CORS-on configs stay on for compatibility, but Maple's saved credential is never used in that mode. Every inference request must provide its own valid bearer key. This intentionally makes legacy keyless CORS-on clients return 401 until configured with a key.
  • No origin allowlist or consent UI is added; Fence manual proxy startup against logout and account transitions #655 remains separate.

What changed

  • Own the Local Proxy CORS layer so Authorization and SDK-specific headers preflight correctly.
  • Align native/frontend defaults and settings copy with the secure policy.
  • Add router-level tests for blind cross-origin POST rejection, fetch-metadata GET rejection, bearer/SDK header preflight, and credential fallback behavior.

Verification

  • Frontend: typecheck; format; lint (0 errors, 13 existing warnings); 360 tests / 1,312 assertions.
  • Native: Rust lint; 213 tests passed, 1 intentional OCR test ignored; 12 focused proxy tests.
  • Managed stack: OpenSecret, Postgres, Continuum/Tinfoil extended health, billing, and feature flags healthy; local Pro account verified.
  • Exact isolated packaged .app: CORS-on browser requests were 401 without auth and 200 with an explicit test key; CORS-off browser-origin/preflight requests were 403/blocked while originless local saved-credential inference remained 200.
  • Debug .app, DMG, and updater archive bundled successfully; the command stopped only at the expected updater-signing step because this VM has no private release key.
  • Two waves of independent correctness, security/lifecycle, and UX reviews found no remaining high/critical issue.

Fixes #654

Does not include #655.

@AnthonyRonning
AnthonyRonning merged commit 8e7fa46 into master Jul 28, 2026
19 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.

Harden the credential-backed Local Proxy against arbitrary browser origins

1 participant