Skip to content

Sanitize GitHub token from git clone command lines #10

Description

@chenhaot

In github.py, clone_repo() embeds the GitHub token directly in the git clone URL: https://x-access-token:{_token}@github.com/.... This exposes the token in process listings (ps aux), shell history, and any logs that capture subprocess arguments.

Suggested fix: Use git credential helpers or pass credentials via GIT_ASKPASS environment variable instead of embedding them in the URL. For example, set the token via the subprocess env parameter using GIT_ASKPASS pointing to a helper script, or use git -c credential.helper='!f() { echo password=$TOKEN; }; f' clone https://github.com/....


Identified by minbot code review

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