Hackers are weaponizing invisible Unicode characters, once reserved for private use, to embed malicious code within software repositories like GitHub and npm. These characters, appearing as blank lines to human reviewers and static analysis tools, translate into executable commands for JavaScript interpreters.
Initially used to trick AI engines into executing harmful instructions, this technique has evolved into traditional malware attacks. Attackers encode malicious payloads using these characters, which a decoder then extracts during runtime for execution via functions like eval(). A recent analysis revealed packages on GitHub, npm, and the VS Code marketplace containing such hidden threats. These payloads can steal tokens, credentials, and secrets, with detected packages likely representing only a fraction of the ongoing campaign.
Safeguarding against these supply-chain attacks requires meticulous inspection of packages and their dependencies, including scrutinizing names for typos. As malicious packages become more sophisticated with hidden Unicode characters, vigilance in code review is paramount.