Skip to content
Leaked secrets Write-up Advanced

I Found North Korean Dprk Malware Hiding In My Tailwind Config Js

The author found obfuscated JavaScript appended to a tailwind.config.js file and later in a routes/user.js file across three repositories, which decoded to a JSON-RPC beacon to a TRON blockchain API endpoint. Unknown Node processes were running in production and commits appeared under the author's own git identity, though the initial entry vector was never confirmed.

Couch Potato Follow

Published on infosecwriteups.com

This wasn’t package.json or something deep in nodemodules. It was tailwind.config.js.

Couch Potato, on infosecwriteups.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely an attacker with local access to the developer's machine or workspace appended obfuscated code to trusted config and route files and rewrote local git history so the commits appeared to be the author's own.

Impact

The hidden code could run at build time and in the Node backend, beacon to a blockchain-based command-and-control endpoint, and the author treated all secrets on the machine as compromised; the text does not confirm what data was actually taken.

What the attacker needed

Local access to the developer's workspace; project build or Node process runs the file; no user interaction after infection

The fix

The author's response was to kill the Node processes, rotate every secret and SSH key, and audit git history, but the text does not state that the entry point was found or that the infection was fully removed.

How it was found

  1. Open the tailwind.config.js file and scroll past the visible config to the end of the line.
  2. Notice a long obfuscated script hidden after large amounts of whitespace.
  3. Diff the file against a clean copy to confirm the extra code.
  4. Search the machine for similar encoded blobs and find a second hit in routes/user.js.
  5. List running Node processes and find unknown ones, including in production.
  6. Run the payload in an isolated container without network access to observe what it contacts.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.

A config file is a small settings file that a project reads when it builds or starts up, and it runs as ordinary code. Someone had hidden a long scrambled script at the end of such a file, past lots of blank space, so it looked empty when skimmed. When the project ran, that hidden script ran too and quietly contacted an outside server, which is how an attacker would receive instructions or stolen data.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.