Skip to content

Security: JoShMiQueL/opencode-devin

Security

SECURITY.md

Security

opencode-devin is a clean-room opencode plugin that talks to Devin / Cognition's Cascade API with your own session token. This document records the security posture and how we harden it.

Reporting a vulnerability

Please do not open a public issue. Email joshmiquel.cs@gmail.com (or use GitHub private vulnerability reporting on JoShMiQueL/opencode-devin). Include reproduction steps and affected version; we'll acknowledge within a few days.

Credentials

  • provider devin, plugin opencode-devin; no remnants of opencode-devin@0.x.
  • No credentials are bundled or committed. The session token (devin-session-token$<jwt>) comes from /connect, DEVIN_API_KEY, or <data dir>/session. .env, .gitignore, and npm files exclude them.
  • The session file is written with 0o600.
  • The plugin never writes anywhere named devin / cognition; state lives in a private opencode-devin dir (no collision with official Devin tools, no symlink/shared-dir ambiguity).

What is sent where

  • Only two origins are contacted, both https: https://server.codeium.com (+ https://app.devin.ai for PKCE OAuth).
  • The long-lived session token travels inside the Metadata protobuf (apiKey, and user_jwt in field 21). The short-lived minted user_jwt travels in Metadata field 21 and, for unary calls, Authorization: Bearer.
  • Server-returned hosts are not trusted. GetUserJwt can return a customApiServerUrl; sanitizeCascadeHost() (auth.ts) accepts it only if it is a plain https DNS name under codeium.com / devin.ai / cognition.ai / the trusted host's own domain — no userinfo, no path/query/fragment, no IP literal, no localhost, no port tricks, no scheme override. Otherwise we keep the trusted host. (Prevents credential exfiltration to an attacker-controlled endpoint.)
  • No eval, no new Function, no shell injection. Bun.spawn is always argv-array, never a shell. openBrowser spawns rundll32/open/ xdg-open with our own OAuth URL.
  • OAuth uses PKCE (S256) with a stateless loopback listener on 127.0.0.1; nothing is printed to logs.

Logging

opencode-devin.log is designed to be safe to share for bug reports:

  • session tokens / JWTs are redacted (first14…last6) via redact();
  • free-form server text (error bodies, trailers) is passed through scrubSecrets(), which strips devin-session-token$…, JWTs, Bearer …, and "token"/"api_key"/"access"/"refresh"/"secret"/ "password" JSON values;
  • tool-call arguments are not logged (names + ids only);
  • log file is 0o600, capped at ~5 MB with one .1 rotation.

bun run log prints the scrubbed tail.

Supply chain

  • No third-party Devin/Cascade code. protobuf wire, Connect-RPC, PKCE, and the Cascade client are implemented here (src/provider/*); we do not depend on devin-core, devin-engine, @ai-sdk/*, or any shim.
  • Single runtime dependency: @opencode/plugin (host provides it). Nothing from the previous opencode-devin package carries over.
  • No postinstall scripts, no network installs at runtime.
  • npm audit / bun audit: our package ships no vendored node_modules; transitive advisories live in @opencode/plugin (host-managed). See the publish checklist in README.

Dependency floor & publish checklist

bun run typecheck            # strict tsc, clean
npm audit --omit=dev         # review
npm pack --dry-run           # only src/** + README + LICENSE ship

No secrets in files; src/provider/package.json is the aisdk sub-entry and contains no data.

There aren't any published security advisories