Kuboid
Open Luck·Kuboid.in
Security BSides2025
Open in YouTube ↗

How to Pull Off a Near Undetectable DDoS Attack (and How to Stop It)

Security BSides San Francisco72 views25:075 months ago

This talk demonstrates how client-side security vulnerabilities can be weaponized to execute distributed denial-of-service (DDoS) attacks by leveraging compromised third-party dependencies. The attack techniques include iframe flooding, fetch/XHR flooding, web worker-based flooding, and hidden window opening to generate high-volume traffic from legitimate user browsers. The presentation highlights the difficulty of detecting these attacks due to their origin from real, human-operated browsers and provides mitigation strategies such as implementing strict Content Security Policies (CSP) and monitoring network activity. The speaker emphasizes the need for organizations to audit their client-side dependencies to prevent supply-chain-based exploitation.

Weaponizing Third-Party Dependencies for Silent, Browser-Based DDoS

TLDR: Modern web applications are increasingly vulnerable to supply-chain attacks where compromised third-party JavaScript dependencies are used to turn legitimate user browsers into a distributed botnet. By injecting malicious scripts through common packages or abandoned S3 buckets, attackers can execute high-volume, near-undetectable DDoS attacks that bypass traditional network-layer defenses. Security teams must shift focus toward auditing client-side dependencies and enforcing strict Content Security Policies to mitigate this growing threat.

Web developers treat third-party dependencies like trusted building blocks. We pull in npm packages for everything from date formatting to complex UI components, often without a second thought about what that code is doing once it hits a user's browser. This blind trust is a massive, unaddressed security gap. While we obsess over server-side hardening and WAF configurations, we are ignoring the fact that a single compromised dependency can turn every visitor to your site into an unwitting participant in a distributed denial-of-service attack.

The Mechanics of Browser-Based Flooding

The core of this attack vector is simple: if you can execute arbitrary JavaScript in a user's browser, you can force that browser to make requests to any target you choose. Because these requests originate from real, human-operated browsers, they carry legitimate headers, cookies, and TLS fingerprints. They look exactly like normal traffic to traditional DDoS mitigation tools.

The attack techniques demonstrated at BSides 2025 highlight how easily this can be weaponized. The most straightforward method is iframe flooding. By creating multiple hidden iframe elements, an attacker can force a browser to load a target site repeatedly in the background.

const iframeFlood = (url) => {
  for (let i = 0; i < ATTACK_INTENSITY; i++) {
    const iframe = document.createElement("iframe");
    iframe.src = url;
    iframe.style.width = "0";
    iframe.style.height = "0";
    iframe.style.border = "0";
    document.body.appendChild(iframe);
  }
};

This is just the tip of the iceberg. More sophisticated attackers use fetch or XMLHttpRequest to hammer an API endpoint, or they spawn web workers to maintain a persistent, high-frequency stream of requests that operate independently of the main UI thread.

const startWorker = (url) => {
  const blob = new Blob([`
    setInterval(() => {
      fetch("${url}").catch(() => {});
    }, 100);
  `], { type: "application/javascript" });
  const worker = new Worker(URL.createObjectURL(blob));
};

Why Traditional Defenses Fail

Traditional DDoS protection relies heavily on identifying and blocking "bad" traffic at the network layer. We look for suspicious IP addresses, unusual ASN patterns, or malformed packets. But when the attack traffic is coming from a residential IP address in a user's home, using a standard Chrome browser, and performing a full TLS handshake, those signals disappear.

The OWASP Top 10 category A06:2021-Vulnerable and Outdated Components is the perfect home for this issue. When a dependency is compromised, it is not just a data exfiltration risk; it is a resource exhaustion risk. If you have 10,000 active users and each of their browsers is making 100 requests per second, you are generating a million requests per second. That is enough to take down most medium-sized infrastructure without ever touching your server's firewall.

The Supply Chain Reality

How do these scripts get there? It is rarely a direct hack of your primary codebase. It is almost always a supply-chain compromise. An attacker might submit a malicious pull request to a popular open-source library, or they might hijack an abandoned domain that was previously used to host a script.

One of the most common and overlooked vectors involves orphaned S3 buckets. Many sites include scripts from external buckets that were set up years ago. If that bucket expires and is re-registered by an attacker, they effectively own a piece of your application's execution environment. This is not theoretical; it is happening right now.

Defensive Strategies for the Modern Web

Defending against this requires a fundamental shift in how we view client-side security. You cannot simply trust that your dependencies are benign.

  1. Enforce Strict Content Security Policies (CSP): A well-configured CSP is your first line of defense. By restricting the domains from which your site can load scripts and connect to external APIs, you can prevent a compromised dependency from "calling home" or loading additional malicious payloads.
  2. Audit Your Dependencies: Use tools like npm audit or more advanced software composition analysis (SCA) tools to identify vulnerable packages. If you are not using a dependency, remove it. If you are using it, pin the version and monitor for updates.
  3. Monitor Network Activity: You need visibility into what your client-side code is doing. If your site suddenly starts making thousands of requests to an unknown domain, your monitoring tools should flag it immediately.
  4. Use Trusted Third-Party Providers: Be extremely selective about the external services you integrate. If a service does not have a clear, transparent security posture, do not give it access to your users' browsers.

The era of ignoring client-side security is over. As browsers become more powerful, they become more attractive targets for attackers looking to leverage your own users against you. Start auditing your dependencies today, because the next time your site goes down, it might not be a server-side issue—it might be your own code working against you.

Talk Type
talk
Difficulty
intermediate
Category
web security
Has Demo Has Code Tool Released


BSidesSF 2025

94 talks · 2025
Browse conference →
Premium Security Audit

We break your app before they do.

Professional penetration testing and vulnerability assessments by the Kuboid Secure Layer team. Securing your infrastructure at every layer.

Get in Touch
Official Security Partner
kuboid.in