Skip to content

Possibility of leak of infinixbot personal access token

Low
LeSuisse published GHSA-37x5-c537-7vmx Jul 8, 2026

Package

@infinixbot PAT (NixOS/nixfmt)

Affected versions

Before 322602eaab8cf20b5fcaf874d375404ef5a7012e

Patched versions

322602eaab8cf20b5fcaf874d375404ef5a7012e

Description

An unprivileged user could exfiltrate a GitHub personal access token (PAT) by creating a malicious PR. The PAT is for the unprivileged @infinixbot machine user, so the consequence of such a leak would be pretty minor (and looking at past PRs, we're pretty sure it was never leaked).

Root cause:

  1. A PAT (for the @infinixbot user) gets written to disk here:
  2. We evaluate a trusted nix file (sync-pr-support.nix), but pass it an untrusted directory (nixfmtPath) here:
    if ! nix-build "$SCRIPT_DIR/sync-pr-support.nix" -A formattedGitRepo --arg storePath "$baseStorePath" --arg nixfmtPath "$PWD/nixfmt"; then
  3. sync-pr-support.nix imports and (impurely) evaluates the untrusted nixfmtPath here:
    nixfmt = (import nixfmtPath { }).packages.nixfmt;
  4. The untrusted nix file could read secrets using builtins.readFile and extract them via builtins.fetchurl or fetchTarball.

This has been addressed by refactoring sync-pr-support.nix and the relevant orchestration in sync-pr.sh to run the untusted code within a separate pure eval (using flakes). The resulting outPath is then passed to sync-pr-support.nix to run the untrusted executable within a nix sandbox (as before). See #423.

Out of an abundance of caution, we rotated the PAT after the vulnerability was patched.

Severity

Low

CVE ID

No known CVE

Weaknesses

No CWEs

Credits