Skip to content

GitHub personal access token is shown in plain text while being typed or pasted into "Set Token for {owner}" #511

Open

Description

@matt-edmondson

What's wrong

The owner token prompt is a generic ImGuiPopups.InputString (ProjectDirector/ProjectDirector.cs:47, opened at L699-L703 with the label "Personal Access Token"), so the token is rendered unmasked while it is typed or pasted.

InputString.ShowEdit in ktsu.ImGui.Popups (the pinned 3.78.0) calls ImGui.InputText(label, ref value, 100, ImGuiInputTextFlags.EnterReturnsTrue). It never sets ImGuiInputTextFlags.Password and offers no way to pass it in. The buffer is also limited to 100 bytes, which leaves little headroom over a 93-character fine-grained PAT and silently truncates anything longer.

Failure scenario

  1. Screen-share, record, or screenshot while the prompt is open.
  2. Paste a github_pat_… or ghp_… token.
  3. The full token is visible in clear text until OK is pressed. With repo scope it grants access to private repositories.

After entry the token is stored carefully, through CredentialCache rather than the app data file. Entry is the only exposure.

Suggested fix / acceptance criteria

  • Collect the token with ktsu.ImGuiCredentialPopups (TokenPopup). It is built on ktsu.CredentialCache, a package ProjectDirector already references, and provides:
    • masked input (ImGuiInputTextFlags.Password)
    • a 4096-byte limit
    • clearing the field on confirm and on dismiss
  • Map the result to GitHubToken.
  • The dev-directory, owner-name and commit-message prompts can stay as InputString.
  • Acceptance:
    • The token prompt never renders its characters.
    • A 200-character token is stored intact.
    • Reopening the prompt shows an empty field.

BuildMonitor has the same problem in its token prompts, filed separately there.

Activity

  1. added
    enhancement
    on Oct 23, 2026
  2. matt-edmondson commented on Oct 25, 2026

    @matt-edmondson
    ContributorAuthor

    Triage

    • Category: Improvement (security hardening of credential entry)
    • Priority: Medium. The PAT is exposed only while it's being typed or pasted, but that matters when screen-sharing or recording. There's also a correctness side: the 100-byte buffer silently truncates tokens longer than 100 bytes.
    • Area: token prompt (ProjectDirector.cs), switch to ktsu.ImGuiCredentialPopups TokenPopup
    • Suggested assignment: ImGui app owner. Do it together with BuildMonitor.
    • Related: BuildMonitor#381 is the same problem in BuildMonitor and wants the same fix. Before adopting TokenPopup, note two open bugs in it: ImGuiCredentialPopups#203 (a 4096-byte credential is cut to 4095) and Bump the ktsu group with 6 updates #202 (two popups with the same title merge). Neither should block this, but Bump the ktsu group with 6 updates #202 matters if more than one token prompt can be open at once.
    • Duplicates / in progress: no open PR covers it.

    Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions