fix(codex): reject unmanaged account auth homes - #447
Open
hbrodin wants to merge 2 commits into
Open
Conversation
hbrodin
marked this pull request as ready for review
September 4, 2026 06:27
hbrodin
force-pushed
the
fix/issue-441-codex-home
branch
from
September 4, 2026 13:39
489b09b to
d5a1bc9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CODEX_HOMEwhen coop's managed guest config selects ChatGPT keyring authRoot cause
CODEX_HOMEis forwarded only into the interactive SSH session, while the host-side preflight runs in a separate bare SSH command. The preflight therefore validated~/.codex/config.toml, but the wrapper could read an alternate config and fall through to plain Codex, allowingcodex loginto write a plaintextauth.jsonoutside coop's cleanup path. A line-oriented key search also could not distinguish a root TOML setting from a nested key.The managed config now carries a canonical first-line keyring setting. Both guards validate that same structural marker, and the wrapper rejects
CODEX_HOMEbefore inspecting the alternate config.Closes #441.
Testing
prek run --all-filescargo test --workspace(1,116 coop tests and 39 proxy tests)cargo clippy --workspace --all-targets --all-features -- -D warningscargo deny --workspace checkbash -n scripts/guest/codex-account.sh tests/integration.shNot run: VM integration on Firecracker or Lima. This Linux environment has no
/dev/kvmor Firecracker tooling, is not a macOS/Lima host, and no remote integration target was available.