Skip to content

Keep the web password out of omp's environment, and accept only a password hash #239

Closed

Description

@andrebrait

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

  1. Accept only a password hash. Add OMP_WEB_PASSWORD_HASH, a slow, salted hash in a self-describing format, for example scrypt$N$r$p$<salt>$<hash> using node:crypto (no new dependency). The server verifies sign-ins against the hash and never needs the plaintext.
  2. Add ompweb hash-password. It reads the password from stdin, not argv, so the password stays out of shell history and ps, and prints the hash.
  3. 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.
  4. 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 mode 0600. Mixing the password hash into that key keeps today's behavior: changing the password still invalidates existing sessions.
  5. Remove omp-web's own secrets from child environments. Strip OMP_WEB_PASSWORD_HASH, any leftover OMP_WEB_PASSWORD, and OMP_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 in rpc-process.ts.
  6. Optionally, store only a digest of the trusted-header secret. The OMP_WEB_TRUSTED_HEADER_SECRET from 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

  1. added a commit that references this issue on Oct 9, 2026
    05fb0a8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions