# SaaS isolation: rootzero fictional demonstration

Download demo.mjs and run:

```sh
node demo.mjs
```

Node.js 24; no dependencies or target argument. The program starts two temporary servers on 127.0.0.1 and closes each after its requests. It uses only fictional in-memory invoices. The demo-* tokens simulate authentication, without real JWT validation or SSO. No customer application or third-party service is contacted.

The API scoping kit supplies four identities, two organisations and eight expected permissions. Each case runs against a handler missing authorisation checks, then a handler checking tenant and role. JSON responses establish which objects were read and which simulated writes occurred. Two additional controls check rejection without a token and with a forged tenant header.

Recorded results: four violations before the fix; eight expectations met after it. These are results of this fictional program, not a measurement of SpectrAI coverage or performance or evidence about your SaaS. This minimal fix does not cover all application authorisation (exports, invitations, sharing, database access, concurrency and other paths).

resultats.json records the actual execution date, Node version, responses, and SHA-256 hashes of the script and fixture. A new execution may change the date and Node version. The script rejects arguments and accepts no external target.

References:
- https://spectr-ai.eu/en/pentest-saas
- https://spectr-ai.eu/en/pentest-api#kit-cadrage
- https://api-security.owasp.org/editions/2023/en/0xa1-broken-object-level-authorization/
- https://api-security.owasp.org/editions/2023/en/0xa5-broken-function-level-authorization/
