Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 48 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Security

If you find a vulnerability in Utopia, please email **security@deeplethe.com** rather than opening a public issue. Include the affected version or commit, the endpoint or component, and steps to reproduce.
*[中文版](SECURITY.zh-CN.md)*

You will get an acknowledgement within a few days. Once a fix is released, the advisory names the reporter unless you ask otherwise.
Utopia is at v0.1. Below are the **known, unresolved** limits — not a vulnerability report,
but the places the design has not reached yet.

## Before you put this on a public network

**Credentials are stored in the clear.** LLM API keys and Ask-the-Data connection strings
are plain text in Postgres (`llm_settings.chat_api_key`, `data_sources.conn_string`). Anyone
who can read the database can read them. Encryption at rest is a 1.0 item; until then, keep
the system and its database inside a trusted network.

**The default database password is `utopia`.** By default the port binds to loopback
(`127.0.0.1:1517`), so nothing outside the host can connect. If you change `UTOPIA_DB_BIND`
to expose it, change `UTOPIA_DB_PASSWORD` in `.env` first.

**A data source is only as safe as its grants.** Registering one is a deployment-level
action, but the connection string reaches every workspace the source is granted to. Grant it
only where that database should be visible, and use a read-only database role in the string
itself — the SQL gate below is defence in depth, not a substitute for least privilege at the
source.

## What is in place

- **JWT signing key generated on first start** — 32 bytes from a CSPRNG, stored in the
database. No deployment shares a default key.
- **`Secure` on session cookies behind TLS** — decided from `X-Forwarded-Proto`, so local
HTTP development still works. Force it with `UTOPIA_COOKIE_SECURE=true` if your proxy
omits the header.
- **Database port bound to loopback** — `127.0.0.1:1517`; the app reaches the database over
the compose network.
- **Optional least-privilege runtime role** — set `UTOPIA_APP_DB_PASSWORD` and
`UTOPIA_MIGRATION_URL`, and the app connects as a role that can only read and write
business tables and append to the ledger, while migrations run as the owner.
- **Data sources reach only granted workspaces** — a registered database is mounted into a
knowledge base only where an explicit grant exists. Before this, any base admin could
mount any registered source, which crossed tenants.
- **Read-only gate on Ask-the-Data** — parser allowlist, read-only transaction, enforced row
limit; three layers, so a statement past the parser still cannot write.
- **Accounts are deactivated, not deleted** — `users.deactivated_at` blocks sign-in while the
ledger keeps that person's decisions attributable.
- **Passwords hashed with argon2.**

## Reporting a vulnerability

Email **security@deeplethe.com** rather than opening a public issue. Include the affected
version or commit, the endpoint or component, and steps to reproduce. You will get an
acknowledgement within a few days, and the release that carries the fix names you unless you
ask otherwise.
2 changes: 1 addition & 1 deletion SECURITY.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ Utopia 目前是 v0.1。下面是**已知的、尚未解决的**限制 ——

## 报告漏洞

请开一个 issue。如果涉及可被利用的细节,先只写复现的最小信息,我们再私下沟通完整内容
请发邮件到 **security@deeplethe.com**,不要开公开 issue。写明受影响的版本或提交、端点或组件、复现步骤。几天内会有回复;带修复的那个版本会在说明里致谢,除非你不希望
Loading