Skip to content

Model downloads send GITHUB_TOKEN to any URL that contains "github.com" #504

Closed

Description

@sosidudku1

baseHeaders() in src/local-llm/download-attempt.ts:64 decides whether to attach GITHUB_TOKEN / GH_TOKEN with a substring check:

url.includes("github.com") || url.includes("githubusercontent.com")

Any URL with that text anywhere gets the token, for example https://example.com/github.com/model.gguf or a host like github.com.example.net. Custom models accept arbitrary huggingFaceUrl / mmprojUrl values, so a crafted model link in config is enough to send an exported GitHub token to a third-party server. The check also runs before the Hugging Face branch, so a Hugging Face URL whose path contains "github.com" gets the GitHub token instead of the HF one.

The same class of bug was already fixed for HF_TOKEN, which now goes only to Hugging Face hosts via isHuggingFaceUrl().

Suggested fix: parse the URL and compare the hostname exactly (github.com, api.github.com, objects.githubusercontent.com, raw.githubusercontent.com), require https:, and add a test for a lookalike host and a lookalike path.

Found in v0.6.4 (3cbc58f).

Activity

  1. added a commit that references this issue on Oct 3, 2026
    c99d953
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions