Reporting Vulnerabilities
Two ways to report:- GitHub Security Advisories (preferred) — Create a private advisory. Only maintainers can see it until a fix is released.
- Email — Send details to security@fim.ai with a description, reproduction steps, affected versions, and impact assessment.
security label.
Response Timeline
Scope
In scope
- Authentication and authorization bypass
- SQL injection, command injection, or code execution
- Cross-site scripting (XSS) or cross-site request forgery (CSRF)
- Credential or API key exposure
- Privilege escalation between users or organizations
- Data leakage across tenant boundaries
Out of scope
- Vulnerabilities in third-party dependencies (report upstream; we monitor via Dependabot)
- Social engineering attacks
- Denial of service (DoS) without a realistic attack vector
- Issues in the demo/cloud environment that don’t affect self-hosted deployments
Self-Hosted Security Best Practices
If you are running FIM One on your own infrastructure, follow these recommendations to harden your deployment.
| Run code execution in sandbox containers | Keep
CODE_EXEC_BACKEND=docker (the default of the bundled docker-compose.yml). local runs users’ code inside the application container. See below. |
| Never mount the Docker socket into the application | Only the docker-socket-proxy service holds /var/run/docker.sock. Access to it is equivalent to root on the host. |
| Leave stdio MCP servers off unless you need one | ALLOW_STDIO_MCP=true lets system administrators run arbitrary commands in the application container. Keep the number of administrators small. |
Code execution and the Docker socket
Three kinds of code run at a user’s request. Where each runs decides what it can reach.
The Docker socket. Access to
/var/run/docker.sock is equivalent to root on the host. The application container never has it, and its image has no Docker CLI. With the docker backend the application talks to the docker-socket-proxy service, which forwards a request only when it starts a container that:
- is named
fim-sandbox-<hex>and uses one of the configured sandbox images; - mounts nothing but
<data dir>/sandbox/<conversation>/workspaceat/workspace; - has no network (
none), or the one egress network you named and labelled (see below); - runs as the one non-root user configured on the proxy (
SANDBOX_PROXY_USER, 10001:10001 by default) with a memory, CPU and process limit within bounds,no-new-privilegesand every capability dropped, and is removed when it exits; - asks for nothing else: no privileged mode, host PID/IPC/UTS/user namespace, host or container network, added capability, device, extra mount, volume, published port, label, custom runtime or other security option.
CODE_EXEC_BACKEND is not docker.
No network in the sandbox. Code and shell commands alike run without a network. The outbound rules the application applies to its own requests do not apply inside a container, so a sandbox gets no network at all. If shell commands must reach the internet, that is your decision and your firewall:
DOCKER_SHELL_NETWORK=fim-sandbox-egress in .env. The proxy joins shell_exec containers to that network only, and only while it carries the label and was created with enable_icc=false (a network created without it must be removed and created again: the option cannot be changed later); bridge, host, the compose network and unlabelled networks are refused. The label is your statement that the rules exist: the proxy cannot see your firewall. Put nothing else on that network (the proxy refuses it while any other container is attached), and keep it IPv4-only: the rules above are IPv4 rules, and the proxy refuses a network with IPv6 enabled. If you need IPv6, write the matching ip6tables rules first and run your own proxy policy. The rules must be restored after a reboot (iptables-persistent or your firewall manager). Code execution (python_exec, node_exec) stays without a network either way.
The workspace is read without trusting it. The application reads, lists and writes the directory sandboxed code works in (artifacts, offloaded tool output, rendered templates, the file tool, generated images). It opens every path below the workspace without following symlinks and acts only on regular files.
local is not isolation. The Python restrictions and the shell command word list of the local backend are conveniences for the model, not a boundary. A user who can run code with local can read and change what the application can: the data volume and other users’ uploaded files. If the application container can reach a container runtime (a Docker, Podman or containerd socket, or a DOCKER_HOST that is a daemon and not the sandbox proxy), local code execution and stdio MCP servers refuse to start.
Keys. Setting JWT_SECRET_KEY and CREDENTIAL_ENCRYPTION_KEY in .env is the recommended way. When one is not set, the container’s entrypoint reads it, as root, from a key store of its own (/var/lib/fim-one/secrets, the app_secrets volume in the bundled compose file; back that volume up with your data). A missing key is generated only on a first start, while the database is still empty, and is stored before it is used. If the database already has data and a key is in neither place, the container refuses to start and names the key: stored credentials can only be read with the CREDENTIAL_ENCRYPTION_KEY they were written with. FIM_ALLOW_NEW_KEYS=true lets it generate new keys once, giving up what the old ones encrypted. A key is generated only into a key store on a mount of its own (a volume or bind mount at /var/lib/fim-one/secrets or at a directory above it; a tmpfs does not count): when none is mounted there (a compose file without the app_secrets volume), a generated key would live in the container’s own filesystem and be gone at the next recreate, so the container refuses to start and says so; mount the volume, or set the keys in .env, or set FIM_ALLOW_UNMOUNTED_KEY_STORE=true to accept keys that do not survive a recreate. A key set in .env that differs from the stored one is used, and the start logs a warning naming it. Before it decides that the database is empty, the entrypoint asks it up to five times (5 seconds each, 3 seconds apart); a database that does not answer stops the start without generating anything. The entrypoint never deletes, moves or replaces key material; a key store that does not look as expected (not root’s, writable by others, inside the application’s data/ or uploads directory, or below a directory, from its mount down, that is not root’s or that others can write to) also stops the start. The API receives the keys in its environment, which the commands it starts cannot read; the frontend process receives none.
stdio MCP servers. A stdio server is a command line. ALLOWED_STDIO_COMMANDS does not make that safe: python -c, node -e and npx <any package> run arbitrary code. The rule that protects the container is who may configure one:
- only a system administrator can create, edit, copy or publish a stdio server;
- a stdio server is started only while its owner is an active system administrator, and “Test connection” starts it too: for a server whose owner is not an active administrator it answers
stdio_mcp_owner_not_admin, the reason the server list shows. A server created by somebody else, or by an administrator who has since lost the role or been deactivated, stays in the database and is never started. Its owner sees it marked “Not started” and can delete it or turn it into an HTTP server; - a user who brings their own credential to a shared stdio server can set only the environment variables the administrator declared on it, and none that change what the process loads, fetches or trusts (
PATH,NODE_OPTIONS,PYTHONPATH,LD_PRELOAD, proxy and certificate variables, and the like). List every variable users should fill in on the server, with a placeholder value.
Upgrading an existing deployment
-
Before you stop the old container, if
JWT_SECRET_KEYandCREDENTIAL_ENCRYPTION_KEYare not both in your.env: copy them out (docker compose exec fim-one cat /app/.env) and put them into.env. They were generated inside the old container and do not survive its replacement; without the encryption key, stored connector credentials cannot be read. The new container checks this for you: with data in the database and a key missing, it stops with a message instead of starting with a new key. -
Replace
docker-compose.ymlwith the new one, or copy over thedocker-socket-proxyservice, thesandbox_proxy_secretvolume (mounted in both services), theapp_secretsvolume, theDOCKER_HOST/CODE_EXEC_BACKEND/DOCKER_NODE_IMAGE/DOCKER_SHELL_NETWORKenvironment entries and thedepends_onentry, and delete the/var/run/docker.sockline from thefim-oneservice. Remove any override file that adds or removes that mount. -
Check
CODE_EXEC_BACKENDin.env. Unset now meansdockerunder compose (previouslylocal). If it sayslocal, every user with the code tools runs commands in the application container: change it todockerunless the instance has a single trusted user. -
Rebuild and start:
docker compose up -d --build.- Ownership of the data directories. The application now runs as uid 10001. On first start the entrypoint, still root at that point, changes the owner of everything under
./dataand./uploadsto 10001:10001. On a Linux host this is visible on the host: the directories no longer belong to the user who created them, and host-side scripts (backups, imports) that write there must run as uid 10001 or as root. A large tree takes a while, once. If the directories are on a filesystem where root in the container cannot change ownership (NFS withroot_squash, some CIFS mounts) the change fails and the container stops:chown -R 10001:10001 data uploadson the host or the file server first. With SELinux enforcing, the bind mounts need the:zlabel as before. - Your own compose file (fixed
container_names, services of your own): mount a volume at/var/lib/fim-one/secretsin the application service, as the bundled file does withapp_secrets, or set both keys in.env. Without either, a first start refuses to generate keys (see Keys above). - The sandbox user. Set the application’s
DOCKER_SANDBOX_USERto the proxy’sSANDBOX_PROXY_USER(the sameuid:gid; the bundled file derives both fromDOCKER_SANDBOX_USER, default10001:10001). The proxy refuses any other user, so with a compose file that setsSANDBOX_PROXY_USERon its own and leaves the application at another value, every code run fails with aUser must be …message. - Running the container as another user (
user:in compose): the entrypoint then changes nothing and reads no root-only file. Make the data directories writable by that user yourself, and setJWT_SECRET_KEY,CREDENTIAL_ENCRYPTION_KEY(the container does not start without them in this mode) and aSANDBOX_PROXY_TOKENof your own (at least 32 characters, the same for both services) in.env.
- Ownership of the data directories. The application now runs as uid 10001. On first start the entrypoint, still root at that point, changes the owner of everything under
-
Shell commands have no network.
shell_execcontainers now run without one, like code execution. See “No network in the sandbox” above if you need egress. -
stdio MCP servers. If
ALLOW_STDIO_MCP=true: servers owned by users who are not system administrators stop working (agents and workflows that use them get an error naming the server). To keep one, an administrator recreates it under their own account and shares it. To list the affected rows:Review them before deleting. Users’ saved credentials for a shared stdio server that set variables the server does not declare are refused until the administrator declares those names on the server. TheMCP_SERVERSenvironment variable is no longer read. -
Verify:
docker compose exec fim-one ls /var/run/docker.sockmust fail;docker compose top fim-oneshows the API under uid 10001 and the frontend under uid 10002, nothing under root; a chat that uses a code tool runs, anddocker compose logs docker-socket-proxyshows norefusedline for it.
python /app/docker_proxy.py from the same image as a separate container or sidecar with the Docker socket, DOCKER_HOST_DATA_DIR and a SANDBOX_PROXY_TOKEN; give the application the same token and DOCKER_HOST=tcp://<proxy>:2375; keep the socket out of the application container.
Checking Stored Data Before an Upgrade
Some releases tighten what stored settings may do, and rows saved under the earlier rules then stop working. With the new release installed and the same environment as the application (DATABASE_URL, DB_CONNECTOR_ALLOWED_HOSTS, REDIS_URL), run:
SELECT statements, resolves host names and prints what it found, without credentials, model keys or stored avatar values. It lists:
Checking Stored Data Before an Upgrade
Some releases tighten what stored settings may do, and rows saved under the earlier rules then stop working. With the new release installed and the same environment as the application (DATABASE_URL, DB_CONNECTOR_ALLOWED_HOSTS, REDIS_URL), run:
SELECT statements, resolves host names and prints what it found, without credentials, model keys or stored avatar values. It lists: