develop #57

Merged
marti merged 21 commits from develop into main 2026-11-13 02:06:03 +01:00
Owner
No description provided.
Settings for the audit fixes that follow: TOOL_CALL_RETENTION_DAYS and
AUDIT_RETENTION_DAYS (0 keeps rows forever, the behaviour until now), and
OIDC_ALLOW_UNVERIFIED_EMAIL for IdPs that never send email_verified.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The onRequest hook chose by the raw URL whether a request is under /api/ or /oauth/, but the router percent-decodes before matching: POST /%61pi/auth/login reached the login route with no Origin check and no session. A cross-site form post could sign a visitor into someone else's account or sign them out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Linking an existing account needed email_verified, creating one did not, so on an IdP where users set their own address someone could claim a colleague's before their first sign-in. OIDC_ALLOW_UNVERIFIED_EMAIL restores the old behaviour for IdPs that never send the claim.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Three gaps in rotating ENCRYPTION_KEY:

- Nothing re-encrypted values in bulk, so the previous key could never be removed with confidence. npm run db:reencrypt (dist/db/reencrypt.js in the image) moves every encrypted column to the current key and lists the rows it cannot read.
- One undecryptable value made decrypt throw for a whole list: a user's /api/me/servers answered 500 and their tools/list failed. Such a value now counts as not set and is logged with its ids.
- The one-byte key id let a new key with the same id as the previous one be replaced by it (1 in 256), so everything was encrypted with the old key. Startup now refuses that pair.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Without them a stuck Postgres hung every request and /readyz instead of failing them. Migrations and db:reencrypt keep running without a statement timeout.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Behind a reverse proxy with the default TRUST_PROXY=false every client has the proxy's address, so the per-IP login limit is one bucket: ten bad sign-ins a minute from anyone lock everybody out.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
purgeExpiredSessions was never called, and tool_calls and audit_events had no retention. The 15-minute maintenance pass now removes expired sessions, and rows older than TOOL_CALL_RETENTION_DAYS and AUDIT_RETENTION_DAYS when those are set.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
tool_calls.user_id cascaded, so offboarding an account erased the record of what its agents had called. The column is now nullable with SET NULL and each row stores the caller's email; the admin list shows it with a deleted-user hint. The retention settings are described in the same Governance paragraph.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A process key's HOME and uid-map entry were never removed, so whatever a server cached with a user's credentials stayed on the runner volume forever. Uninstalling a server now forgets all of its keys, and deleting a user calls the new DELETE /users/:userId on the runner.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Following the README left a prod stack that either did not start or was open to the host:

- NODE_ENV=development from a copied .env.example made the API load pino-pretty, which is not in the image, and crash-loop. Compose now pins production.
- The migrate service refuses the dev database password (Postgres is published on loopback, so any local user could log in as the owner).
- MCPHUB_BIND defaults to 127.0.0.1 instead of every interface.
- The runner runs with ISOLATE_UIDS=true (also in the NixOS module), so it refuses to start rather than run every user's process as one uid.
- Postgres has a restart policy and every service a log size cap.

BREAKING CHANGE: an install that still uses POSTGRES_PASSWORD=mcphub must change the role's password before upgrading, and a reverse proxy on another host needs MCPHUB_BIND=0.0.0.0; see docs/deployment.md.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The server configuration and instance-values forms were keyed on updatedAt, which changes on every install step and connection error while the page polls, so typed input (a secret, mostly) was wiped. They are keyed on their content now.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A click outside or Escape closed the dialogs that show a new API token or temporary password exactly once; after a password reset that meant resetting again.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A tab opened before an upgrade asked for chunks that no longer exist and Retry asked for the same file.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Registration is open, so a client could call itself Claude and get the bundled logo on the consent screen. There a brand now needs the redirect or the verified metadata URL on the brand's hosts, or a loopback redirect with a matching name.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
The Logs tab rendered every process buffer on each 3 s poll and remounted all rows once a buffer was full; paged lists refetched every loaded page on each window focus.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
fix(sandbox): keep the host off the runner's network
All checks were successful
CI / check (pull_request) Successful in 2m2s
20075d41e3
An internal bridge has no route out, but the host still held its gateway address, so a sandboxed process that ignored the proxy variables could connect to host services the firewall lets in. Confirmed on Docker 29: sshd on the gateway address answered from a container on such a network.

Compose gives the sandbox network Docker's gateway mode isolated (no host address). The NixOS module does the same on Docker 28+, creates the podman network without DNS (netavark then adds no gateway), and drops everything from runner.subnet in the host firewall. The VM test probes the gateway address; it fails against the previous module.

BREAKING CHANGE: the compose prod profile needs Docker Engine 28 or later; podman-compose refuses the network option (see docs/deployment.md).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
docs: state the Docker Engine 28 requirement of the prod profile
All checks were successful
CI / check (pull_request) Successful in 1m19s
643daf9cb0
It was a sentence inside the network explanation. It is now a Requirements section with what each engine does (28+, 27.x, 26 and older, podman-compose) and what to do, an upgrade note, and a line in the README quick start.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A token whose key is gone still read as connected, so the server stayed ready and every call failed without telling the user to sign in again. The state now checks that the app holds the ciphertext's key, and a token that fails to decrypt when used is marked.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A per-user home outlived its reason whenever a user merely lost access, a server changed between shared and per-user, or a delete happened while the runner was unreachable. The API now lists the runner's keys (GET /keys), uninstalls servers that are gone and forgets the keys the database no longer backs (POST /keys/forget), every 15 minutes and shortly after access, server and user changes.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
test(nix): cover nftables and an old Docker in the sandbox VM tests
All checks were successful
CI / check (pull_request) Successful in 2m5s
caaddc388c
The module's nftables rule and its fallback for a Docker too old for gateway mode isolated had never run. Three more VM tests boot them (docker-nftables, podman-nftables, docker25), and every variant now shows the firewall rule is what closes the host: closed with it, open once it is removed.

The engine table in the deployment guide is now from runs of Docker 29, 27, 26 and 25 and of Podman 6 with podman-compose and with docker-compose on its socket. The last one is new: Podman's Docker API drops the option silently and the host keeps its address.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Merge pull request 'fix: close the 20 findings of the security and reliability audit' (#56) from feature/audit-fixes into develop
All checks were successful
CI / check (push) Successful in 1m59s
CI / check (pull_request) Successful in 1m46s
0086f0eac6
marti merged commit fc7ca98001 into main 2026-11-13 02:06:03 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marti/mcphub!57
No description provided.