Skip to content

Improve bearer token secret redaction - #36908

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/1e5b10685281dc91d232d619b938bacbadaa47f9
Aug 4, 2026
Merged

Improve bearer token secret redaction#36908
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/1e5b10685281dc91d232d619b938bacbadaa47f9

Conversation

@copyberry

@copyberry copyberry Bot commented Aug 4, 2026

Copy link
Copy Markdown

Improve bearer token secret redaction

Why

Bearer credentials can contain characters outside the previous token pattern or
start with another recognized key prefix. This could leave part of the
credential visible after redaction.

What changed

  • Recognize bearer tokens containing URL-safe and base64-style characters,
    optional padding, and horizontal whitespace after the scheme.
  • Redact bearer credentials before matching narrower OpenAI and AWS key forms so
    the whole credential is replaced.
  • Preserve delimiters following the credential and avoid matching short tokens,
    joined scheme names, or tokens separated by vertical or non-ASCII whitespace.

Testing

Added focused positive and negative cases for the supported token forms and
false-positive boundaries.

## Why

Bearer credentials can contain characters outside the previous token pattern or
start with another recognized key prefix. This could leave part of the
credential visible after redaction.

## What changed

- Recognize bearer tokens containing URL-safe and base64-style characters,
  optional padding, and horizontal whitespace after the scheme.
- Redact bearer credentials before matching narrower OpenAI and AWS key forms so
  the whole credential is replaced.
- Preserve delimiters following the credential and avoid matching short tokens,
  joined scheme names, or tokens separated by vertical or non-ASCII whitespace.

## Testing

Added focused positive and negative cases for the supported token forms and
false-positive boundaries.

GitOrigin-RevId: 1e5b10685281dc91d232d619b938bacbadaa47f9
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/1e5b10685281dc91d232d619b938bacbadaa47f9 branch from 56a780a to bab7c2d Compare August 4, 2026 15:15
@copyberry
copyberry Bot merged commit bab7c2d into main Aug 4, 2026
28 of 30 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/1e5b10685281dc91d232d619b938bacbadaa47f9 branch August 4, 2026 15:16
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 4, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

2 participants