Skip to content

Security: inth3shadows/graph-assay

SECURITY.md

Security

Threat model

graph-assay indexes source code it did not write: the public corpus, fixtures, and any repository you point the oracle at. Treat every indexed repository as untrusted input. What runs against it:

  • The tools under test. Every subject indexes in a temporary HOME, with telemetry off and an allowlisted environment (codegraph sees only paths, locale, NODE_OPTIONS and its own CODEGRAPH_* switches; code-graph-rag only PATH, locale and its sandbox HOME), isolated by lib/sandbox.ts, the first of these that works:
    • unshare -rn (Linux with unprivileged user namespaces): no network, but the tool still runs with your user's file permissions.
    • A throwaway Docker container (graph-assay-sandbox:1, built by tools/setup.sh): no network, no capabilities, no new privileges, read-only root, your uid, and only these mounts: the indexed copy (.git included) and the tool's install read-only, the sandbox HOME and the tool's own output dir (codegraph .codegraph, code-graph-rag .graph-assay, code-review-graph's .code-review-graph marker) read-write. A repository that exploits a tool cannot reach the network, read your files outside those mounts, or change the copy the host later runs git and the oracle in (no planted core.fsmonitor, no source file swapped for a link). The host makes each output dir itself, removing a link or file the repository tracks at that path first, and refuses to mount read-write anything that resolves outside the copy (or is the copy). graph-assay refuses the tool's output if it holds anything but plain files and directories (lib/sandbox.ts vet). The output dirs start with a dot, so the SCIP indexers, which run on the copy afterwards, do not read them. This is the path on Ubuntu 24.04, whose AppArmor policy blocks unprivileged user namespaces; do not lift that policy for unshare (it would let any process create user namespaces). Being in the docker group is itself root-equivalent on the host.
    • Neither (macOS, or no image): codegraph, codebase-memory-mcp and code-review-graph run with network access and your file permissions; code-graph-rag refuses to run. GRAPH_ASSAY_ISOLATION=unshare|docker|none picks one explicitly.
  • The SCIP indexers. scip-typescript, scip-python and scip-go type-check the code without running it. scip-java builds the project, which runs that project's build plugins. It therefore runs only inside its Docker image, as your uid, with the repository mounted.
  • Corpus setup. Dependencies install with npm ci --ignore-scripts / npm install --ignore-scripts, so package install scripts do not run.
  • Labelling (labels/, optional) sends call-site snippets and repository excerpts to the model providers you configure (third-party model APIs). Never label a repository whose code may not leave your machine. The labellers' file tools are not confined to the repository copy, so a prompt injection in a corpus file could steer one to read other local files. labels/run.ts therefore refuses to start unless GRAPH_ASSAY_LABEL_SANDBOX=1 says it runs in a container or VM, or --unsafe-host accepts the risk. Labeller processes get a minimal environment, and graph-assay check fails if any committed labelling file contains a home path or a credential pattern (labels/data-scan-test.ts).

Run graph-assay on code you are allowed to share with those tools, in an account without credentials you would not hand to that code. The Docker reproduction (Dockerfile) is the isolated path: no host credentials, tool installs or Docker socket are mounted.

Reporting a vulnerability

Report it privately through GitHub's "Report a vulnerability" form on this repository (Security → Advisories), not in a public issue. Include the affected command, the input that triggers it, and what it lets an attacker do. Expect an acknowledgement within a week.

Out of scope

  • Bugs in the tools under test or in the SCIP indexers: report those upstream. graph-assay's fixtures are the usual way to show them.
  • Wrong or missing edges found by graph-assay. These are its output, not vulnerabilities.
  • Anything that requires an attacker to already control your shell, config files or the CGQA_* / ORACLE_* environment.

There aren't any published security advisories