The Attack Your WAF Canβt See: Supply Chain Attacks
π Quick Intro
Peter just deployed his new web application.
WAF? Configured.
DAST? Passed.
Security dashboard? All green. β
Peter: My application is secure. No hacker is getting in today!
Brian: Cool. Did you check the npm packages your application depends on?
Peter: npm what?
Brian: π
π¬ What if the biggest threat to your application isn’t an attacker breaking in, but malicious code that’s already inside?
In this episode of Not Today, Hacker!, let’s explore a security blind spot that doesn’t always involve exploiting your web application: software supply chain attacks.
Because sometimes, the code you trust can become the threat you never saw coming.
So, what happens when a dependency you trust turns against you?
π The Problem: Trusting Open-Source Packages
Modern applications rarely run entirely on code written by their developers. They depend on open-source libraries, frameworks, and third-party packages.
Now add AI coding assistants and vibe coding to the mix.
You describe what you want, and an AI tool generates the code, selects libraries, and sometimes suggests commands to install dependencies. You can build an application faster than ever, even without understanding every line of code.
That’s powerful. But faster development doesn’t automatically mean safer development.
AI-generated code can introduce vulnerable patterns, unnecessary dependencies, or packages that haven’t been properly reviewed. The risk increases when developers blindly accept generated code or run installation commands without checking what they’re adding to the project.
Attackers know that developers trust package registries, familiar package names, and increasingly, AI-generated suggestions.
One technique they exploit is typosquatting, where attackers publish packages with names similar to legitimate ones, hoping someone installs the wrong package.
And this isn’t just a hypothetical scenario.
π¨ Real-World Case: One Typo, Entire Project Gone
In May 2025, Socket researchers reported a malicious npm package named xlsx-to-json-lh.
It impersonated the legitimate package xlsx-to-json-lc and had remained on npm for approximately six years before its discovery.
Here’s what made it dangerous:
- π΅οΈ It looked legitimate: The package included working functionality, making the malicious behavior less obvious.
- π It connected to a command-and-control server: The package maintained a connection and waited for instructions.
- π£ It could delete project files: A remote trigger could cause entire project directories to be removed.
Imagine losing your source code, Git history, configuration files, and other project assets because of a dependency you trusted.
Peter: But I have a WAF!
Brian: Your WAF is protecting your website, Peter. Not every package you install on your machine.
Read the full technical breakdown from Socket here:
π Malicious npm Package Wipes Codebases with Remote Trigger
π‘οΈ Why Your WAF Can’t See This Attack
Let’s get one thing straight: the WAF isn’t broken.
A WAF primarily inspects HTTP traffic flowing through a protected web application. It helps detect and block attacks such as SQL injection, cross-site scripting, LFI, RFIβ¦etc.
But a malicious dependency can execute code during installation, while building the application, or when the application runs.
It might access local files, read environment variables, or attempt to communicate with an external server.
If that activity happens outside the traffic and systems monitored by your WAF, the WAF may never see it.
Here’s the difference:
π΄ Traditional web attack: An attacker sends a malicious request to your application. Your WAF may detect and block it.
π΄ Supply chain attack: A developer or build pipeline installs a malicious dependency. The code executes inside that environment, potentially without any malicious request reaching your protected website.
Your WAF might still block a later malicious HTTP request, depending on the traffic and its configuration. But it isn’t designed to establish whether every dependency in your application is trustworthy.
And DAST? It tests your running application for security weaknesses. It doesn’t guarantee that all your dependencies are free from malicious code.
A clean security scan doesn’t automatically mean your software supply chain is safe.
π How Do We Protect Ourselves?
No need to panic and uninstall every npm package, Peter. Let’s be practical.
β 1. Check your dependencies
Review package names, maintainers, release history, and unexpected changes. A familiar-looking name doesn’t guarantee a legitimate package.
β 2. Use lockfiles
Commit your package-lock.json and use npm ci in CI/CD pipelines for reproducible installations. Remember, a lockfile can also pin a malicious version.
β 3. Use SCA tools
Software Composition Analysis helps identify vulnerable dependencies. Consider additional package-security tools that can detect known malicious packages and suspicious behavior, not just published CVEs.
β 4. Secure your CI/CD pipeline
Apply least privilege. Restrict access to secrets and deployment credentials. Isolate build environments so that compromising one dependency doesn’t automatically expose everything.
β 5. Monitor suspicious behavior
Look for unexpected processes, unusual outbound connections, and suspicious file activity across developer machines, build agents, and production workloads.
β 6. Keep backups
If a malicious package deletes your project, an isolated, tested backup can be the difference between recovery and disaster.
One more thing: removing the package isn’t enough if it has already executed and exposed your credentials. Investigate the environment and rotate potentially compromised secrets.
π§ Final Thoughts
Your WAF is important. Your DAST scans are important. But neither one can protect every stage of your software development lifecycle.
Modern application security means looking beyond the public-facing application and understanding the risks introduced by dependencies, developers, and build pipelines.
Because sometimes, the attacker doesn’t need to break through your front door.
They just need you to install the wrong package.
Peter: So, is my WAF useless?
Brian: No, Peter. Just stop expecting it to do everyone’s job.
Secure your application. Verify your dependencies. Protect your pipeline.
And when a hacker tries to sneak malicious code into your software?
π‘οΈ Not Today, Hacker!
π¨βπ» ~whoami
I’m Vineeth, a security enthusiast since 2022 who enjoys breaking things ethically and helping teams fix them smarter.
I work around application security, WAFs, vulnerability assessments, and security automation. Through Not Today, Hacker, I share real-world security lessons in a way developers and security teams can actually use.
π¬ Quick Question Before You Go
- Do you check your npm dependencies before installing them?
- Can your current security stack detect malicious packages that don’t have a CVE?
- Have you ever caught a suspicious dependency during a security review?
Drop your thoughts in the comments. Let’s learn from each other.
π Let’s Stay Connected
Want more of this mix of π§ + π + a little Peter-level chaos?
- LinkedIn: Vineeth Tunk
- X: @TunkVineeth
- Medium: Not Today, Hacker
Together, let’s make the internet a little harder to hack, one Peter at a time. οΈ
π Catch up from the beginning:
Not Today, Hacker β Episode 1: Too Many, Too Fast: Why Your API Needs a Bouncer
https://vineethtunk.medium.com/too-many-too-fast-why-your-api-needs-a-bouncer-9bf30b7b5455

