Skip to content

Security: doxuta/nexus

SECURITY.md

Security

Nexus lets AI agents change business apps. Most of what can go wrong is therefore an agent, or someone steering one, doing more than the person it works for. This page is the threat model for that: who can do what, the trust boundaries, prompt injection, the human gate, and the known gaps. It describes main at d300dfc. There are no releases, so fixes land on main. Paths that start with internal/, cmd/ or scripts/ are under nexus-platform/, and every code link is pinned to that commit.

Reporting a vulnerability

Report it privately through GitHub: on this repository's Security tab, choose Report a vulnerability. That opens a private security advisory. Please do not open a public issue or pull request. Say which credential you used, what you reached, and how; a request and its response help most. The fix and the disclosure are coordinated in the advisory.

Who can do what

Actor Credential Can Bound by
Builder JWT. "Builder" is admin plus the platform-operator flag, both read from the live user row on every request (internal/metaversion/context.go:55-59, internal/middleware/auth.go:295-313) everything in their tenant, including the builder-only routes: schema, layouts, the AI builder, API keys and MCP keys (internal/handlers/router.go:474-482, internal/handlers/router.go:637-643, internal/middleware/platform_operator.go:89-96) the tenant filter; skips entity and row ACL (internal/middleware/acl.go:105-112)
Customer admin JWT, admin without the operator flag governance: users, roles, teams, audit, field ACL, rules, reports (internal/handlers/router.go:491-540, internal/handlers/router.go:609-610) the tenant filter; skips ACL; on a delivered project writes live, with a history entry (internal/services/draft_gate.go:53-60, internal/services/version_recorder.go:137-139)
Rep (staff) JWT; a user holds one role (internal/ai/tools_access.go:17-19) records and the ⌘K assistant (internal/handlers/router.go:796-808) entity ACL, row scope, field ACL
Builder in a customer workspace workspace-session token, re-resolved on every request acts as admin and builder in the customer tenant (internal/middleware/auth.go:205-213, internal/middleware/auth.go:283-287) refused on its home account's self-service routes (internal/middleware/workspace_session.go:13-18) and for MCP keys (internal/services/mcp_token_service.go:95-100)
Preview as a role preview token reads, as one role no writes, no ⌘K (internal/middleware/preview_readonly.go:22-33)
In-app builder agent none of its own: it runs inside the builder's chat request (internal/handlers/router.go:616-617) the builder's read and propose_* tools proposals only (ADR 0003)
⌘K assistant none of its own: it runs inside the user's request reads under that user's ACL; proposes record drafts (internal/ai/assistant_tools.go:1-16) the user confirms every draft
Outside agent over MCP nxm_ key the builder's read and propose_* tools, at /mcp only, as the builder who issued the key (internal/mcpserver/mcpserver.go:1-7) at most 8 hours, re-checked on every request (internal/services/mcp_token_service.go:18-28)
API key nxk_ key the record API as one role never admin, never /admin/* (internal/services/api_key_service.go:21-40); 403 at /mcp (internal/mcpserver/mcpserver.go:84-88)

Trust boundaries

Prompt injection

Text an agent reads can carry instructions. Two sources matter:

An injected model can:

It cannot:

The human gate and its limits

Every agent change is a card. A human applies it through the same admin APIs as the manual builders, with their own session (nexus-web/lib/aiApply.ts:1-5), and a draft-class change then needs a publish. The limits:

  • The confirm is a client rule. The server cannot tell a card from a click, and anyone holding the builder's session can skip it.
  • "Apply all" applies every draft-class card in one click (nexus-web/lib/aiApply.ts:363-395). A card's text comes partly from the model; an access card names its tables from the registry, never from the model (internal/ai/tools_access.go:258-282).
  • PUT /admin/roles/:id has no version, so an edit made between an access card's read and its write is lost (nexus-web/lib/aiApply.ts:251-253, #23).
  • Admins skip ACL, so testing as the builder proves nothing about the rep (AGENTS.md:33-34).

Known gaps

  • Access follow-ups (#23). A hidden-new table is still reachable through N-N Link and ListLinked and through ?expand, with a crafted call and an approved grant. PUT /admin/roles/:id is unversioned.
  • 404 instead of 403 (#18). A record the rep can read but not edit answers PUT with 404. Existence is not leaked, but the reason is misstated.
  • The cutoff's second. Metadata timestamps have second precision. A version's cutoff names the newest definition it read (#19), and every schema writer waits for a running publish (#13), so a table born later in the same second, or still uncommitted when the publish reads, stays hidden. Both assume one clock: a writer on a replica whose clock runs behind the publisher's can stamp a table at or before a cutoff already written, and the customer sees it with no publish.

There aren't any published security advisories