Skip to content

Harden credential redaction - #3

Merged
xiaohei210509 merged 1 commit into
mainfrom
codex/harden-redaction
Jul 14, 2026
Merged

xiaohei210509 merged 1 commit into
mainfrom
codex/harden-redaction

Conversation

@xiaohei210509

Copy link
Copy Markdown
Owner

What changed

  • Replaced the regex-only scrubber with a structured redaction pass for quoted and escaped JSON, named OAuth/API credentials, Authorization headers, multiline indented values, API keys, JWTs, and compact JWEs.
  • Sanitized combined CLI stdout and stderr before display.
  • Prevented malformed or unrecognized auth.json values, including unknown auth_mode strings, from being reflected into visible status fields.
  • Required exit code 0 plus an exact standalone Logged in using ChatGPT line before reporting a valid login.
  • Added adversarial redaction and service-level tests.
  • Made release notes come from the matching changelog section, updated macOS Gatekeeper guidance, and hardened resource/signature verification in the build script.

Why

A Reddit reviewer correctly identified redaction as the highest-risk claim in the app. The original implementation used three broad regular expressions and did not exercise multiline values, stderr, escaped JSON, malformed auth files, or changed CLI wording. Unknown auth_mode values could also be reflected verbatim.

User impact

The UI now has substantially stronger defense-in-depth against credential disclosure while preserving useful diagnostic structure. Unsupported authentication modes use fixed localized text instead of displaying untrusted values. Login status is less likely to be spoofed by negative or failing CLI output.

Redaction remains best-effort. Arbitrary same-indentation continuation lines without a structural boundary are intentionally not claimed as covered because consuming them would also hide unrelated diagnostics.

Validation

  • swift test --scratch-path /tmp/CodexLoginManager-final-tests --disable-index-store -j 1: 45/45 passed
  • RedactorTests: 38/38 passed
  • ./script/build_and_run.sh --verify
  • APP_BUILD=999 ./script/package_release.sh 1.0.0-beta.2
  • ZIP SHA-256 verification
  • strict ad-hoc code-sign verification
  • universal x86_64 arm64 architecture verification
  • English and Simplified Chinese resource verification
  • YAML, shell syntax, plist, whitespace, and sensitive-information scans

@xiaohei210509
xiaohei210509 marked this pull request as ready for review July 14, 2026 11:45
@xiaohei210509
xiaohei210509 merged commit 9761e06 into main Jul 14, 2026
1 check passed
@xiaohei210509
xiaohei210509 deleted the codex/harden-redaction branch July 14, 2026 11:46
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