Hacked Through a Fake Coding Interview: How the Scam Works
Fake coding interviews hack developers when you run the test repo: npm install scripts or VS Code tasks install a backdoor that steals wallets and keys.
By Samuel Brandt, Scams, safety and remote work life writer
Updated 16 min read

If you were hacked through a fake coding interview, it almost certainly happened when you ran the "take-home" project on your own computer. A command hidden in the project (an npm install script, a VS Code task, a startup file or a "fix" you pasted into a terminal) quietly downloaded a backdoor that searches for passwords, browser data, API keys and crypto wallets.
This page breaks down each step of the attack, the exact triggers that run the malware, what gets stolen, what to do in the first hour, where to report it, and how to complete real take-home tests safely.
Quick answer
A fake coding interview hacks you by getting you to run attacker code yourself. The "recruiter" sends a GitHub, GitLab or Bitbucket project. Running npm install, starting the app or trusting the folder in VS Code runs hidden scripts that install a backdoor. Microsoft has tracked this "Contagious Interview" campaign since December 2022 and was still seeing it in March 2026. It steals credentials, browser data and crypto wallets.
How a fake coding interview hack works, step by step
The scam is a normal hiring process with one poisoned step. Microsoft's March 2026 analysis describes the attackers copying a real hiring pipeline: recruiter outreach, technical discussions, an assignment and follow-ups. The aim is to get the victim to run malicious code as part of a routine evaluation (Microsoft Security blog, March 2026).
Here is the sequence the published reports describe:
- Research. The attackers study your public profile first. The FBI says these groups review professional networking profiles before they make contact and then build a tailored lure around a job offer (FBI IC3 public service announcement, September 2024).
- The approach. A recruiter messages you on LinkedIn, a freelance platform, Slack, Discord or Telegram. Microsoft says they commonly pose as recruiters for cryptocurrency trading firms or AI companies.
- Rapport. There may be several calls and more than one "team member". The FBI notes that the attackers often keep conversations going for a long time to build trust before any malware appears.
- The assignment. You're sent a repository with a task: fix a bug, add a feature, review the code, or "just get it running and tell us what you think". Microsoft gives the example of a Bitbucket repository disguised as a blockchain game.
- Execution. You clone it and run it. One of the triggers in the next section runs a hidden script.
- Install and theft. The script downloads a backdoor. The backdoor searches your machine, uploads what it finds and stays available for remote commands.
- Follow-up. The interviewer may keep talking to you for a while, so you don't connect the drained wallet or strange log-in alerts with the "job".
You don't need to have done anything careless. In the attacks studied, running the project normally, in the way any interviewer would expect, was enough.
Which step actually installed the malware?
The malware usually runs at one of four points, and each one looks like normal developer work. This table sets out what each trigger looks like, why it runs code and what stops it.
| Trigger | What you did | Why it runs code | What defuses it |
|---|---|---|---|
| npm lifecycle scripts | Ran npm install | npm automatically runs preinstall, install, postinstall and prepare scripts from package.json | Read package.json first; install with npm's ignore-scripts setting turned on |
| VS Code tasks and settings | Opened the folder and clicked "Yes, I trust the authors" | Trusted workspaces can run tasks from the .vscode folder automatically | Stay in Restricted Mode; read .vscode/tasks.json and settings.json |
| App startup code | Ran npm run dev or npm start | A hidden file loaded at server start decodes and runs the payload | Run only inside a disposable virtual machine with no secrets on it |
| "Fix" command | Pasted a command after a fake error on an interview site | The command downloads and runs a script directly | Never paste terminal commands supplied during an interview |
Sources: npm scripts documentation, VS Code Workspace Trust documentation, Elastic Security Labs, July 2026, Microsoft, March 2026. All checked November 2026.
npm install runs code before you write a line
An npm lifecycle script is a command in a project's package.json that npm runs automatically at certain moments. According to npm's documentation, preinstall, install, postinstall and prepare (plus a few others) run as part of npm install. So "I only installed the dependencies" is exactly when a malicious project wants to act.
npm's ignore-scripts setting tells npm not to run scripts from package.json files (npm config documentation). The same documentation says that if you explicitly ask npm to run a script, such as npm start, that script still runs. Turning off install scripts doesn't make starting the app safe.
VS Code trusts the folder, then runs its tasks
Workspace Trust is the VS Code feature that decides whether a folder may run code without asking you. Microsoft's report describes recent attacks where trusting the project author made VS Code run the repository's task file automatically, which then fetched the backdoor.
Sophos has described the same pattern against one of its own employees. A command hidden in the workspace settings of a GitHub "coding assignment" ran as soon as a terminal opened, and the BeaverTail loader and InvisibleFerret backdoor were running within two minutes (Sophos blog).
VS Code's own guidance is "When in doubt, leave a folder in Restricted Mode". In Restricted Mode, tasks, debugging, the terminal and extensions that haven't opted in are blocked or limited (VS Code documentation, checked November 2026).
The payload can hide in images
The startup trigger is the hardest one to spot by reading the code. Elastic Security Labs documented a 2026 campaign where a fake recruiter called "Maxwell" posted in Elastic's community Slack and then sent a copied e-commerce template as the "coding challenge". The malicious code was split into Base64 fragments hidden inside comments in the project's SVG flag images. A file called serverValidation.js reassembled the fragments and ran them with eval() whenever the project started (Elastic Security Labs, July 2026).
Elastic reported that several of these repositories had zero antivirus detections when it published. A clean virus scan of the repository doesn't prove it's safe.
The "your camera isn't working" trick
Some versions skip the repository altogether. Microsoft describes fake interview or screening websites that show a made-up technical error and then ask you to copy and paste a command to fix it. The command downloads the payload. The FBI lists "scripts supposedly needed to fix calls or video access" as a warning sign. No real interview platform asks you to paste terminal commands.
What does the malware steal?
The malware looks for anything that can be turned into money or access: crypto wallets, saved passwords, cloud and code-hosting tokens, and source code. Microsoft and Elastic list these targets for the Contagious Interview malware families (as of March and July 2026):
- Crypto wallets. Wallet recovery phrases, browser wallet extension data (MetaMask and similar) and private keys.
- Browser data. Saved passwords, autofill data and cookies from Chromium-based browsers, plus the macOS login keychain.
- Developer secrets.
.envfiles, SSH keys, cloud credentials and API tokens. Microsoft specifically mentions environment files and cryptographic keys. - Password manager artefacts. Microsoft names KeePass and 1Password data as targets.
- Your activity. Keystrokes, screenshots and clipboard contents. Elastic found the clipboard being checked every 500 milliseconds.
- Files. Documents, images, source code and shell history, uploaded to attacker servers.
- Remote control. A backdoor that lets the attacker run commands on your machine later.
The malware names you'll see in reports are BeaverTail (an infostealer and loader), InvisibleFerret (a Python backdoor), OtterCookie (a JavaScript backdoor first seen in September 2024), and FlexibleFerret (a modular backdoor with Go and Python versions). Microsoft says the newest OtterCookie variant, in use since October 2025, is much more heavily disguised, which makes it harder for antivirus to detect.
Losses can be small. In December 2023, BleepingComputer reported on a developer in Antalya, Turkey, who was approached on LinkedIn about a bug-fixing job paying $15 to $20 an hour. He ran two GitHub projects for a "tech interview" and later found 0.225 ETH (about $538 at the time) gone from his MetaMask wallet (BleepingComputer, December 2023). BleepingComputer couldn't confirm exactly how the wallet was accessed.
Who runs these scams, and why developers?
Security firms and the FBI attribute the Contagious Interview campaign to North Korean state-backed groups. Elastic links its 2026 findings to North Korea. Microsoft calls the activity Contagious Interview, and Sophos says the VS Code technique matches the methods of the group it tracks as NICKEL ALLEY. In 2024 the FBI warned that North Korean actors were running highly tailored social-engineering campaigns against people in the cryptocurrency industry, including fake job offers and "pre-employment tests".
Developers are targeted because their laptops hold the keys to everything else. A developer's machine may hold production credentials, code-signing keys, cloud sessions and access to company wallets. Microsoft's mitigation advice to companies starts with "never use a primary workstation" for take-home tests, because one infected laptop can open a route into the employer.
The Binance case
The best-known example so far is Binance. A November 2026 timeline by usecure, based on Binance's incident report and news coverage, says a Binance engineer interviewed with a fictitious company in September 2026. The process included a video call with its supposed CEO and downloading a malicious code repository. A separate employee had downloaded a tampered tool in June 2026. On 29 October 2026, about $6.3 billion left Binance wallets, and the FBI, TRM Labs and Chainalysis attributed the theft to the North Korean group known as TraderTraitor (usecure, 9 November 2026). Binance said it froze about $2.85 billion. Investigations were still ongoing when that summary was published.
You don't have to work at an exchange to be targeted. The same reports show freelancers, job seekers and people in community Slack groups being approached, and the 2023 victim above was a freelancer answering an Upwork-style bug-fix offer.
Where in the world this happens
The campaign isn't limited to one country. The documented victims and lures range from Turkey (the 2023 MetaMask case) to a global open-source Slack community (Elastic) to employees of US and UK security companies. Because the lures arrive over LinkedIn, Slack and freelance platforms, a developer in Lagos, Bengaluru, São Paulo or Warsaw sees the same messages as one in San Francisco. Crypto, Web3, fintech and AI roles, especially ones advertised as "worldwide", are the most common cover stories.
I ran the project: what to do in the first hour
If you've already run a suspicious coding test, assume the machine is compromised and move your money and access out of reach before you clean anything. The order matters, because the attacker may still be connected.
- Disconnect the infected machine from the internet but leave it switched on. This is the FBI's advice: it stops data leaving while keeping evidence for investigators.
- Move any crypto from a clean device. Use a different phone or computer to create a new wallet with a new recovery phrase and transfer the funds to it. Assume any recovery phrase that was ever typed, stored or pasted on the infected machine is known to the attacker.
- Change passwords from a clean device. Start with email, password manager, GitHub, GitLab and Bitbucket, cloud consoles, and banking. Turn on multi-factor authentication anywhere it's off.
- Revoke tokens and keys. Generate new SSH keys and cancel the old ones in GitHub and other services. Revoke personal access tokens, npm tokens, cloud API keys and anything in a
.envfile. Microsoft advises rotating exposed credentials and tokens and reviewing access to repositories and build pipelines. - Log out of every session. Browser cookies were in scope, so use "sign out of all sessions" in Google, Microsoft, GitHub, Slack and similar services.
- Tell your employer's security team right away if the machine (or any account on it) has access to work systems. That includes the day before you had planned to tell anyone. Fast reporting limits the damage.
- Keep the evidence. Screenshot the recruiter's profile, the messages, the repository link and the commit history before the attacker deletes them.
- Then rebuild. Once the evidence is kept or handed over, wipe and reinstall the operating system. Removing the repository folder isn't enough, because the backdoors install persistence of their own (Microsoft notes FlexibleFerret uses Windows registry Run keys).
Signs you were compromised
You won't always see anything. Elastic notes some developers only reported "odd behaviour" after running test projects. Things to check include:
- Unexpected outgoing wallet transactions or new token approvals
- Log-in alerts or new SSH keys on GitHub, Google or cloud accounts that you didn't add
- Unknown Node.js or Python processes running in the background, especially ones making network connections
- New startup items or scheduled tasks
- An antivirus alert that appeared as the project ran (Sophos's endpoint software had already flagged the first script, but a broken agent on that Mac meant it wasn't stopped)
Where to report a fake coding interview
Report it to the police in your country, the platform where you were contacted, and the code host. This table lists the routes we confirmed in November 2026.
| Where | What to report | How |
|---|---|---|
| United States | Any loss or compromise, especially crypto | File a complaint at ic3.gov with screenshots and attacker account names |
| England, Wales, Northern Ireland | Fraud or cybercrime, including being hacked | Report Fraud, or 0300 123 2040 (NCSC guidance) |
| Scotland | Fraud or cybercrime | Police Scotland on 101 (same NCSC page) |
| GitHub | The malicious repository and the account | "Report repository" in the About sidebar, or "Block or report" on the profile (GitHub Docs) |
| LinkedIn, Slack, Discord, Upwork | The recruiter's account | Use the platform's report option on the profile or message |
| Everywhere else | Theft or account compromise | Your national police cybercrime unit or fraud reporting service |
If you're in India, the Philippines, Nigeria, Kenya, Brazil or elsewhere, use your national cybercrime reporting channel. We couldn't open every national portal for this page, so check your police or national cybersecurity agency's site for the current route. If crypto was stolen, also tell the exchange that the funds were moved to. Exchanges can sometimes freeze stolen funds, as Binance's partial freeze shows.
How to tell a fake coding interview before you run anything
The warning signs are mostly in how the test is set up, not in the job ad. Here are the signs drawn from the FBI and Microsoft guidance:
- The test needs you to run their code, not write yours. The FBI flags "pre-employment tests" that require running unfamiliar packages, scripts or repositories.
- New or empty accounts. Microsoft lists newly created repositories or accounts and short links as red flags.
- Complicated setup. Unusual install steps, requests to turn off security tools, or pressure to "trust the authors" in your editor.
- Pay that's too good, with no negotiation. The FBI names unexpectedly high pay offered without discussion.
- Moving off-platform. Requests to move from LinkedIn to Telegram, WhatsApp or Discord. Our guides on interviews held on Telegram or Wire and Discord interview requests cover this in more detail.
- Commands to "fix" audio or video. A real company will reschedule or switch to a phone call instead.
- Rushing. "We need it running in the next hour so the CTO can review."
Real companies do send take-home tests, so a take-home on its own proves nothing. The difference is that a genuine test is usually a small, self-contained exercise you can complete in a fresh project, often on a platform like CoderPad or HackerRank, or a repository from the company's own organisation account linked from its careers site. Check the recruiter separately, using our guide on how to identify a fake recruiter on LinkedIn, and confirm the job exists on the company's official careers page before you clone anything.
How to do a take-home coding test safely
The safe default is to run any test code only in a disposable environment that holds nothing you'd mind losing. The FBI and Microsoft both recommend a virtual machine on a non-work device, and Microsoft specifies a non-persistent one. Here is a workflow you can use for every test, even ones from companies you trust.
A safe take-home workflow
- Verify the company first. Find the role on the company's official careers page, and check that the recruiter's email uses the company domain. If the repository is under a personal account rather than the company's organisation, ask why.
- Read before you open. Look at the repository in the browser first. Check
package.jsonscripts, any.vscodefolder (tasks.json,settings.json,launch.json),postinstallhooks, minified or encoded strings,eval(), and files that don't belong (such as large image folders that are loaded by server code). - Use a throwaway environment. A virtual machine, a cloud development environment you can delete, or a spare laptop with no wallets, no password manager, no work log-ins and no SSH keys.
- Open in Restricted Mode. If VS Code asks whether you trust the authors, choose no until you've read the task and settings files.
- Install with scripts off. Set npm's
ignore-scriptsoption before your first install, then decide whether any script is actually needed. - Delete the environment afterwards. Don't copy files back to your main machine.
What if the company insists you run it locally?
Ask, in writing, whether you can complete the task in a container or online editor instead. A real hiring team will usually say yes or explain its reason. Here's an example message you can adapt:
Example: "Thanks for sending the assignment. As a standard security practice I run third-party code in an isolated environment rather than on my main machine. I'll complete it in a disposable VM and share my changes as a pull request. Let me know if that causes any problem for your review."
A recruiter who pushes back hard on this, or tells you to turn off security features, has told you what you need to know.
Frequently asked questions
Can you get hacked just by cloning a GitHub repository?
No, cloning alone doesn't run code. The danger starts when you open the folder in an editor that trusts it, run npm install, or start the app. Those steps can run scripts from the repository, so read package.json and the .vscode folder before you do any of them.
Does antivirus catch fake coding interview malware?
Not reliably. Elastic reported in July 2026 that several malicious interview repositories had zero antivirus detections, and Microsoft says the latest OtterCookie variant is heavily disguised to avoid detection. Antivirus helps, but an isolated environment matters more.
Is it safe to run a take-home coding test on a Mac or Linux?
No operating system is safe by default. Microsoft documented the malware searching macOS file systems, Elastic found it stealing the macOS login keychain, and the Sophos case involved a Mac. The scripts run through Node.js and Python, which work the same on every platform.
I ran the project but I don't own any crypto. Should I still worry?
Yes. The malware also takes saved browser passwords, cookies, SSH keys, cloud tokens and documents, and it leaves a backdoor for later use. Change your passwords and revoke tokens from a clean device, then reinstall the operating system.
Do real companies ask candidates to run their code?
Some do, usually a small exercise from the company's own repository or on a hosted platform such as CoderPad or HackerRank. A real company will accept you running it in a container or virtual machine. Be suspicious when the code comes from a personal account, needs complex setup, or must run on your own machine.
Can I get stolen crypto back after a fake interview?
Sometimes, but it's rare. Report it straight away to the police (ic3.gov in the US, Report Fraud in England, Wales and Northern Ireland) and to any exchange the funds went to, since exchanges can freeze stolen assets. Be wary of "recovery services" that contact you offering to get the money back for a fee.
Why do fake recruiters target crypto and Web3 developers?
Crypto developers often have wallets, signing keys and exchange access on their laptops, which can be turned into money directly. Microsoft says the recruiters usually pose as cryptocurrency trading firms or AI companies, and the FBI's 2024 warning was aimed specifically at the crypto industry.
Key takeaways
- A fake coding interview hacks you when you run the project:
npm installscripts, VS Code tasks in a trusted folder, hidden startup code or a pasted "fix" command start the malware. - Microsoft has tracked this Contagious Interview campaign since December 2022 and was still seeing it in March 2026, and security firms and the FBI link it to North Korean groups.
- The malware targets crypto wallets, browser passwords and cookies, SSH keys, cloud tokens and
.envfiles, and it installs a backdoor. - If you ran it, disconnect the machine, move crypto and change passwords from a clean device, revoke every token, report it, then reinstall the operating system.
- Run every take-home test in a disposable environment with no secrets, in VS Code Restricted Mode, with npm install scripts turned off.
Next steps
Before your next technical interview, set up a throwaway virtual machine or cloud development environment so you're never tempted to run test code on your main laptop. Then look for roles where you can check the employer: remote tech jobs on RemoteApply show where applicants may live, and company profiles help you match a recruiter's message to a real organisation. For the wider pattern behind these approaches, read how fake recruiter scams work and our checklist before you share documents.
Malware behaviour, platform settings and reporting routes were checked against Microsoft, Elastic, Sophos, the FBI, the NCSC, npm, VS Code and GitHub documentation in November 2026.
Sources
- Contagious Interview: Malware delivered through fake developer job interviews, Microsoft Security blog
- Contagious Interview malware and SVG steganography, Elastic Security Labs
- What happens when a fake coding test reaches a security company, Sophos
- North Korea conducting significant social engineering campaigns (I-090324-PSA), FBI IC3
- Binance hack: how a fake job interview led to a $6.3B theft, usecure
- Workspace Trust, Visual Studio Code documentation
- scripts, npm Docs
- config, npm Docs
- Blockchain dev's wallet emptied in job interview using npm package, BleepingComputer
- Report a scam email, NCSC
- Reporting abuse or spam, GitHub Docs


