Skip to content

Log sanitizer misses Google OAuth tokens from mounted ~/.gemini creds #92

@bertfil

Description

@bertfil

sanitize_text() in src/core/security.py catches AIza... API keys but not the OAuth tokens that actually live in ~/.gemini/oauth_creds.json, access tokens start with ya29. and refresh tokens start with 1//0. Since docker/run.sh mounts ~/.gemini into the container, if the agent cats that file or a traceback echoes its contents, the tokens land in logs unredacted.

Two regexes would cover it:
(r'ya29\.[A-Za-z0-9_-]{20,}', '[REDACTED_GOOGLE_OAUTH_ACCESS]'),
(r'1//0[A-Za-z0-9_-]{20,}', '[REDACTED_GOOGLE_OAUTH_REFRESH]'),

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions