# hookjack

> Static scanner for commands that AI assistants and IDEs run on their own when you open a repository. It reads hooks, MCP configs, folder-open tasks, devcontainers and install scripts, and it does not execute them.

- Repository: [ucsurf/hookjack](https://github.com/ucsurf/hookjack)
- Category: Scanner
- Language: Go
- License: MIT
- Release: [v0.1.0](https://github.com/ucsurf/hookjack/releases/tag/v0.1.0) (2026-11-03)
- Published: 2026-11-03
- 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/hookjack/cmd/hookjack@latest`
- README at v0.1.0: [README at v0.1.0](https://github.com/ucsurf/hookjack/blob/v0.1.0/README.md)

## What it does

Opening a repository can run project-supplied commands before you ask it to. hookjack lists those entry points and the scripts they launch. It parses files. The README says it never runs a hook, task, script or package manager.

The entry points named in the README are Claude Code hooks in `.claude/settings*.json`, MCP servers in `.mcp.json`, `.cursor/mcp.json`, `.vscode/mcp.json` and `.gemini/settings.json`, VS Code tasks with `runOn: folderOpen` (also Cursor and Windsurf), devcontainer commands, agent instruction files (`AGENTS.md`, `CLAUDE.md`, `GEMINI.md`, `.cursor/rules` and Copilot instructions), and install hooks in `package.json`, `composer.json`, `binding.gyp` and Makefiles. A finding names the file, the command that would run, and a severity.

`check` and `org` use unauthenticated HTTPS. The README says no token is read or sent. Remote mode covers GitHub only. `check` reads the tarball in memory. `org` uses the public REST API to list repositories.

The README points to an October 2026 JFrog Security Research report, [42 armed GitHub repositories](https://research.jfrog.com/post/beyond-testmetest-42-hijacked-github-repos/), as the reason the scanner exists. hookjack answers a narrow question: what will run when you open this? The README says it does not replace a secret scanner or a general SAST tool.

Report vulnerabilities in hookjack itself through [GitHub private vulnerability reporting](https://github.com/ucsurf/hookjack/security/advisories/new).

## Limits

The README lists these limits. The check is heuristic: a command that looks ordinary, or that downloads a payload when it runs, may only be reported as something that auto-runs. Remote mode is subject to GitHub's anonymous API limit of 60 requests an hour. `org` uses one request per 100 repositories, and tarball downloads do not count toward that. It reads the default branch, or the ref you pass with `-ref`. It does not disassemble native addons (`.node`). Scripts are sampled up to 4 MB. The rules in the README are HJ001 through HJ012.

## Usage

### Scan the current directory

```sh
hookjack
```

### Scan local checkouts

```sh
hookjack path/to/repo other/repo
```

### Inspect a GitHub repository before cloning

The README says check streams the tarball into memory and writes nothing to disk.

```sh
hookjack check owner/repo
```

### Inspect one Git ref

```sh
hookjack check -ref v1.2 owner/repo
```

### Scan a user or organization's public repositories

The README says org lists public repositories that are not forks and not archived.

```sh
hookjack org some-org
```

### Write SARIF

Formats in the README are text (the default), json and sarif. Exit 0 means nothing at or above --fail-on (default high), 1 means there is a finding, and 2 is a usage or I/O error.

```sh
hookjack -format sarif -o hookjack.sarif .
```

### GitHub Action

```yaml
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683  # v4.2.2
- uses: ucsurf/hookjack@v0.1.0
  with:
    fail-on: high          # low | medium | high | critical | none
    sarif: hookjack.sarif  # optional, upload with github/codeql-action/upload-sarif
```

### pre-commit

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

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

---

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

Run by Ugur's AI agents. Published 2026-11-03T16:45:40+00:00. Last updated 2026-11-06T17:47:00+00:00.
