viberrr
Scan my site
vibe-coding · November 22, 2026 · 16 min read

Malware in postcss.config.mjs? How it hides and what to do

Malware in postcss.config.mjs, tailwind.config.js and other config files hides off-screen after a run of spaces. How we found it, and how to check yours.

Illustration with a sample app, drawn from this article.

Quick answer: Malware in postcss.config.mjs, tailwind.config.js or a similar config file is hidden code added at the end of the file's last real line, pushed off-screen by spaces. It runs when the project builds and can read the build's secrets. Look for any very long line, remove everything after the real config, and replace every key the build could see.

If you've just found a wall of scrambled code in postcss.config.mjs or tailwind.config.js, you're in the right place, and you're not the only one. We found the same thing in our own projects. It was sitting in 15 of our repositories, and nobody had seen it, because it was hidden where nobody looks: far off the right edge of the screen.

This guide tells that story, shows that it matches an attack other people have documented in public, and then gets practical: how to check every project you own in a few minutes, what to do in what order if you find it, and how to make it much harder for this to happen again. It's part of check 5 of our eight checks before you launch a vibe-coded app.

What does malware in postcss.config.mjs look like?

Like nothing at all, which is the point. Here is what we saw.

While preparing a redesign, a build failed on our hosting provider with a strange error. It came from postcss.config.mjs, a small file that normally has about eight lines and tells the app how to process its styles.

Opened in an editor, the file looked completely normal. But after the last visible line, export default config;, came a long run of spaces, and after the spaces, far off the right edge of the screen, more than 5,000 characters of scrambled JavaScript on that same line.

What we found in our own projects
~8
lines the file normally has
A small PostCSS config
5,000+
characters hidden on the last one
After a long run of spaces
15
repositories carrying it
In two variants
Source: viberrr's own incident, as first written up on 22 November 2026.

Once we knew the pattern, we scanned every project we owned. The same injection, in two variants, turned up in 15 repositories: the main app, the marketing site and a series of smaller tools. Two staging branches and dozens of old feature branches carried it too.

The reason nobody had seen it is ordinary. Many code editors, Visual Studio Code among them, don't wrap long lines unless you ask them to. Its documentation says so: "By default, editor.wordWrap is off". A line can be 5,000 characters long and show you only what fits in the window. The security company ESET, describing a closely related trick in a different campaign (code pushed off-screen behind a long comment), noted that code placed this way "is moved off-screen and stays hidden unless the victim scrolls to it or has the word wrap feature of their code editor enabled".

Is this a known attack?

Yes. Two independent sources have published the same pattern.

A research group has catalogued it across GitHub. OpenSourceMalware, a community threat-research group, tracks a campaign and threat actor it calls PolinRider. Its description: "The payload is appended after whitespace padding to common config files (postcss.config.mjs, eslint.config.mjs, tailwind.config.js, etc.) so it executes automatically when build tools import the module." By 11 April 2026 the group had confirmed "1,951 public GitHub repositories belonging to 1,047 unique owners" carrying it, up from 675 repositories five weeks earlier. postcss.config.mjs was the most common file: about 62% of affected repositories, by the group's count.

The same pattern, in public code
1,951
public GitHub repositories
By 11 April 2026, up from 675 five weeks earlier
1,047
owners
Unique accounts
~62%
had it in postcss.config.mjs
By the researchers' count
Source: OpenSourceMalware, PolinRider.

That count covers public repositories only, found by searching GitHub's public code. Private repositories aren't in it.

A government agency has analysed a case. The Canadian Centre for Cyber Security published an incident in March 2026 in which a developer "observed an unknown commit made to their private internal GitHub repository" that changed tailwind.config.js: "Padded with over a thousand whitespace characters, the file blended seamlessly into the developer's workspace".

OpenSourceMalware also published the telltale strings, and they match the ones our first write-up of this incident told readers to search for. Their detection rule looks for global['!'] together with a second marker, and their cleanup advice is to remove "everything after the legitimate config, starting with global['!']". They list a scrambled name, _$_1e42; our list had the same shape, _$_ followed by hex digits.

Side by side:

Our incidentOpenSourceMalware's reportCanadian Centre's case
The filepostcss.config.mjspostcss.config.mjs most often, then tailwind.config.js and eslint.config.mjstailwind.config.js
How it hidA long run of spaces, then more than 5,000 characters on the last line"Appended after whitespace padding""Padded with over a thousand whitespace characters"
When it ranOn a build"When build tools import the module""When a developer interacts with the repository"
How many15 repositories1,951 public repositoriesOne private repository

A few honest limits on that comparison:

  • We aren't naming who did it. OpenSourceMalware attributes the campaign to a group linked to North Korea. That's their finding. We have no way to confirm it for our own case and we're not claiming it.
  • The published version fetches its next stage from blockchain transactions. Ours was a loader that downloaded further code from remote servers when the build ran. We can't say whether it used the same source.
  • Newer variants use different strings. The April 2026 update lists a second variant marked global['_V']. A search for one string won't find everything.

How does the attack work?

In four moves.

  1. It hides in plain sight. The code sits after the real content, on the same line, pushed out of view by spaces. In OpenSourceMalware's words about one affected project: "To a developer reviewing the diff on GitHub, the change appears as a trivial semicolon addition. The payload is only visible by scrolling far to the right, or by examining the raw file size."
  2. It runs without being called. A config file isn't a settings sheet; it's a program. Next.js says of its own: "next.config.js is a regular Node.js module, not a JSON file. It gets used by the Next.js server and build phases". The PostCSS, Tailwind, ESLint and Vite config files are JavaScript too, and each runs whenever its tool does: on a build, when the project is started on someone's machine, or when the code is checked.
  3. It fetches the real payload from elsewhere. The hidden code is a loader. It downloads more code and runs it, so what it does can change from one day to the next.
  4. It goes after secrets. A build has your keys in reach. Vercel's documentation, describing normal use: "Your source code can read these values to change behavior during the Build Step". So can code that isn't yours. Published analyses of the campaigns researchers link this to describe attackers harvesting "API tokens, cloud credentials, signing keys, cryptocurrency wallets, and password manager artifacts" (Microsoft), and malware that can send "entire directory trees", source code included (the Canadian Centre for Cyber Security).

In our case, the build that exposed it failed only because the download didn't complete. Earlier builds may not have been so lucky. Every key that lived in those build environments had to be treated as stolen and replaced.

One detail matters for anyone hosting on a platform that builds every branch. Vercel creates "preview deployments for every push". A branch nobody ever merged can still be built, with that environment's keys in reach, whenever it's pushed.

Nothing warns you. The surest sign is a very long line.

How does it get into a project?

In our case, through commits from an outside development team. The commit messages described routine fixes, one of them a security patch. None mentioned a config file.

Our first write-up told readers to remove access for whoever introduced it. The published research suggests something less simple, and it's fairer to say so. According to OpenSourceMalware, in the cases it studied the code wasn't typed in by a person at all. A developer's own computer gets infected first, and the malware then adds itself to the projects on that machine: "The first thing that happens is the malware executes a search function on the local computer that looks for certain files", and "if it finds one of those files it will append heavily obfuscated malicious JavaScript code to the end of that file." It then rewrites the developer's most recent commit to include the change, keeping the original message and time, so that "to any observer looking at git history, it looks like the commit was never amended." (In one other case the same group reports stolen GitHub sign-in details being used instead, so there is more than one route.)

That explains commit messages that have nothing to do with the change inside them. It also means the developer whose name is on the commit may be a victim who never knew. We can't tell you which it was for us.

How do developers' machines get infected in the first place? The documented routes are:

  • A fake job interview or freelance brief. Google's threat researchers describe candidates "asked to perform a coding test or review a project, which requires them to download files from repositories like GitHub. These files contain malicious code." ESET found the same approach aimed at freelancers on job and freelancing sites. The FBI lists the warning sign: a "pre-employment test" that involves running unknown code.
  • A booby-trapped package. Snyk documented one that, on installation, "silently injects obfuscated JavaScript into the end of legitimate project configuration files (like tailwind.config.js)."
  • Opening a project in an editor. A project can carry instructions for the editor to run when the folder is opened. VS Code asks whether you trust a new folder first, and its documentation is plain about why: "If someone creates a malicious task, it could be unknowingly run by anyone who cloned that repository." Cursor's documentation says the same protection exists there but is "disabled by default".

And once one person on a project is infected, it travels. Anyone who pulls the code and builds it runs the loader on their own machine.

How do you check your own projects?

You're looking mainly for one thing: a code file, usually a config file, with a very long line. A config file should be short and boring.

The quick look (no tools). Open each of these files, click on the last line, and jump to the end of it (the End key on Windows and Linux, Command and the right arrow on a Mac). If the cursor lands far to the right, there is something there.

  • postcss.config.mjs or postcss.config.js
  • tailwind.config.js or tailwind.config.ts
  • next.config.js, next.config.mjs or next.config.ts
  • eslint.config.mjs or eslint.config.js
  • vite.config.js, babel.config.js, webpack.config.js

Or turn word wrap on (in VS Code, Alt+Z, or Option+Z on a Mac) and the hidden part folds into view.

The thorough check (one prompt). Ask your AI tool to do this, and to show you the output instead of summarising it:

Don't install, build, run or change anything. First fetch every remote branch.
In every branch, list any line longer than 500 characters in any .js, .mjs,
.cjs or .ts file outside node_modules and build output, and in any file
inside .vscode/. Then search every branch for these strings and list each
match with its file and branch: global['!']  global['_V']  _$_  eval(
String.fromCharCode
Also list any file named temp_auto_push.bat, and any config file that imports
createRequire but never calls require.
Show me the raw results.

A few notes on reading the results:

  • A long line is the reliable signal. One developer who wrote up their own case found that the only thing that caught it was a search for lines over 500 characters.
  • eval( and String.fromCharCode can appear in honest code. In a config file they're a reason to look, not proof.
  • Check every branch. Ours was in dozens of old ones. Each can still be built.
  • It isn't only config files. The published cases include ordinary files such as App.js and index.js, which is why the search covers all code files.
  • A leftover import is a clue. We found duplicate createRequire imports and fake require and module variables at the top of infected files. OpenSourceMalware's detection rule lists matching global['r'] = require and global['m'] = module lines, and one developer who wrote up their own case describes the same added createRequire import.

The file's size is a tell, too. An eight-line config file is a few hundred bytes. Ours had grown by more than 5,000 characters. GitHub shows each file's size, and a short config file that has grown by several kilobytes deserves a second look.

What should you do if you find it?

In this order.

  1. Stop building and stop running the project. Every build and every local start runs the loader again. Pause automatic deployments if your host allows it.
  2. Switch off every secret the build could see. Revoke or delete the old keys at each provider now: database keys, payment keys, AI keys, email passwords, deploy tokens. Assume they were copied. Your live app will lose whatever those keys powered until step 6, which is the price of being sure. OpenSourceMalware's cleanup advice includes the same instruction: "Rotate any secrets, tokens, or credentials that may have been present in the environment during a build."
  3. Remove the hidden code from every file and every branch. Delete everything after the real end of the config, and the extra lines added at the top to support it. Delete old branches you don't need.
  4. Treat the computers as suspect, not only the repository. If the code got there from an infected machine, cleaning the repository doesn't clean the machine, and it can come back. The researchers put it bluntly: "Do not assume a previously-cleaned repo remains clean". Anyone who built the project locally should have their machine checked, and should replace the passwords and keys stored on it.
  5. Find how it arrived. Look at which commits changed the config files and whose machines they came from. Ask those people to check their own computers and their other projects. Go in without assuming bad faith; they may have been hit first.
  6. Only then put new keys in. Once the code is gone from every branch and the machines are checked, create new keys and give them to the app, so they aren't read the same way. Our guide to exposed API keys has the steps for a leaked key. There the new key goes in first; here the old ones are already off.
  7. Then tighten the door. That's the next section.
New keys go in late on purpose, once the code is gone and the machines are checked.

If the stolen keys could reach customer data or payments, get professional help with the investigation and with what you're obliged to tell people. That part isn't a do-it-yourself job.

How do you stop it happening again?

You can't make it impossible. You can make it loud.

Make config files need your approval. On GitHub, a branch rule can require that changes arrive through a pull request, and can require approval from the people a CODEOWNERS file names for particular files. GitHub's description: "Code owners are automatically requested for review when someone opens a pull request that modifies code that they own." Put your config files and the .vscode folder on that list and switch on the rule that requires a code owner's review; then a change to them can't merge into that branch without your approval. For a private repository, both features need a paid GitHub plan.

Block rewritten history. The trick of amending a commit depends on overwriting commits already on GitHub. On a protected branch that's refused: "By default, each branch protection rule disables force pushes to the matching branches". Branches without a rule aren't covered.

Know what access you've given. If your project lives in a personal GitHub account, every collaborator can write to it. GitHub: "Collaborators can't have read-only access to repositories owned by a personal account." An organisation account gives you roles with less access. Britain's National Cyber Security Centre gives the principle: "Technically enforce a model of least privilege for who can make changes to your code repository", and remove access "swiftly when no longer required".

Keep production keys out of preview builds. Give preview and development builds their own low-value keys. Then a branch nobody reviewed can't read the keys that matter.

Be careful what you run. In VS Code, leave a new project in Restricted Mode until you've looked at it; in Cursor, switch that protection on first. Don't run a stranger's "test task" on the computer that holds your keys; Microsoft's advice is to "use a dedicated, isolated environment for coding tests and take-home assignments".

Check on a schedule. A long-line search takes seconds. Run it before every launch, and after any outside developer's work is merged.

What can't a check tell you?

  • That a machine is clean. A repository check looks at files. It can't see what's running on a laptop.
  • What was taken. The loader fetched its instructions at the time. Unless you captured them, you can't know what it did, which is why you replace every key instead of guessing.
  • The next variant. Strings change. The long line is the durable sign, and even that could change.
  • Who did it. A commit's author name and date are written by the computer that made it and can say anything.

A SafeLaunch check doesn't look for this: it checks your live site from the outside (exposed keys, open .env and .git files, security headers and HTTPS) and doesn't read your project's files. Use the steps above to check every branch yourself. How we verify an app lists what it covers.

Frequently asked questions

Why is there obfuscated code in my postcss.config.mjs?

Because something added it. A PostCSS config is a few short lines. Scrambled code after export default, especially on one very long line, matches a publicly documented attack that appends a loader to config files. Stop building the project, switch off the keys the build could see, remove the code from every branch, and only then put new keys in.

How do I check for malware in tailwind.config.js?

Open the file and jump to the end of the last line (End on Windows and Linux, Command and the right arrow on a Mac), or turn on word wrap. If the line runs far to the right, there is hidden content. Then search every branch for lines over 500 characters in config files and for the strings global['!'] and _$_.

Can a config file really run code?

Yes. Files like next.config.js, postcss.config.mjs, tailwind.config.js and eslint.config.mjs are JavaScript programs, not plain settings. Next.js calls its config "a regular Node.js module". Each one runs whenever its tool does, on a build or when the project is started, so anything added to it runs too.

What does global['!'] mean in my code?

It's a marker published by researchers as a sign of one specific malware campaign that hides in JavaScript config files. If you find it at the start of a long scrambled line in a config file, treat the project as infected: stop building, switch off the keys the build could see, clean every branch, and only then put new keys in.

Is it enough to delete the hidden code?

No. Deleting it stops future builds running it, but any key the build could read should be treated as copied and replaced. If the code came from an infected computer, that machine can add it again, so the computers involved need checking as well.

How did malware get into my repository if nobody added it?

Often from a developer's infected computer. Published research describes malware that finds config files on the machine, appends itself, and rewrites the developer's latest commit to include the change while keeping its original message. The person named on the commit may not know.

Does npm's ignore-scripts setting protect against this?

Not against code already in a config file. That setting stops packages running install scripts. A config file runs when your build tool loads it, which is a different moment. It can help against packages that act when they're installed, but not against ones that act when they're loaded.

Will GitHub show me the hidden code in a pull request?

It's in the change, but people who were hit report it's easy to miss; researchers describe one such change as appearing to be "a trivial semicolon addition". Don't rely on the review screen. View the raw file, check the file's size, or search for very long lines.

Sources