Hidden Code Attacks: Cybersecurity Nightmare 😱💥
Tech
🎧



Researchers at Aikido Security discovered a supply-chain attack involving the use of invisible Unicode characters, primarily between March 3 and March 9. One hundred and fifty-one malicious packages were uploaded to repositories like GitHub, NPM, and Open VSX. These packages contained code that, while invisible to human reviewers and standard scanning tools, could be interpreted by AI engines. The attackers utilized Private Use Areas within the Unicode specification to encode malicious payloads, effectively bypassing traditional defenses. When executed, these packages triggered the delivery of stolen tokens, credentials, and secrets via channels like Solana. Similar attacks have been occurring for nearly a decade, and the use of AI to generate convincing packages is now suspected. Careful inspection of package dependencies remains the most effective defense against these evolving supply-chain threats.
THE RISE OF INVISIBLE CODE
Unicode that’s invisible to the human eye was largely abandoned—until attackers took notice. Researchers say they’ve discovered a supply-chain attack flooding repositories with malicious packages that contain invisible code, a technique that’s flummoxing traditional defenses designed to detect such threats. The researchers, from firm Aikido Security,said Fridaythat they found 151 malicious packages that were uploaded to GitHub from March 3 to March 9. Such supply-chain attacks have been common fornearlyadecade. They usually work by uploading malicious packages with code and names that closely resemble those of widely used code libraries, with the objective of tricking developers into mistakenly incorporating the former into their software. In some cases, these malicious packages are downloaded thousands of times. The packages Aikido found this month have adopted a newer technique: selective use of code that isn’t visible when loaded into virtually all editors, terminals, and code review interfaces. While most of the code appears in normal, readable form, malicious functions and payloads—the usual telltale signs of malice—are rendered in unicode characters that are invisible to the human eye. The tactic, which Aikido said itfirst spottedlast year, makes manual code reviews and other traditional defenses nearly useless. Other repositories hit in these attacks include NPM and Open VSX.
TARGETING VULNERABILITIES THROUGH SUPPLY CHAIN
The malicious packages Aikido found this month have adopted a newer technique: selective use of code that isn’t visible when loaded into virtually all editors, terminals, and code review interfaces. While most of the code appears in normal, readable form, malicious functions and payloads—the usual telltale signs of malice—are rendered in unicode characters that are invisible to the human eye. The tactic, which Aikido said itfirst spottedlast year, makes manual code reviews and other traditional defenses nearly useless. Other repositories hit in these attacks include NPM and Open VSX. The malicious packages are even harder to detect because of the high quality of their visible portions. “The malicious injections don’t arrive in obviously suspicious commits,” Aikido researchers wrote. “The surrounding changes are realistic: documentation tweaks, version bumps, small refactors, and bug fixes that are stylistically consistent with each target project.”
AI-POWERED ATTACKS: GLASSWORM AND LLM GENERATION
Researchers suspect that Glassworm—the name they assigned to the attack group—is using LLMs to generate these convincingly legitimate-appearing packages. “At the scale we’re now seeing, manual crafting of 151+ bespoke “code changes across different codebases simply isn’t feasible,” they explained. Fellow security firm Koi, which has alsobeen trackingthe same group, said it, too, suspects the group is using AI. The invisible code is rendered withPrivate Use Areas(sometimes called Private Use Access), which are ranges in the Unicode specification for special characters reserved for private use in defining emojis, flags, and other symbols. The code points represent every letter of the US alphabet when fed to computers, but their output is completely invisible to humans. People reviewing code or usingstatic analysistools see only whitespace or blank lines. To a JavaScript interpreter, the code points translate into executable code.
DECODING MALICE: THE ROLE OF PRIVATE USE AREAS
The Unicode technique has been largely forgotten. That is, until 2024, when hackers began using the characters to conceal malicious promptsfed to AI engines. While the text was invisible to humans and text scanners, LLMs had little trouble reading them and following the malicious instructions they conveyed. AI engines have since devised guardrails that are designed to restrict usage of the characters, but such defenses areperiodically overridden. Since then, the Unicode technique has been used in more traditional malware attacks. In one of the packages Aikido analyzed in Friday’s post, the attackers encoded a malicious payload using the invisible characters. Inspection of the code shows nothing. During the JavaScript runtime, however, a small decoder extracts the real bytes and passes them to the eval() function. “The backtick string passed to s() looks empty in every viewer, but it’s packed with invisible characters that, once decoded, produce a full malicious payload,” Aikido explained. “In past incidents, that decoded payload fetched and executed a second-stage script using Solana as a delivery channel, capable of stealing tokens, credentials, and secrets.”
DETECTING AND MITIGATING THE THREAT
Researchers have found similar ones on npm and the VS Code marketplace. Aikido said the 151 packages detected are likely a small fraction spread across the campaign because many have been deleted since first being uploaded. The best way to protect against the scourge of supply-chain attacks is to carefully inspect packages and their dependencies before incorporating them into projects. This includes scrutinizing package names and searching for typos. If suspicions about LLM use are correct, malicious packages may increasingly appear to be legitimate, particularly when invisible unicode characters are encoding malicious payloads.
This article is AI-synthesized from public sources and may not reflect original reporting.