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.
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.
- provider
devin, pluginopencode-devin; no remnants ofopencode-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 npmfilesexclude them. - The session file is written with
0o600. - The plugin never writes anywhere named
devin/cognition; state lives in a privateopencode-devindir (no collision with official Devin tools, no symlink/shared-dir ambiguity).
- Only two origins are contacted, both https:
https://server.codeium.com(+https://app.devin.aifor PKCE OAuth). - The long-lived session token travels inside the
Metadataprotobuf (apiKey, anduser_jwtin field 21). The short-lived minteduser_jwttravels inMetadatafield 21 and, for unary calls,Authorization: Bearer. - Server-returned hosts are not trusted.
GetUserJwtcan return acustomApiServerUrl;sanitizeCascadeHost()(auth.ts) accepts it only if it is a plainhttpsDNS name undercodeium.com/devin.ai/cognition.ai/ the trusted host's own domain — no userinfo, no path/query/fragment, no IP literal, nolocalhost, no port tricks, no scheme override. Otherwise we keep the trusted host. (Prevents credential exfiltration to an attacker-controlled endpoint.) - No
eval, nonew Function, no shell injection.Bun.spawnis always argv-array, never a shell.openBrowserspawnsrundll32/open/xdg-openwith our own OAuth URL. - OAuth uses PKCE (
S256) with a stateless loopback listener on127.0.0.1; nothing is printed to logs.
opencode-devin.log is designed to be safe to share for bug reports:
- session tokens / JWTs are redacted (
first14…last6) viaredact(); - free-form server text (error bodies, trailers) is passed through
scrubSecrets(), which stripsdevin-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.1rotation.
bun run log prints the scrubbed tail.
- No third-party Devin/Cascade code. protobuf wire, Connect-RPC, PKCE,
and the Cascade client are implemented here (
src/provider/*); we do not depend ondevin-core,devin-engine,@ai-sdk/*, or any shim. - Single runtime dependency:
@opencode/plugin(host provides it). Nothing from the previousopencode-devinpackage carries over. - No postinstall scripts, no network installs at runtime.
npm audit/bun audit: our package ships no vendorednode_modules; transitive advisories live in@opencode/plugin(host-managed). See the publish checklist in README.
bun run typecheck # strict tsc, clean
npm audit --omit=dev # review
npm pack --dry-run # only src/** + README + LICENSE shipNo secrets in files; src/provider/package.json is the aisdk sub-entry
and contains no data.