baoyu-post-to-wechat
Audited by Socket on Sep 14, 2026
4 alerts found:
Anomalyx3SecurityThe code is a browser automation/CDP helper module, not apparent malware. Its privileged behavior is intentional for its purpose, but it introduces significant caller-trust requirements: arbitrary JavaScript execution through evaluate(), selector-to-JavaScript injection in clickElement(), execution of an environment-selected browser binary, navigation to caller-controlled URLs, and possible clipboard disclosure to pages. It should only receive trusted inputs and should escape or avoid interpolating selectors into JavaScript. No evidence of data theft, persistence, reverse shells, cryptomining, or suspicious exfiltration is present in the supplied code.
The code appears to be a Markdown-to-HTML conversion utility rather than malware. It contains meaningful security risks: Markdown authors can trigger requests to arbitrary destinations, including potentially internal services; local image paths can escape the Markdown directory; and npx -y may download and execute a package at runtime. These issues warrant review and hardening, especially when processing untrusted Markdown, but the fragment contains no clear malicious payload or data-exfiltration logic.
This module is a dual-use cross-platform keystroke injection utility that performs a real paste (Cmd+V/Ctrl+V equivalents) to the active/frontmost application and explicitly aims to bypass synthetic paste-event detection. No network exfiltration or persistence is present in the provided code, but the behavior is inherently security-sensitive (UI input automation) and can be abused for clipboard-driven attacks. The highest concrete technical risk is on macOS: user-supplied --app is interpolated into dynamically constructed AppleScript executed via osascript without escaping/validation, creating an AppleScript-evaluation injection risk. Overall: elevated security risk; treat as high-impact automation code and restrict/validate inputs when used.
This code is a WeChat posting automation utility with significant security exposure due to (1) host-side command execution via execSync/spawnSync of an external browser automation tool and (2) repeated in-browser JavaScript execution via eval, where title/content and image paths are user-influenced. The fallback upload mechanism can read local files via file:// fetch in the browser context, then upload them through the UI. No clear backdoor or direct third-party exfiltration endpoints are evident in this file alone, but the overall design warrants strong supply-chain/input trust controls and careful review of the agent-browser binary’s command parsing and permissions.