Skip to content

fix(claude-intercept): require per-install auth for local CONNECT proxy - #593

Open
luvs01 wants to merge 4 commits into
devfrom
codex/propose-fix-for-authentication-bypass-vulnerability
Open

luvs01 wants to merge 4 commits into
devfrom
codex/propose-fix-for-authentication-bypass-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Sep 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Close a local-auth bypass where an unauthenticated loopback CONNECT + TLS path allowed callers to reach routed models and consume stored provider credentials without an OpenCodex admission key.
  • Ensure the Claude intercept pair is safe by binding authorization to the CONNECT client rather than inferring trust from loopback location alone.

Description

  • Add a per-install cryptographically-random proxy token with owner-only storage and accessor ensureClaudeInterceptProxyToken (src/claude/intercept/proxy-auth.ts).
  • Require HTTP Basic proxy authentication on CONNECT requests and verify it in constant time before accepting a tunnel, returning 407 on missing/invalid credentials (src/claude/intercept/connect-proxy.ts).
  • Wire the token into startup and client settings so managed Claude Code HTTPS_PROXY URLs carry the credential, and create the token on-demand when starting the intercept pair (src/claude/intercept/runtime.ts, src/claude/desktop-first-party.ts, src/claude/intercept/settings.ts).
  • Harden the managed settings.json write path to owner-only mode (0600) and preserve migration behavior for legacy unauthenticated proxy URLs; update tests and architecture docs to reflect the authenticated transport contract (tests and structure/* edits).

Testing

  • Ran the focused intercept tests with bun test tests/claude-integration/claude-intercept-proxy.test.ts and bun test tests/claude-integration/claude-intercept-settings.test.ts, both passing.
  • Ran the integration scenario bun test tests/server/claude-intercept-integration.test.ts which passed with the authenticated proxy in place.
  • Ran bun run typecheck, bun run structure:check, and bun run privacy:scan, all of which succeeded.
  • Ran the full test suite with bun run test and observed a green run for the executed suite.

Codex Task


Devin Review

@coderabbitai

coderabbitai Bot commented Sep 21, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 6f0d6b36-6d85-46fb-84b4-061119fb2308


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-21T01:30:58.943387Z 5adfffb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Sep 21, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

…en handling

- migrate an owned legacy unauthenticated HTTPS_PROXY env on intercept
  startup so service-style restarts do not strand Claude Code on 407s
- keep status/inspection routes read-only: readClaudeInterceptProxyToken
  never mints; only apply and runtime startup create the token
- publish the proxy token via an atomic no-replace link so concurrent
  creators converge on the single committed value
- update first-party tests, docs guides (en/fr/ja/ko) and structure notes

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
devin-ai-integration[bot]

This comment was marked as resolved.

devin-ai-integration Bot and others added 2 commits September 21, 2026 02:18
…dable reads

- read collapses every failure to null so status routes classify a broken
  token file as stale instead of erroring the request
- ensure re-pins an existing token owner-only before trusting it, and
  publication now goes through the repo's icacls hardener on Windows
- settings.json writes use the hardened atomic writer so the embedded
  credential gets a real per-user ACL off POSIX

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
The macos 1/2 leg failed the lidge-jun#848 Bun-runtime-provenance test at 32.8s
(20s budget) running the stale merge ref's pre-lidge-jun#5402 eight-snapshot
version. Dev commit 24b6a7f (lidge-jun#5402) already replaced it with two
reads plus a direct serialization test for the env-marker matrix; a
fresh merge ref picks that up.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant