bugxhunter 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +41 -0
- package/LICENSE +21 -0
- package/README.md +347 -2
- package/SECURITY.md +121 -0
- package/bin/bugxhunter.mjs +154 -0
- package/bugxhunter-0.5.0.tgz +0 -0
- package/docker-compose.yml +118 -0
- package/package.json +37 -4
- package/scripts/vault-reset.mjs +30 -0
- package/server/dist/attachments.js +67 -0
- package/server/dist/audit.js +123 -0
- package/server/dist/auth.js +248 -0
- package/server/dist/env.js +15 -0
- package/server/dist/errors.js +3 -0
- package/server/dist/github.js +462 -0
- package/server/dist/index.js +783 -0
- package/server/dist/opencode.js +421 -0
- package/server/dist/providers.js +187 -0
- package/server/dist/rag.js +100 -0
- package/server/dist/scx.js +146 -0
- package/server/dist/vault.js +286 -0
- package/web/dist/assets/index-CqhtWJfv.css +1 -0
- package/web/dist/assets/index-DFfqRBl8.js +118 -0
- package/web/dist/claude-logo-ivory.svg +17 -0
- package/web/dist/example-tools.json +1 -0
- package/web/dist/favicon.png +0 -0
- package/web/dist/index.html +20 -0
package/.env.example
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# BugXHunter — copy to .env (docker/setup.ps1 generates these for you).
|
|
2
|
+
# NEVER commit the real .env.
|
|
3
|
+
|
|
4
|
+
# SCX.ai API key (the model provider). Prefer the key vault: set it up in the
|
|
5
|
+
# sidebar after the first start and the key is sealed at rest (passkey +
|
|
6
|
+
# passphrase) instead of sitting here in the clear. If a vault exists, this
|
|
7
|
+
# line is ignored.
|
|
8
|
+
# SCX_API=sk-scx-...
|
|
9
|
+
|
|
10
|
+
# Optional: OpenRouter (https://openrouter.ai/models) as a second provider.
|
|
11
|
+
# Put the key in the vault as OPENROUTER_API_KEY (keys dialog) rather than here.
|
|
12
|
+
# OPENROUTER_API_KEY=sk-or-...
|
|
13
|
+
# Comma list of OpenRouter model ids the AGENT may use (they appear in the
|
|
14
|
+
# Runner's model picker). The Playground sees the whole catalogue regardless.
|
|
15
|
+
# OPENROUTER_MODELS=anthropic/claude-sonnet-4.5,openai/gpt-5
|
|
16
|
+
|
|
17
|
+
# GitHub needs nothing here: "Connect GitHub" in the sidebar signs in to the
|
|
18
|
+
# public BugXHunter GitHub App (read-only). A fork that registers its own app
|
|
19
|
+
# sets its Client ID and slug:
|
|
20
|
+
# GITHUB_CLIENT_ID=
|
|
21
|
+
# GITHUB_APP_SLUG=
|
|
22
|
+
|
|
23
|
+
# There is no password. Sign-in uses the vault's passkey (set up in the UI);
|
|
24
|
+
# until a vault exists the app is open on localhost.
|
|
25
|
+
|
|
26
|
+
# The vault re-locks after this many minutes without a model call or a write
|
|
27
|
+
# to the API (default 120; 0 = never).
|
|
28
|
+
# OPEN_RUNNER_VAULT_IDLE_MINUTES=120
|
|
29
|
+
|
|
30
|
+
# Secret that signs session cookies. Random per setup; set it to keep sign-ins across restarts.
|
|
31
|
+
OPEN_RUNNER_SECRET=
|
|
32
|
+
|
|
33
|
+
# Shared token the sandboxed agent uses to reach runner's SCX key proxy.
|
|
34
|
+
SCX_PROXY_TOKEN=
|
|
35
|
+
|
|
36
|
+
# Optional: host port for the UI (default 8790).
|
|
37
|
+
# OPEN_RUNNER_PORT=8790
|
|
38
|
+
|
|
39
|
+
# Optional: which published images `docker compose pull` fetches — a signed
|
|
40
|
+
# release tag like v1.2.3 (see SECURITY.md), or latest (default).
|
|
41
|
+
# BXH_VERSION=latest
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cintelis
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,348 @@
|
|
|
1
|
-
#
|
|
1
|
+
# BugXHunter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://github.com/cintelis/bugxhunter-runner/actions/workflows/ci.yml)
|
|
4
|
+
[](https://github.com/cintelis/bugxhunter-runner/actions/workflows/codeql.yml)
|
|
5
|
+
[](https://claude.com/claude-code)
|
|
6
|
+
[](https://www.anthropic.com/claude/mythos)
|
|
7
|
+
|
|
8
|
+
The [BugXHunter](https://bugxhunter.com) security-testing agent runner: a web UI for the
|
|
9
|
+
[OpenCode](https://opencode.ai) coding agent, running on open-weight models (GLM-5.3 by default)
|
|
10
|
+
through [SCX.ai](https://platform.scx.ai). The UI follows bugxhunter.com's design system — a
|
|
11
|
+
macOS-style terminal window, the red-team palette (GitHub-dark surfaces with red, amber, cyan and
|
|
12
|
+
green accents) and Fira Code throughout. Started from the `sovgov-poc` chatbot designer.
|
|
13
|
+
|
|
14
|
+
- **Runner** — point it at a project folder and drive OpenCode's `build` (edits + shell) or
|
|
15
|
+
`plan` (read-only) agent. Every file edit and shell command waits for your approval.
|
|
16
|
+
Markdown replies, collapsible tool calls and reasoning, per-turn token counts, and a
|
|
17
|
+
**Changes** view of what the agent edited (git repos only — OpenCode tracks changes via git).
|
|
18
|
+
- **Playground** — chat with any SCX model directly (no agent), with tool-calling, JSON mode,
|
|
19
|
+
an embeddings-backed knowledge base and browser voice.
|
|
20
|
+
|
|
21
|
+
## Screenshots
|
|
22
|
+
|
|
23
|
+
The agent working in a project — live tool calls, reasoning, and a markdown summary:
|
|
24
|
+
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
Point it at any folder; resume past sessions; approve edits and commands as they happen. The key
|
|
28
|
+
vault's state and lock live in the sidebar footer:
|
|
29
|
+
|
|
30
|
+

|
|
31
|
+
|
|
32
|
+
Playground — compare SCX models directly with full generation controls:
|
|
33
|
+
|
|
34
|
+

|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
The quickest way, with Node 22+ installed, is the npm package (OpenCode comes with it):
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
npx bugxhunter # runs the agent on this machine; UI opens at http://localhost:8790
|
|
42
|
+
npx bugxhunter docker # the sandboxed stack instead (needs Docker Desktop): pulls the signed
|
|
43
|
+
# images for this version into ~/.config/bugxhunter/docker and starts them
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
`npm i -g bugxhunter` makes it a plain `bugxhunter` command; `bugxhunter --help` lists the
|
|
47
|
+
options (`--port`, `--dir`, `--no-open`; `docker down|logs|ps`; `vault reset`). The current
|
|
48
|
+
folder becomes the default project. Then, in the sidebar: set up the [vault](#key-vault) with a
|
|
49
|
+
passkey, add your SCX.ai key as `SCX_API`, and [connect GitHub](#github-repositories-read-only).
|
|
50
|
+
The package is published by the release workflow with npm provenance: `npm audit signatures`
|
|
51
|
+
confirms it was built from this repository.
|
|
52
|
+
|
|
53
|
+
## Requirements (from source)
|
|
54
|
+
|
|
55
|
+
- Node 22+
|
|
56
|
+
- OpenCode on `PATH`: `npm install` here provides it, or `npm i -g opencode-ai`
|
|
57
|
+
- An SCX.ai key: in the [vault](#key-vault) (preferred), else `opencode auth login` (choose
|
|
58
|
+
**Other**, provider id `scx`) or `SCX_API` in a `.env` here.
|
|
59
|
+
|
|
60
|
+
## Run from source
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm install
|
|
64
|
+
npm run dev # backend :8790 + web :5190, with hot reload
|
|
65
|
+
npm start # or: the compiled app, the same way `npx bugxhunter` runs it (npm run build first)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Open **http://localhost:5190** (dev) or **http://localhost:8790** (`npm start`).
|
|
69
|
+
|
|
70
|
+
The backend starts its own OpenCode server on `127.0.0.1:8791` (it stops a stale one left on
|
|
71
|
+
that port by a previous run). Everything listens on localhost only. There are no passwords:
|
|
72
|
+
until you set up the [vault](#key-vault) the app is open, and from then on you sign in with the
|
|
73
|
+
vault's passkey.
|
|
74
|
+
|
|
75
|
+
## Docker (sandboxed agent + login)
|
|
76
|
+
|
|
77
|
+
`npx bugxhunter docker` does all of this (any OS). By hand, from a checkout:
|
|
78
|
+
|
|
79
|
+
```powershell
|
|
80
|
+
powershell -File docker/setup.ps1 # once: writes .env — the secrets the two containers share
|
|
81
|
+
docker compose up -d --build # build locally, or `docker compose pull && docker compose up -d`
|
|
82
|
+
# for the published images (set BXH_VERSION in .env to pin a signed release)
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
The images are multi-arch (linux/amd64 and linux/arm64, so Apple Silicon and Graviton run them
|
|
86
|
+
natively). Open **http://localhost:8790** and set up the [vault](#key-vault) in the sidebar: it
|
|
87
|
+
seals your SCX key and turns on passkey sign-in. (`setup.ps1 -CopyScxKey` copies
|
|
88
|
+
the key into `.env` instead, in the clear.)
|
|
89
|
+
|
|
90
|
+
Two containers:
|
|
91
|
+
|
|
92
|
+
| Container | Holds | Network |
|
|
93
|
+
|---|---|---|
|
|
94
|
+
| `runner` | Web UI, login, SCX key, `/scx/v1` key proxy | shared bridge, published on 127.0.0.1 |
|
|
95
|
+
| `agent` | OpenCode, the agent's shell + scan tools, `/workspace` volume | shared bridge — **direct internet** |
|
|
96
|
+
|
|
97
|
+
- The agent's model calls go to `runner`'s proxy with a proxy token; the proxy swaps in the real
|
|
98
|
+
key and only allows `/chat/completions` and `/models`. **The SCX key never enters the agent
|
|
99
|
+
container** — this holds even though the agent has direct internet.
|
|
100
|
+
- Projects live in the `workspace` Docker volume (`/workspace`, a git repo so Changes work). No
|
|
101
|
+
host folders are mounted. Copy a repo in as a snapshot, and results back out:
|
|
102
|
+
|
|
103
|
+
```powershell
|
|
104
|
+
powershell -File docker/copy-in.ps1 C:\code\my-repo # -> /workspace/my-repo (skips node_modules, .env, …)
|
|
105
|
+
powershell -File docker/copy-out.ps1 my-repo C:\temp\my-repo-out
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
(Plain `docker compose cp` also copies in, but leaves files owned by root, so the agent can't edit them.)
|
|
109
|
+
- **The agent has direct internet** so scan tools run at full speed (`nmap`/`ping`/raw DNS work
|
|
110
|
+
via `NET_RAW`). Outbound connections are logged, not restricted — **only point the agent at targets you are authorised to test, and run this on a
|
|
111
|
+
trusted machine/VM.**
|
|
112
|
+
- Both containers run as non-root with `no-new-privileges`; the agent drops all capabilities except
|
|
113
|
+
`NET_RAW` and is limited to 2 CPUs, 4 GB RAM, 512 processes. Shell commands and file edits are
|
|
114
|
+
approved in the UI — that, plus the container/VM boundary and the isolated SCX key, is what
|
|
115
|
+
contains the agent.
|
|
116
|
+
- **Logs** (the audit log of prompts, tool calls and approvals, plus the egress log of hosts the
|
|
117
|
+
agent connected to) live in the `logs` volume, which the agent container can't see. Read them with
|
|
118
|
+
`docker compose cp runner:/logs ./logs`.
|
|
119
|
+
- Port 8790 is published on localhost only. Put TLS (a reverse proxy) in front and set
|
|
120
|
+
`COOKIE_SECURE=1`, `TRUST_PROXY=1` and `ALLOWED_HOSTS=<your domain>` before exposing it to anyone else.
|
|
121
|
+
|
|
122
|
+
## Key vault
|
|
123
|
+
|
|
124
|
+
The SCX key (and any other secret the agent needs) lives in a vault that is **sealed at rest**: on
|
|
125
|
+
disk there is only ciphertext and wrapped keys, so a copied `.env`, volume or container yields
|
|
126
|
+
nothing. Set it up from the sidebar after the first start; it takes a minute:
|
|
127
|
+
|
|
128
|
+
1. **Passkey** — Windows Hello, Touch ID, Android, or a security key. One touch unlocks the vault
|
|
129
|
+
and signs you in; the authenticator's own biometric or PIN is the second factor. It derives a
|
|
130
|
+
secret (WebAuthn PRF) that never leaves the device. Chrome, Edge and Safari 18+; Firefox can't
|
|
131
|
+
do this yet. Open the app as `http://localhost:…`, not by IP.
|
|
132
|
+
2. **Recovery code** — shown once, stored nowhere. Keep it offline. It opens the vault if the
|
|
133
|
+
passkey is lost.
|
|
134
|
+
3. **Backup passphrase** (optional) — a way in on a device without the passkey.
|
|
135
|
+
|
|
136
|
+
The decryption key lives only in the backend's memory, so after every restart, and after
|
|
137
|
+
**2 hours without activity** (`OPEN_RUNNER_VAULT_IDLE_MINUTES`), someone has to unlock it before the
|
|
138
|
+
agent can call a model. **Ctrl+Shift+L** locks it at once. The crypto is symmetric only
|
|
139
|
+
(AES-256-GCM, HKDF-SHA-256, PBKDF2-SHA-256), which keeps it out of reach of a quantum attacker;
|
|
140
|
+
see [SECURITY.md](SECURITY.md#the-key-vault).
|
|
141
|
+
|
|
142
|
+
While the vault is locked, model calls fail with a clear "vault is sealed" message. Without a vault
|
|
143
|
+
the app falls back to `SCX_API` in `.env` or OpenCode's `auth.json`, in the clear.
|
|
144
|
+
|
|
145
|
+
**Sign-in is the same passkey.** Once a vault exists the API needs a session, and the ways in are
|
|
146
|
+
a WebAuthn assertion with one of the vault's passkeys (verified server-side), the backup
|
|
147
|
+
passphrase, or the recovery code. One touch at the sign-in screen signs in and unlocks the vault.
|
|
148
|
+
Keep two passkeys on different devices (keys dialog → add passkey). Lost every factor? Someone with
|
|
149
|
+
access to the server's files runs `npm run vault:reset` (Docker: `docker compose exec runner rm
|
|
150
|
+
/data/vault.json`): the vault and its secrets are gone and the app reopens for a fresh setup.
|
|
151
|
+
Nothing on the network can do that, which is what keeps the lock meaningful.
|
|
152
|
+
|
|
153
|
+
## Other models via OpenRouter
|
|
154
|
+
|
|
155
|
+
SCX.ai is the default provider. To use anything from [OpenRouter's catalogue](https://openrouter.ai/models)
|
|
156
|
+
as well:
|
|
157
|
+
|
|
158
|
+
1. Add your OpenRouter key to the vault as `OPENROUTER_API_KEY` (keys dialog in the sidebar). The
|
|
159
|
+
**Playground** then lists OpenRouter's models under their own heading, addressed as
|
|
160
|
+
`openrouter/<id>`.
|
|
161
|
+
2. For the **agent**, list the ids it may use in `OPENROUTER_MODELS` (comma-separated, e.g.
|
|
162
|
+
`anthropic/claude-sonnet-4.5,openai/gpt-5`), in `.env`. Only those appear in the Runner's model
|
|
163
|
+
picker, as `openrouter/…`. In Docker, both containers read the same variable.
|
|
164
|
+
|
|
165
|
+
The agent never holds the key: its calls go to the runner's `/openrouter/v1` proxy with the proxy
|
|
166
|
+
token, exactly like SCX, in both local and Docker modes. Pricing is OpenRouter's; the Playground
|
|
167
|
+
shows each model's per-token rates.
|
|
168
|
+
|
|
169
|
+
## GitHub repositories (read-only)
|
|
170
|
+
|
|
171
|
+
To review a repository, clone it into the workspace from the sidebar (**clone from GitHub** under
|
|
172
|
+
the project folder). The first time, click **Connect GitHub**: a short code appears, you enter it
|
|
173
|
+
at github.com/login/device, and the runner is signed in. Then **Choose repositories on GitHub**
|
|
174
|
+
opens the app's install screen, where you pick which repositories it may read; the list in the
|
|
175
|
+
dialog refreshes when you come back. Nothing to register, no token to paste.
|
|
176
|
+
|
|
177
|
+
The sign-in is to the public **BugXHunter** GitHub App, which declares only *Contents: read-only*
|
|
178
|
+
and *Metadata: read-only*, so even GitHub will refuse a push with its token. It reaches only the
|
|
179
|
+
repositories you install it on, and you can change that list or revoke the app on GitHub at any
|
|
180
|
+
time. Its tokens expire after eight hours and are refreshed by the runner; the pair is sealed in
|
|
181
|
+
the vault (or, before a vault exists, kept in memory until the runner restarts).
|
|
182
|
+
|
|
183
|
+
A clone lands in `<workspace>/<owner>/<repo>` (Docker: the shared `workspace` volume; locally
|
|
184
|
+
`~/bugxhunter/repos`, or `OPEN_RUNNER_WORKSPACE`) and becomes the project folder. Cloning again
|
|
185
|
+
fast-forwards it and never resets local edits.
|
|
186
|
+
|
|
187
|
+
**The runner does the cloning, the agent gets a working copy.** The token is passed to git as a
|
|
188
|
+
process-scoped header, so it is in neither the command line nor the clone's `.git/config`. The
|
|
189
|
+
agent can read, grep and scan the code (gitleaks over the history included) and edit it locally,
|
|
190
|
+
but nothing in the sandbox can fetch, push, open issues or see any other repository. Pushing
|
|
191
|
+
results back is deliberately not built: findings leave through the UI, not through your GitHub
|
|
192
|
+
account.
|
|
193
|
+
|
|
194
|
+
A fork that wants its own app registers one (device flow on, *Contents: read-only*, installable
|
|
195
|
+
on any account) and sets `GITHUB_CLIENT_ID` and `GITHUB_APP_SLUG`.
|
|
196
|
+
|
|
197
|
+
## Security-testing tools (authorised use only)
|
|
198
|
+
|
|
199
|
+
The agent image ships a standard pentest toolchain for **authorised** testing (your own sites,
|
|
200
|
+
labs, CTFs). Build with `--build-arg SECTOOLS=0` to leave them out.
|
|
201
|
+
|
|
202
|
+
- **Vuln / web:** `nuclei` (templates baked in offline), `httpx`, `katana` (SPA/JS crawler),
|
|
203
|
+
`ffuf` (+ SecLists wordlists in `/opt/wordlists`), `testssl`, `curl`, `openssl`, `subfinder`
|
|
204
|
+
(passive).
|
|
205
|
+
- **Secrets (local, no network):** `gitleaks` — scan copied-in repos and JS bundles for leaked keys.
|
|
206
|
+
- **Raw-socket:** `nmap`, `ping`, `traceroute`, `dig`/`host` (incl. zone transfer).
|
|
207
|
+
|
|
208
|
+
All tools run directly against targets. The agent's `AGENTS.md` tells it to confirm authorisation
|
|
209
|
+
before scanning and to scan only hosts you name.
|
|
210
|
+
|
|
211
|
+
**Making scans fast** (they're slow if done naively):
|
|
212
|
+
- **Scope nuclei templates** — the biggest lever. `-tags cve,exposure` or `-severity
|
|
213
|
+
critical,high,medium` instead of all ~14k templates. Fingerprint with httpx first and target the
|
|
214
|
+
detected stack.
|
|
215
|
+
- **Pre-filter** with katana/httpx and feed only live URLs into nuclei/ffuf.
|
|
216
|
+
- **Tune to the target:** `-c 50 -rl 300 -bulk-size 50 -timeout 5` on a tolerant host; *lower* on a
|
|
217
|
+
CDN/WAF target, where aggression trips rate-limits and is slower.
|
|
218
|
+
- **Run long scans detached**, writing to `/workspace` (`-o result.txt`), and poll the file so an
|
|
219
|
+
aborted turn doesn't lose progress.
|
|
220
|
+
|
|
221
|
+
To fence the agent to a specific lab/target range, add firewall rules on the Docker host or the VM
|
|
222
|
+
you run this in — Docker's bridge NAT doesn't restrict outbound on its own.
|
|
223
|
+
|
|
224
|
+
## Configuration (environment variables)
|
|
225
|
+
|
|
226
|
+
| Variable | Default | Purpose |
|
|
227
|
+
|---|---|---|
|
|
228
|
+
| `OPEN_RUNNER_MODEL` | `scx/GLM-5.3` | Default model for both agents |
|
|
229
|
+
| `OPEN_RUNNER_DIR` | this folder | Default project folder |
|
|
230
|
+
| `OPEN_RUNNER_AGENT_PORT` | `8791` | Port for the OpenCode server |
|
|
231
|
+
| `PORT` | `8790` | Backend port |
|
|
232
|
+
| `SCX_API` | the vault, else `opencode auth login` | SCX key in the clear; ignored once a vault exists (preferred) |
|
|
233
|
+
| `OPENROUTER_API_KEY` | the vault, else unset | OpenRouter key in the clear; prefer the vault item of the same name |
|
|
234
|
+
| `OPENROUTER_MODELS` | unset | Comma list of OpenRouter model ids the agent may use; becomes an OpenCode provider through the proxy |
|
|
235
|
+
| `OPENROUTER_BASE_URL` | `https://openrouter.ai/api/v1` | OpenRouter endpoint |
|
|
236
|
+
| `GITHUB_CLIENT_ID` | the BugXHunter app | A fork's own GitHub App (device flow); `GITHUB_APP_SLUG` names its install page |
|
|
237
|
+
| `OPEN_RUNNER_VAULT_FILE` | `~/.config/bugxhunter/vault.json` | The sealed vault (Docker: `/data/vault.json` on the `runner-data` volume) |
|
|
238
|
+
| `OPEN_RUNNER_VAULT_IDLE_MINUTES` | `120` | Auto-lock after this long without a model call or API write; `0` = never |
|
|
239
|
+
| `OPEN_RUNNER_SECRET` | random per start | Signs session cookies; set it to keep sign-ins across restarts |
|
|
240
|
+
| `COOKIE_SECURE` | unset | `1` marks the session cookie `Secure` (behind TLS) |
|
|
241
|
+
| `TRUST_PROXY` | unset | Behind a reverse proxy: `1` (hop count), `loopback`, or a CIDR list — so the cookie's `Secure` flag and client IPs are right |
|
|
242
|
+
| `OPEN_RUNNER_LOG_DIR` | unset (off) | Folder for the JSONL audit log (Docker sets `/logs`) |
|
|
243
|
+
| `ALLOWED_HOSTS` | localhost only | Extra `Host` header values to accept (comma list), e.g. the domain a reverse proxy serves. Everything else gets 403, which blocks DNS-rebinding attacks |
|
|
244
|
+
| `OPEN_RUNNER_ALLOWED_ROOTS` | any folder | Local mode: folders the UI may open, PATH-style list (`;` on Windows, `:` elsewhere). Set it before sharing the app |
|
|
245
|
+
| `OPENCODE_URL` | unset (spawn locally) | Use a remote OpenCode server (Docker sets `http://agent:4096`) |
|
|
246
|
+
| `OPEN_RUNNER_WORKSPACE` | `/workspace` (local: `~/bugxhunter/repos`) | Remote mode: projects must live under this folder. Both modes: where GitHub clones land |
|
|
247
|
+
| `SCX_PROXY_TOKEN` | unset | Enables the `/scx/v1` key proxy for the sandboxed agent |
|
|
248
|
+
|
|
249
|
+
Releases are on the [releases page](https://github.com/cintelis/bugxhunter-runner/releases).
|
|
250
|
+
See [SECURITY.md](SECURITY.md) to verify one by hand, or to report a vulnerability.
|
|
251
|
+
|
|
252
|
+
## Releases
|
|
253
|
+
|
|
254
|
+
Every published release, newest first. Each is signed with the Cintelis release key;
|
|
255
|
+
`scripts/verify-release.sh` refuses anything that isn't. A release ships an **app** archive (the
|
|
256
|
+
compiled server and web app, runnable with Node and no Docker), a **deploy** archive
|
|
257
|
+
(`docker-compose.yml` and the setup scripts, pinned to that version's images), `images.txt` (both
|
|
258
|
+
GHCR images by digest) and the signed `checksums.txt` that covers them all.
|
|
259
|
+
|
|
260
|
+
<!-- releases:start -->
|
|
261
|
+
| Release | Published | Checksums | Signature | Signature check | Build |
|
|
262
|
+
| --- | --- | --- | --- | --- | --- |
|
|
263
|
+
| [v0.4.0](https://github.com/cintelis/bugxhunter-runner/releases/tag/v0.4.0) | 2026-10-07 | [checksums.txt](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.4.0/checksums.txt) | [checksums.txt.sig](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.4.0/checksums.txt.sig) | ✅ release key | [workflow run](https://github.com/cintelis/bugxhunter-runner/actions/runs/37640130325) |
|
|
264
|
+
| [v0.3.0](https://github.com/cintelis/bugxhunter-runner/releases/tag/v0.3.0) | 2026-10-07 | [checksums.txt](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.3.0/checksums.txt) | [checksums.txt.sig](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.3.0/checksums.txt.sig) | ✅ release key | [workflow run](https://github.com/cintelis/bugxhunter-runner/actions/runs/37636400569) |
|
|
265
|
+
| [v0.2.0](https://github.com/cintelis/bugxhunter-runner/releases/tag/v0.2.0) | 2026-10-07 | [checksums.txt](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.2.0/checksums.txt) | [checksums.txt.sig](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.2.0/checksums.txt.sig) | ✅ release key | [workflow run](https://github.com/cintelis/bugxhunter-runner/actions/runs/37618237000) |
|
|
266
|
+
| [v0.1.0](https://github.com/cintelis/bugxhunter-runner/releases/tag/v0.1.0) | 2026-10-07 | [checksums.txt](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.1.0/checksums.txt) | [checksums.txt.sig](https://github.com/cintelis/bugxhunter-runner/releases/download/v0.1.0/checksums.txt.sig) | ✅ release key | [workflow run](https://github.com/cintelis/bugxhunter-runner/actions/runs/37597898761) |
|
|
267
|
+
|
|
268
|
+
Signature check: `checksums.txt.sig` verified against the release key (`SHA256:RY9yd61LBZCa5WrzSkEet+1Dnt2zVu9zpMRbZMWIV+I`)
|
|
269
|
+
when this table was generated by `scripts/release-table.sh`. To check a download
|
|
270
|
+
yourself, see [SECURITY.md](SECURITY.md#verifying-a-release-yourself).
|
|
271
|
+
<!-- releases:end -->
|
|
272
|
+
|
|
273
|
+
To use a release, verify it first (`scripts/verify-release.sh vX.Y.Z`, see
|
|
274
|
+
[SECURITY.md](SECURITY.md)), then either unpack the deploy archive and run `docker compose pull
|
|
275
|
+
&& docker compose up -d` (its `VERSION` file pins the images), or unpack the app archive and run
|
|
276
|
+
`npm ci --omit=dev && NODE_ENV=production node server/dist/index.js`.
|
|
277
|
+
|
|
278
|
+
## Development
|
|
279
|
+
|
|
280
|
+
```bash
|
|
281
|
+
npm run check # typecheck + lint + unit tests (what CI runs)
|
|
282
|
+
npm run typecheck # tsc, both workspaces
|
|
283
|
+
npm run lint # eslint (typescript-eslint + react-hooks), warnings fail
|
|
284
|
+
npm test # vitest: the pure logic in server/src and web/src
|
|
285
|
+
npm run build # web -> web/dist, server -> server/dist (what the Docker image ships)
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
GitHub Actions: `ci.yml` runs the checks and builds both Docker images on every push and PR,
|
|
289
|
+
`codeql.yml` scans for security issues weekly and on PRs, `docker-publish.yml` pushes the images to
|
|
290
|
+
GHCR (`ghcr.io/cintelis/bugxhunter-runner` and `bugxhunter-agent`) on `master` and on `v*` tags, and Dependabot
|
|
291
|
+
keeps npm, Actions and base images current.
|
|
292
|
+
|
|
293
|
+
Server and browser share one type contract in `shared/` (`agent.d.ts`, `scx.d.ts`): the server's
|
|
294
|
+
event mapping must produce those shapes and the client consumes them, so a change on either side
|
|
295
|
+
fails the other's type-check.
|
|
296
|
+
|
|
297
|
+
## Releasing
|
|
298
|
+
|
|
299
|
+
Bump `version` in `package.json`, then tag and push; the release workflow checks, builds the
|
|
300
|
+
archives and the versioned images with provenance attestations, and creates a **draft**. Then sign
|
|
301
|
+
it with the offline release key, which verifies the draft's attestations and checksums first and
|
|
302
|
+
publishes it:
|
|
303
|
+
|
|
304
|
+
```sh
|
|
305
|
+
git tag -a v1.0.0 -m "BugXHunter v1.0.0"
|
|
306
|
+
git push origin v1.0.0
|
|
307
|
+
# once the workflow finishes (10-15 minutes, the agent image is large):
|
|
308
|
+
scripts/sign-release.sh v1.0.0
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
On Windows, run the signing script from PowerShell through Git Bash:
|
|
312
|
+
`& 'C:\Program Files\Git\bin\bash.exe' scripts/sign-release.sh v1.0.0`.
|
|
313
|
+
It asks for the key's passphrase once. Only admins can push `v*` tags.
|
|
314
|
+
|
|
315
|
+
After publishing, the script regenerates the release table above (`scripts/release-table.sh`)
|
|
316
|
+
and opens a pull request for it that merges itself once CI passes.
|
|
317
|
+
|
|
318
|
+
The tag also publishes the npm package (`npm run pack:npm` assembles it from the same build;
|
|
319
|
+
the workflow's `npm` job publishes it with provenance). That needs the package's **trusted
|
|
320
|
+
publisher** on npmjs.com set to this repository and `release.yml`, once; no npm token is stored.
|
|
321
|
+
|
|
322
|
+
## Layout
|
|
323
|
+
|
|
324
|
+
| Path | Role |
|
|
325
|
+
|---|---|
|
|
326
|
+
| `server/src/opencode.ts` | Starts/stops the OpenCode server, one SDK client per project folder, event mapping |
|
|
327
|
+
| `server/src/index.ts` | Express: `/api/agent/*` (OpenCode) and `/api/chat`, `/api/models`, `/api/kb` (SCX) |
|
|
328
|
+
| `server/src/scx.ts`, `rag.ts` | SCX client and in-memory knowledge base (Playground) |
|
|
329
|
+
| `shared/` | Type contract between server and browser |
|
|
330
|
+
| `scripts/` | `sign-release.sh` (maintainer, offline key), `verify-release.sh` (users), `release-table.sh`, the release public key |
|
|
331
|
+
| `web/src/AgentPanel.tsx` | Runner transcript, approvals and session flow; `DiffModal.tsx` and `QuestionCard.tsx` hold the Changes view and agent questions |
|
|
332
|
+
| `web/src/Sidebar.tsx` | Project folder picker (Runner) and model/prompt settings (Playground) |
|
|
333
|
+
| `web/src/styles.css`, `brand.tsx`, `Terminal.tsx` | bugxhunter.com theme tokens, the `>_ BugXHunter` wordmark, terminal title bar and typed boot sequence |
|
|
334
|
+
|
|
335
|
+
## AI assistance
|
|
336
|
+
|
|
337
|
+
BugXHunter was built with [Claude Code](https://claude.com/claude-code), and the codebase was
|
|
338
|
+
reviewed and hardened by [Claude Mythos 5.1](https://www.anthropic.com/claude/mythos) (bug fixes,
|
|
339
|
+
the security hardening, tests and CI). The app shows this with Anthropic's Claude wordmark, used
|
|
340
|
+
as published. It is a model credit, not an endorsement by Anthropic; the maintainers are
|
|
341
|
+
responsible for the code.
|
|
342
|
+
|
|
343
|
+
## License
|
|
344
|
+
|
|
345
|
+
[MIT](LICENSE) © Cintelis.
|
|
346
|
+
|
|
347
|
+
> BugXHunter ships a security-testing toolchain for **authorised** testing only (your own
|
|
348
|
+
> systems, labs, CTFs). You are responsible for how you use it.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
## Reporting a vulnerability
|
|
4
|
+
|
|
5
|
+
Please report privately through GitHub:
|
|
6
|
+
**[Report a vulnerability](https://github.com/cintelis/bugxhunter-runner/security/advisories/new)**.
|
|
7
|
+
Don't open a public issue for security problems.
|
|
8
|
+
|
|
9
|
+
## How releases are protected
|
|
10
|
+
|
|
11
|
+
- **Signed.** Every release's `checksums.txt` is signed with the Cintelis
|
|
12
|
+
release key, an Ed25519 key kept offline by the maintainer and never
|
|
13
|
+
stored on GitHub. It covers the release archives and `images.txt`, which
|
|
14
|
+
pins both container images by digest. `scripts/verify-release.sh` refuses
|
|
15
|
+
any release whose signature doesn't verify.
|
|
16
|
+
- **Built by CI, with provenance.** Release archives and images are built by
|
|
17
|
+
this repository's release workflow and carry a signed build-provenance
|
|
18
|
+
attestation. The workflow produces a *draft*; the maintainer checks the
|
|
19
|
+
attestations and checksums before signing and publishing it
|
|
20
|
+
(`scripts/sign-release.sh`).
|
|
21
|
+
- **Protected tags.** Only repository admins can create, move or delete
|
|
22
|
+
`v*` tags.
|
|
23
|
+
- **Pinned dependencies.** npm packages are pinned by hash in the lockfile;
|
|
24
|
+
the release workflow's GitHub Actions are pinned to commits; the agent
|
|
25
|
+
image's security tools are pinned to specific versions. CodeQL scans every
|
|
26
|
+
change and weekly, and Dependabot tracks updates.
|
|
27
|
+
|
|
28
|
+
## The key vault
|
|
29
|
+
|
|
30
|
+
API keys and other secrets the app holds are sealed at rest in `vault.json`
|
|
31
|
+
(`shared/vault.d.ts` is the format). What an attacker who copies the file, the
|
|
32
|
+
`runner-data` volume or the whole container gets is ciphertext and wrapped keys.
|
|
33
|
+
|
|
34
|
+
- **One touch, two factors.** The passkey's key-encryption key is HKDF-SHA-256
|
|
35
|
+
over its WebAuthn PRF output (an HMAC computed inside the authenticator; the
|
|
36
|
+
seed never leaves it), and every PRF evaluation requires user verification
|
|
37
|
+
(biometric or PIN) on the device: possession plus something you know or are.
|
|
38
|
+
A recovery code (128 random bits, shown once) and an optional backup
|
|
39
|
+
passphrase (PBKDF2-SHA-256, 600k iterations) are separate ways in, each
|
|
40
|
+
wrapping the same data key.
|
|
41
|
+
- **Symmetric only.** AES-256-GCM, HKDF-SHA-256, PBKDF2-SHA-256 (600k iterations)
|
|
42
|
+
and the PRF. No RSA or elliptic-curve step protects the data, so the design does
|
|
43
|
+
not depend on anything a quantum computer is expected to break; 256-bit
|
|
44
|
+
symmetric keys keep their margin against Grover's algorithm.
|
|
45
|
+
- **The server never sees a factor.** The browser derives the key-encryption key,
|
|
46
|
+
unwraps the data key and hands only that to the backend, which keeps it in memory
|
|
47
|
+
until the vault is locked, the process exits, or `OPEN_RUNNER_VAULT_IDLE_MINUTES`
|
|
48
|
+
(default 120) pass without a model call or an API write. Items are bound to their
|
|
49
|
+
names (AES-GCM additional data), so a ciphertext can't be moved between names.
|
|
50
|
+
- **The agent never sees the key.** In Docker it talks to a key-injecting proxy.
|
|
51
|
+
In local mode the backend removes every secret from its environment before
|
|
52
|
+
OpenCode is spawned, since the agent's shell inherits that environment.
|
|
53
|
+
- **Sign-in is the passkey.** No passwords exist. With a vault present, every API
|
|
54
|
+
call needs a session issued for a WebAuthn assertion the server verified:
|
|
55
|
+
single-use challenge, allowed origin, relying-party hash, user-presence and
|
|
56
|
+
user-verification flags, signature against the public key captured at
|
|
57
|
+
enrolment, and a monotonic counter where the authenticator keeps one. The
|
|
58
|
+
backup passphrase and the recovery code sign in by proving possession of the
|
|
59
|
+
vault key. Without a vault the app is open, on localhost only, behind the
|
|
60
|
+
Host-header guard.
|
|
61
|
+
- **Break-glass is on the server only.** Losing the passkey and the recovery
|
|
62
|
+
code means the secrets are gone; `npm run vault:reset` deletes the vault from
|
|
63
|
+
the server's files and reopens the app for a new setup. No network request
|
|
64
|
+
can do that.
|
|
65
|
+
- **Not covered.** A compromise of the running backend while unlocked exposes
|
|
66
|
+
what it holds in memory; that is inherent to a server that uses the key. Model
|
|
67
|
+
inputs and tool output go to the model provider in plaintext; the vault seals
|
|
68
|
+
secrets, not engagements.
|
|
69
|
+
|
|
70
|
+
## The GitHub sign-in
|
|
71
|
+
|
|
72
|
+
The GitHub integration is read-only on both sides. On GitHub's side, the runner signs in to the
|
|
73
|
+
public BugXHunter GitHub App with the device flow (no client secret exists, so there is nothing to
|
|
74
|
+
leak from an open-source build). The app declares only **Contents: read-only** and **Metadata:
|
|
75
|
+
read-only**, and a user token reaches only the repositories the app was installed on, so GitHub
|
|
76
|
+
itself refuses anything beyond reading those. Revoke it any time under *Settings → Applications*.
|
|
77
|
+
On the runner's side, the token pair lives in the vault like the model keys (in memory until a
|
|
78
|
+
vault exists), is handed to git through a process-scoped config entry (`GIT_CONFIG_*`, so it is
|
|
79
|
+
not on a command line and not in the clone's `.git/config`; credential helpers are disabled so
|
|
80
|
+
nothing caches it), and never reaches the agent. The agent container receives a plain working copy
|
|
81
|
+
in the shared workspace with an `https://github.com/...` origin and no credentials: it can read
|
|
82
|
+
and scan the code, and cannot fetch, push or reach any other repository.
|
|
83
|
+
|
|
84
|
+
## Verifying a release yourself
|
|
85
|
+
|
|
86
|
+
The release public key:
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOCB3IaMc3Lc4JvPv6rWCVLpTjmvvPrhFFPST0NSsypP cintelis-release
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Fingerprint: `SHA256:RY9yd61LBZCa5WrzSkEet+1Dnt2zVu9zpMRbZMWIV+I`
|
|
93
|
+
|
|
94
|
+
It is also published on our domain, so you can cross-check it through a
|
|
95
|
+
second channel: <https://cintelis.ai/.well-known/cintelis-release.pub>
|
|
96
|
+
|
|
97
|
+
The quick way, from a folder holding whatever you downloaded:
|
|
98
|
+
|
|
99
|
+
```sh
|
|
100
|
+
scripts/verify-release.sh v1.2.3
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
By hand:
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
# 1. the checksums are signed by the release key
|
|
107
|
+
echo 'bugxhunter-release namespaces="bugxhunter-release" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIOCB3IaMc3Lc4JvPv6rWCVLpTjmvvPrhFFPST0NSsypP' > allowed_signers
|
|
108
|
+
ssh-keygen -Y verify -f allowed_signers -I bugxhunter-release -n bugxhunter-release \
|
|
109
|
+
-s checksums.txt.sig < checksums.txt
|
|
110
|
+
|
|
111
|
+
# 2. your archives (and images.txt) match the signed checksums
|
|
112
|
+
sha256sum --ignore-missing -c checksums.txt
|
|
113
|
+
|
|
114
|
+
# 3. pull the images by the digests in the signed images.txt, not by tag
|
|
115
|
+
docker pull "$(sed -n 1p images.txt)"
|
|
116
|
+
docker pull "$(sed -n 2p images.txt)"
|
|
117
|
+
|
|
118
|
+
# 4. optionally, they were built by this repository's release workflow
|
|
119
|
+
gh attestation verify bugxhunter-runner_<version>_app.tar.gz --repo cintelis/bugxhunter-runner
|
|
120
|
+
gh attestation verify oci://ghcr.io/cintelis/bugxhunter-runner:v<version> --repo cintelis/bugxhunter-runner
|
|
121
|
+
```
|