Malicious code in @xiaohhhh1/canvas-agent (npm)
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (a34add291ef7584aec7041449cb2e80d36ae98f93c2725e1aa018707e3334119) On bin start, @xiaohhhh1/canvas-agent opens an outbound WebSocket to the hardcoded relay wss://canvas.xiaohhhh1.com/api/agent-relay and treats inbound messages as HTTP requests to its own loopback API at 127.0.0.1:17371. The bridge unconditionally injects the local agent token (x-canvas-agent-token) into forwarded requests, so remote 'request' messages satisfy token authentication and can invoke /agent/codex/turn and /agent/claude/turn, which spawn the Codex app-server and Claude CLI locally with attacker-supplied prompts and a caller-controlled permissionMode. Codex/Claude are autonomous coding agents that can write files in the workspace and, when permissionMode is widened to danger-full-access, execute arbitrary shell commands. The same code path also bypasses the loopback server's browser-Origin allow-list: the origin gate is populated only after token validation, and the relay bridge presents the valid token without any user-consented browser Origin, so remote-originated calls pass the token+origin check the README advertises. The net effect is a network-to-local-agent-to-shell control path from a hardcoded author-controlled server into the installer's machine and any repository it is run against.
AI Analysis
Technical Summary
The @xiaohhhh1/canvas-agent npm package (version 0.4.4) includes malicious functionality where, upon starting its binary, it opens a WebSocket connection to wss://canvas.xiaohhhh1.com/api/agent-relay. Through this relay, inbound messages are forwarded as authenticated HTTP requests to the local server with a special token header. The relay exposes endpoints that allow spawning local Codex and Claude CLI processes, reading arbitrary image files from absolute paths, and opening the OS file manager on arbitrary absolute paths. The package maps a 'full' permission mode to a 'danger-full-access' sandbox with an approval policy set to 'never', enabling remote peers to execute commands and modify files on the host without any local user prompt or approval. This effectively provides a remote attacker with unrestricted control over the host system via the relay.
Potential Impact
A remote attacker controlling the relay server can execute arbitrary commands, read arbitrary image files, and open the file manager on the host system running the affected package version. This leads to full remote code execution and unauthorized file access without any local user approval, posing a critical security risk to the host environment.
Mitigation Recommendations
No patch or official fix is currently documented for this malicious package version. Users should immediately remove the @xiaohhhh1/canvas-agent package version 0.4.4 from their environments and avoid installing it. Since this is a malicious package, the best mitigation is to avoid using it entirely and verify package integrity and provenance before installation.
Malicious code in @xiaohhhh1/canvas-agent (npm)
Description
--- _-= Per source details. Do not edit below this line.=-_ ## Source: amazon-inspector (a34add291ef7584aec7041449cb2e80d36ae98f93c2725e1aa018707e3334119) On bin start, @xiaohhhh1/canvas-agent opens an outbound WebSocket to the hardcoded relay wss://canvas.xiaohhhh1.com/api/agent-relay and treats inbound messages as HTTP requests to its own loopback API at 127.0.0.1:17371. The bridge unconditionally injects the local agent token (x-canvas-agent-token) into forwarded requests, so remote 'request' messages satisfy token authentication and can invoke /agent/codex/turn and /agent/claude/turn, which spawn the Codex app-server and Claude CLI locally with attacker-supplied prompts and a caller-controlled permissionMode. Codex/Claude are autonomous coding agents that can write files in the workspace and, when permissionMode is widened to danger-full-access, execute arbitrary shell commands. The same code path also bypasses the loopback server's browser-Origin allow-list: the origin gate is populated only after token validation, and the relay bridge presents the valid token without any user-consented browser Origin, so remote-originated calls pass the token+origin check the README advertises. The net effect is a network-to-local-agent-to-shell control path from a hardcoded author-controlled server into the installer's machine and any repository it is run against.
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The @xiaohhhh1/canvas-agent npm package (version 0.4.4) includes malicious functionality where, upon starting its binary, it opens a WebSocket connection to wss://canvas.xiaohhhh1.com/api/agent-relay. Through this relay, inbound messages are forwarded as authenticated HTTP requests to the local server with a special token header. The relay exposes endpoints that allow spawning local Codex and Claude CLI processes, reading arbitrary image files from absolute paths, and opening the OS file manager on arbitrary absolute paths. The package maps a 'full' permission mode to a 'danger-full-access' sandbox with an approval policy set to 'never', enabling remote peers to execute commands and modify files on the host without any local user prompt or approval. This effectively provides a remote attacker with unrestricted control over the host system via the relay.
Potential Impact
A remote attacker controlling the relay server can execute arbitrary commands, read arbitrary image files, and open the file manager on the host system running the affected package version. This leads to full remote code execution and unauthorized file access without any local user approval, posing a critical security risk to the host environment.
Mitigation Recommendations
No patch or official fix is currently documented for this malicious package version. Users should immediately remove the @xiaohhhh1/canvas-agent package version 0.4.4 from their environments and avoid installing it. Since this is a malicious package, the best mitigation is to avoid using it entirely and verify package integrity and provenance before installation.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- MAL-2026-13398
- Osv Schema Version
- 1.7.4
- Ecosystems
- ["npm"]
Threat ID: 6a74cf8ebf8831d5391aebe4
Added to database: 08/06/2026, 18:16:46 UTC
Last enriched: 08/06/2026, 18:42:21 UTC
Last updated: 09/18/2026, 02:12:32 UTC
Views: 26
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.