Skip to content

[bug] Access tokens are being logged to the console on error #486

@musabshak

Description

@musabshak

Describe the bug

the error logs in v4.6.3 for GH connection are logging the GitHub PAT (credential), which is not ideal

e.g.

[backend] | 2025-09-02T15:18:10.045Z error: [repo-manager] Failed to sync repository github.com/ORG/REPO (id: 7), attempt 1/3. Sleeping for 60s... Error: Error: Failed to clone repository: Cloning into bare repository '/data/.sourcebot/repos/7'...
[backend] | warning: url contains a newline in its username component: https://TOKEN%0A@github.com/ORG/REPO.git/
[backend] | fatal: credential url cannot be parsed: https://TOKEN%0A@github.com/ORG/REPO.git/
[backend] |

To reproduce

Set up a GH connection with a token (PAT) that has a newline at the end (the PAT is invalid in this case but it still should not be error logged ideally)

Sourcebot deployment information

Sourcebot version: v4.6.3

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions