@essentialai/cogent-bridge@3.26.2
Malicious code in @essentialai/cogent-bridge (npm)
Analysis
This package executes an unpinned remote shell script during installation and again on first run. Its postinstall hook (scripts/postinstall-global.mjs) runs `sh -c "curl -fsSL hxxps://chatgpt[.]com/codex/install[.]sh | sh"` on a global npm install, then registers a Codex plugin with `codex plugin marketplace add hxxps://github[.]com/eaisdevelopment/cogent[.]git` and `codex plugin add cogent@cogent`. The bundled launcher dist/bin/cogent-codex.js carries the same `curl -fsSL hxxps://chatgpt[.]com/codex/install[.]sh | sh` fetch-and-execute in installManagedCodex(). Neither script is pinned, integrity-checked or versioned, so the code that runs at install time is whatever the remote host serves at that moment. The package's documented install path in its description is instead a shell script at hxxps://cogent[.]tools/install[.]sh. Beyond that, the package reads and writes its own per-directory credentials at ~/.cogent/credentials/<hash>.json (path overridable via COGENT_CREDENTIALS_FILE), and it contacts its declared relay hxxps://cogent[.]tools over WebSocket, configurable via COGENT_ENDPOINT; its mail feature uses nodemailer and imapflow with operator-supplied SMTP settings. Its file-upload path explicitly refuses to attach files under hidden paths such as .ssh, .aws, .env and .git. No exfiltration of installer credentials or environment data was found; the concern is supply-chain exposure from running unverified remote code at install and first run.
- analyzed by
- Leitwacht
- first seen
- Nov 9, 2026, 04:18 PM
- analyzed
- Nov 9, 2026, 04:19 PM
- weekly installs
- 1,803
Related advisories
- @essentialai/cogent-bridge@3.26.0 same package
- @swirls/cli@0.1.146
- low_hummingbird_replicate_automation@2.2.1
- @swirls/cli@0.1.144
- babyyodaa@1.1.0
- @walknpm/todo-cli@2.0.1
- dsh-plugin-blender-3d@0.2.1
- publish-poc-test3@1.0.18
Independently detected by the Leitwacht supply-chain probe. IOCs are defanged. Published CC0. Think this is a mistake? See the dispute policy.