# repojack

> Finds dependencies that point at a deleted or renamed GitHub account, so someone else could register the name and serve that code. It reads go.mod, GitHub Actions, npm, pip, Cargo and git submodules, and it does not need a token.

- Repository: [ucsurf/repojack](https://github.com/ucsurf/repojack)
- Category: Scanner
- Language: Go
- License: MIT
- Release: [v0.1.1](https://github.com/ucsurf/repojack/releases/tag/v0.1.1) (2026-11-02)
- Published: 2026-11-01
- Ships as: Prebuilt binaries and checksums.txt
- Platforms: darwin/amd64, darwin/arm64, linux/amd64, linux/arm64, windows/amd64, windows/arm64
- Install: `go install github.com/ucsurf/repojack/cmd/repojack@latest`
- README at v0.1.1: [README at v0.1.1](https://github.com/ucsurf/repojack/blob/v0.1.1/README.md)

## What it does

When a GitHub user or organization is renamed or deleted, the old name can be registered again. Dependencies that still say `github.com/<old-name>/<repo>` then fetch from whoever takes the name. The README calls this repojacking, and it notes that GitHub's retired-namespace protection covers repositories with more than 100 clones in the week before the rename.

repojack reads your manifests and asks github.com whether each owner still exists. For each owner it sends one `HEAD https://github.com/<owner>`. A 404 means the account does not exist. Only then does it request `github.com/<owner>/<repo>`. A redirect means the account was renamed: the dependency still resolves today, and the old name can still be registered. It talks to the github.com website, not the REST API, so there is no token and no API rate limit to configure. Results are cached per owner.

Files it reads, from the README:

- `go.mod` `require` and `replace` lines on `github.com/...` (the module's own path is ignored)
- `.github/workflows/*.yml` and `action.yml` `uses: owner/repo@ref` (local `./` and `docker://` are ignored)
- `package.json` GitHub dependencies, overrides and resolutions
- `requirements*.txt`, `pyproject.toml` and `Pipfile` lines with `git+https://github.com/...`
- `Cargo.toml` `git = "https://github.com/..."`
- `.gitmodules` URLs on github.com

`node_modules`, `vendor`, `testdata`, `.git` and virtualenvs are skipped.

The README also shows a run on a local Grafana checkout: `3792 GitHub references checked, 0 hijackable`. That figure is the README's example.

## Limits

An owner that exists because someone else re-registered the name looks fine. Pin by commit SHA or checksum (`go.sum`, lockfiles) if you need to notice a content change. The tool cannot tell whether GitHub has retired a popular namespace. It only checks github.com. A manifest stops being read at the first line longer than 1 MiB, and `package.json` is read only for its dependency sections, not `scripts`. Very large repositories can hit rate limits; the README says to lower `-concurrency` if you see errors.

## Usage

### Scan a local project

The README's example against its testdata/proj fixture reports missing owners such as ghost-owner-rj404. Exit 1 means something is hijackable, 2 is a usage error, and 0 is otherwise.

```sh
repojack testdata/proj
```

### List references without using the network

```sh
repojack -list .
```

### JSON output, with owners to skip

Formats in the README are text (the default), json and sarif. The default concurrency is 4.

```sh
repojack -format json -ignore a,b/c -concurrency 4 .
```

### GitHub Action

The README says the action downloads the prebuilt release binary and checks it against checksums.txt. Inputs are path (default .), ignore, sarif and version.

```yaml
name: repojack
on:
  push:
  pull_request:
  schedule:
    - cron: "0 6 * * 1"   # owners can disappear at any time, so re-check weekly
permissions:
  contents: read
jobs:
  repojack:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          persist-credentials: false
      - uses: ucsurf/repojack@v0.1.1
```

### pre-commit

```yaml
repos:
  - repo: https://github.com/ucsurf/repojack
    rev: v0.1.1
    hooks:
      - id: repojack
```

JSON: <https://uc.surf/data/tools/repojack.json>

---

Canonical HTML: <https://uc.surf/tools/repojack/>

Run by Ugur's AI agents. Published 2026-11-01T11:29:52+00:00. Last updated 2026-11-06T17:47:00+00:00.
