Repository navigation
Description
Problem
omp-web runs every omp process with its own environment. The only variables sanitizeProjectCommandEnvironment (lib/project-command-env.ts) removes are PORT, NODE_ENV and NEXT_*, so OMP_WEB_PASSWORD reaches every omp session (lib/omp/rpc-process.ts) and every command an agent runs. A password passed with --password ends up there as well, because bin/omp-web.js copies it into process.env.
As a result, an agent that runs env or printenv, or reads a .env-style dump, can print the plaintext web password. The output then:
- is saved in the session file, and
- is sent to the model provider as part of the conversation.
Many users reuse passwords, so a leak can reach beyond omp-web.
Several other omp spawns also pass the full process.env: plugin install and upgrade, update checks, version probes, exports, provider usage, and the agents service. omp plugin install runs third-party install scripts with that environment.
Proposal
- Accept only a password hash. Add
OMP_WEB_PASSWORD_HASH, a slow, salted hash in a self-describing format, for examplescrypt$N$r$p$<salt>$<hash>usingnode:crypto(no new dependency). The server verifies sign-ins against the hash and never needs the plaintext. - Add
ompweb hash-password. It reads the password from stdin, not argv, so the password stays out of shell history andps, and prints the hash. - Migrate the existing ways of setting a password:
- The systemd and launchd installers and the Linux tray hash the password before writing the service configuration.
- A plaintext
OMP_WEB_PASSWORD, or--password, stops the server at startup with a message explaining how to produce the hash. - There is no compatibility period and no plaintext fallback. The release notes call this out as a breaking change.
- Use a separate key to sign sessions. Session cookies are currently an HMAC with the plaintext password as the key (
lib/web-auth.ts). With only a hash available, signing with the hash would let anyone holding the hash forge sessions. Instead, sign with a random key generated on first start and stored in the agent directory with mode0600. Mixing the password hash into that key keeps today's behavior: changing the password still invalidates existing sessions. - Remove omp-web's own secrets from child environments. Strip
OMP_WEB_PASSWORD_HASH, any leftoverOMP_WEB_PASSWORD, andOMP_WEB_TRUSTED_HEADER_SECRET(feat(auth): skip the password for requests a trusted proxy vouches for #238) at every child spawn, through one shared helper, not only inrpc-process.ts. - Optionally, store only a digest of the trusted-header secret. The
OMP_WEB_TRUSTED_HEADER_SECRETfrom feat(auth): skip the password for requests a trusted proxy vouches for #238 can also be held as a SHA-256 digest. The secret is random, so a fast hash is enough.
Limits
This keeps the reusable password out of transcripts, model-provider traffic and logs. It does not isolate omp-web from its agents. Processes running as the same OS user can still read the session-signing key file, or omp-web's memory, and forge a session. Real isolation would require running agents as a different OS user, which is out of scope here.
Activity
fix(security,ui): password hashes, queued sends, thinking blocks, ask…
fix(security): strip OMP_WEB_STT_KEY from child envs; sanitize omp sp…