Skip to content

Harden credential handling in shell snapshots and replay - #44040

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/58274c07c715423241d26ce6dd2c2b4230cf0f64
Sep 9, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/58274c07c715423241d26ce6dd2c2b4230cf0f64

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 9, 2026

Copy link
Copy Markdown

Harden credential handling in shell snapshots and replay

Why

Shell quoting can hide credentials from raw-text checks, and startup files can restore real credentials after the broker replaces them with dummy values.

What changed

  • Decode shell literals without evaluating them and reject snapshots containing credentials in executable source, including aliases, functions, and heredocs.
  • Preserve credential policy overrides, explicit unsets, and aliases whose source variables were removed. Support credential aliases in Zsh tied arrays while rejecting credentials that span array elements.
  • Guard snapshot replay against credential restoration through shell startup files and preserve unrelated ENV settings.
  • Apply Windows environment-key casing rules to credential overrides, suppress unredacted sandbox diagnostics during snapshot capture, and clear inherited environment variables before launching escalated commands.

Testing

Add regression coverage for shell quoting and escaped credentials, Zsh tied arrays, startup-file replay, readonly credentials, policy overrides, and sensitive capture timeout and cancellation handling.

## Why

Shell quoting can hide credentials from raw-text checks, and startup files can restore real credentials after the broker replaces them with dummy values.

## What changed

- Decode shell literals without evaluating them and reject snapshots containing credentials in executable source, including aliases, functions, and heredocs.
- Preserve credential policy overrides, explicit unsets, and aliases whose source variables were removed. Support credential aliases in Zsh tied arrays while rejecting credentials that span array elements.
- Guard snapshot replay against credential restoration through shell startup files and preserve unrelated `ENV` settings.
- Apply Windows environment-key casing rules to credential overrides, suppress unredacted sandbox diagnostics during snapshot capture, and clear inherited environment variables before launching escalated commands.

## Testing

Add regression coverage for shell quoting and escaped credentials, Zsh tied arrays, startup-file replay, readonly credentials, policy overrides, and sensitive capture timeout and cancellation handling.

GitOrigin-RevId: 58274c07c715423241d26ce6dd2c2b4230cf0f64
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/58274c07c715423241d26ce6dd2c2b4230cf0f64 branch from e5a2b73 to ec512d2 Compare September 9, 2026 04:00
@copyberry
copyberry Bot merged commit ec512d2 into main Sep 9, 2026
1 check passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/58274c07c715423241d26ce6dd2c2b4230cf0f64 branch September 9, 2026 04:00
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 9, 2026

This branch was previously deployed

1 inactive deployment
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants