# Storage security

Source: https://cubibase.com/docs/storage/security

Also available: [Markdown version](https://cubibase.com/docs/storage/security.md) · [llms.txt](https://cubibase.com/llms.txt) · [full site content](https://cubibase.com/llms-full.txt)

Storage reuses the platform’s identity and authorization model. Project isolation, path safety, and token scoping are enforced on the server, not delegated to the client.

## Project and tenant isolation

- The project is resolved from the request host and the API key — a client-supplied project id is never authoritative.
- Physical S3 keys are namespaced by project and bucket uuids; the catalog lives in each project’s own database.
- A key from one project presented to another project’s host is rejected.
- Secret API keys are privileged within their project only: they cannot cross projects, bypass quotas, or skip audit logging.

## Path and key safety

- Logical paths are validated: relative only, no `..` segments, no backslashes, no control characters, no empty or dot segments, no leading or trailing slash.
- Filenames never become S3 keys. The physical key is an opaque platform-generated identifier, so path tricks cannot reach another object.
- Upload policies pin one exact staging key and the exact declared size; a leaked policy cannot write anywhere else or store more bytes than were reserved.
- Staging objects are never publicly downloadable and are cleaned up on expiry.

## Tokens and credentials

- Signed download tokens are scoped to one object and one project, expire quickly, and are verified server-side; tampered or expired tokens fail with `401`.
- AWS credentials never reach clients. The S3 bucket blocks all public access, enforces TLS-only access and server-side encryption, and is reachable only through the engine’s least-privilege IAM role.
- Public buckets expose read-only object bytes — never listings of private metadata, never write paths.

> **important**: Treat secret API keys like database passwords: server-side only. For browser and mobile clients use the publishable key plus end-user JWTs, and signed links for sharing.

## Additional resources

- [API keys](https://cubibase.com/docs/platform/api-keys) Publishable versus secret keys.
- [Downloads and sharing](https://cubibase.com/docs/storage/downloads) Signed links in practice.
