# Security test catalog Every security property of a FrontMCP server has a category, and every category has tests. This file is the index: which layer owns a property, the category code its tests carry, and the suites that hold them. Keep it in step with the tests; the rules at the end are what keep the suite meaningful. ## Running the tests ```bash git submodule update --init security-tests # once; needs access to the private repository yarn test:security # the security specs of every project npx nx test sdk # the public suites of the SDK and its security specs node scripts/security-tests.mjs --specs sdk -- -t 'ATK-PUBACC' # one project, with Jest arguments ``` ### Where the tests are The security tests are not in this repository. They live in a private one (`agentfront/frontmcp-security-tests`), included here as the git submodule `security-tests`, so that a request or a script written to get past a check is not public: not before the fix it tests is released, and not afterwards as a collection. Each project's Jest configuration adds `security-tests/specs/` to its roots when the folder exists (`jest.security-specs.js`). With the submodule checked out, `npx nx test ` runs the public suites and the security specs; without it, the public suites only, and `yarn test:security` says that the submodule is missing and exits with 2. What stays in this repository are the functional suites, which hold no attempt: what an option does, what a flow answers. ### CI CI runs the security tests for every push and for every pull request from a branch of this repository (job "Security Tests" in `.github/workflows/push.yml`). The job checks the submodule out at the commit this repository pins, with the secret `SECURITY_TESTS_TOKEN`, a token that can only read that repository. Pull requests from forks and from Dependabot do not have the secret and do not run the job; without the secret the job fails rather than skipping. The logs of that CI are public, so the job runs the tests with `--summary` (`scripts/security-tests.mjs`): every project runs as a child process whose output is discarded, and what is printed is a count per project. No test name, no request, no value and no path reaches the log, and the job uploads no report. A failure is reproduced locally with `yarn test:security`. ## How the tests are organised A request passes through layers, and each has to hold on its own. Test names carry a category code, `ATK--NN`, with the weakness class in the suite title. | Layer | What it guarantees | Where | | --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- | | 1. Sign-in | A token is issued only to the client the user was shown and approved, and only that client can redeem it. | `libs/auth, libs/sdk/src/auth` | | 2. Identity | Who a request speaks for comes only from a verified token, and reads the same on every transport. | `libs/auth, libs/sdk` | | 3. Authorization | Authorities, public access limits, enabled switches and approvals apply on every path to an entry, not only on its list. | `libs/sdk, plugins` | | 4. Sessions and transports | A session's data, answers and streams reach only its owner, and a session that ended stays ended. | `libs/sdk/src/transport` | | 5. HTTP surface | No request ends, wedges or exhausts the server, crosses an origin it should not, or learns its internals. | `libs/sdk/src/server, libs/sdk/src/http-route` | | 6. Governed execution | A script runs only the calls its review and its approvals allow, each once, within its limits. | `plugins/plugin-codecall` | | 7. Local machine and tooling | Another local user, a file in a shared folder or an untrusted project cannot make FrontMCP run, read or write something else. | `libs/sdk/src/shared, libs/cli` | | 8. Background work | A job, a workflow or a subscription acts for the caller who started it, within limits checked before it starts. | `libs/sdk/src/job, libs/sdk/src/event` | | 9. Data surfaces and limits | What a caller reads, matches or keeps is bounded per caller, and tool data is never run as script. | `libs/sdk/src/resource, plugins, libs/uipack` | | 10. Outbound requests and storage | The server fetches only addresses its operator allowed, and each deployment and caller keeps its own keys and files. | `libs/adapters, libs/utils, libs/storage-sqlite, plugins` | The table of categories, with the invariant each one protects, is added here once the release that carries their fixes is out (see the advisory flow). ## Rules for changing the server 1. **A fix comes with its test.** Write the test first and watch it fail against the unfixed code, then fix. A test that passes before the fix is not testing the fix. 2. **Test the layer that owns the property.** A check on a list is not a check on the call: assert the property on the path that acts. 3. **Put the test in its category.** A new class of weakness gets a new `ATK-` and a row in this file. 4. **Prefer invariants to exploits.** A test that states what a secure server answers keeps working as a regression test after the particular path is closed. 5. **Cover the breadth, not the one spelling that was reported:** every transport, every protocol revision, every entry type and every store the invariant applies to. 6. **A test that holds an attempt goes to the submodule.** A request, a token or a script written to get past a check belongs in `security-tests/`, never in `libs/` or `plugins/`. Commit there first, then move the submodule entry in the same pull request as the change it tests (`git add security-tests`). Nothing from the submodule is quoted in a public place: refer to a test by its code and the invariant in this file. 7. **An invariant that does not hold yet is still a test.** It runs as an expected failure and reports itself the moment it starts passing. Which invariants are open is recorded in the private repository, not here.