Gcore named a Leader in the GigaOm Radar for AI Infrastructure!Get the report
  1. Home
  2. Developers
  3. What Is a Man-in-the-Middle (MITM) Attack? | How to Prevent a MITM Attack

What Is a Man-in-the-Middle (MITM) Attack? | How to Prevent a MITM Attack

  • By Gcore
  • June 6, 2023
  • 9 min read
What Is a Man-in-the-Middle (MITM) Attack? | How to Prevent a MITM Attack

A Man-in-the-Middle (MITM) attack is a form of cyber attack which threatens data and information security. It occurs when an unauthorized person—a cybercriminal—positions themselves as a conduit between two parties to monitor interactions, steal sensitive information, and manipulate transactions. For example, they can steal trade secrets, compromise financial records, or embed malware on the company’s servers. In this article, we will explain everything you need to know about MITM attacks and outline practical prevention measures that you can take.

What Is a Man-in-the-Middle (MITM) Attack?

A Man-in-the-Middle attack occurs when a cybercriminal intercepts the network between two parties to eavesdrop, spy, or steal sensitive information. The attacker can also manipulate the personality of either party by injecting new data into the communication.

MITM attacks exploit vulnerabilities like weak encryption, insecure public Wi-Fi networks, and unverified website certificates. Let’s find out how.

How Do MITM Attacks Happen?

Usually, MITM attacks comprise two steps. The details depend on the attacker’s objectives and the nature of the communication between the two parties, but there are some broad activities that characterize MITM attacks.

Step 1: Interception

During interception, an attacker first gathers information about the target network or the communication channels through reconnaissance. Reconnaissance tools—such as network scanners—discover potential entry points and vulnerabilities.

Next, the attacker uses methods such as spoofing (see the next section for more methods) to intercept the communication between the two parties and hijack the traffic before it reaches its destination. Attackers then capture and read the content of the exchanged messages.

Step 2: Decryption

If the intercepted network is encrypted, the attacker uses decryption methods such as RSA to capture the messages in the original plaintext. Decryption is only possible if the encryption techniques employed by both parties in the network are weak. After decryption, the attacker modifies and manipulates the content, often by injecting malware or requesting sensitive information in the guise of a legitimate party.

After achieving their objectives, the attacker covers their tracks by returning the communication channel to the original state.

What Methods Do MITM Attacks Use?

During the interception phase, man in the middle attackers use various methods to intercept the communication between the two parties and hijack the traffic before it reaches its destination. Let’s look at the seven most common methods attackers employ to execute MITM attacks.

Phishing

In phishing, attackers use malicious links, emails, or websites to trick either party into revealing sensitive information, such as login credentials or credit card information. Attackers often create fake login pages that appear genuine and ask either party to input credentials that are captured immediately.

Example: An attacker disguises themselves as a bank and sends a professionally written email requesting that a user logs into the bank’s website to verify certain details. The user clicks the link in the email and inputs their banking credentials, but the page never loads. The user considers it a network glitch, but the attacker has successfully captured the credentials and used them on the bank’s original website.

Session Hijacking

Attackers may intercept any of the two party’s login sessions into the network by sniffing valid session cookies or tokens.

Example: Cookies and tokens are confidential details sent by the networks to a user’s browser during login. In this method, the attacker sniffs the token and uses it as a ticket into the network even after the original user has gained access.

Spoofing

Spoofing occurs when attackers disguise themselves as another person or source of information. Spoofing can be executed through four major channels: ARP, IP, DNS, and HTTPS.

ARP spoofingAddress Resolution Protocol (ARP) spoofing is a method where an attacker spoofs network ARP tables to redirect traffic to their device instead of the intended recipient. The attacker forges fake ARP requests/replies to targets. The victims update their ARP cache with the attacker’s MAC address instead of the genuine target’s. This causes the traffic between the targets to split, with one part going from the first party to the attacker, and the other going from the second party to the attacker.
IP spoofingHere, the attacker manipulates the Internet Protocol (IP) address of the systems in a network by altering the packet headers of the applications in the network. Once either party initializes the application, all information is routed to the attacker.
DNS spoofingWith Domain Name System (DNS) spoofing, attackers redirect the traffic to a fake website or a phishing page. This is achieved by modifying the victim’s DNS cache so that the domain name resolves to a fake IP address controlled by the attacker, leading the victim to the attacker’s fake website.
HTTPS spoofingHyperText Transfer Protocol Secure (HTTPS) is the foundation of communication on the web. In HTTPS spoofing, an attacker sends a certificate to their target’s browser after the victim initially requests to secure the site. The phony certificate holds a digital thumbprint of the compromised browser or application. The browser then verifies the thumbprint using a list of recognized trusted sites. When the victim visits the website or transmits data via the browser, the attacker intercepts the desired information before it reaches its intended destination.

Wi-Fi Eavesdropping

Attackers can carry out MITM attacks by intercepting or forging the credentials of genuine Wi-Fi access points, luring unknowing users to connect to their fake Wi-Fi hotspots. Threat actors can intercept website connections and acquire unencrypted sensitive information through such an attack.

Example: The attacker places a Wi-Fi hotspot near McDonald’s. The point is called “McDonald’s” and does not have a password. Thinking it’s the restaurant’s Wi-Fi, users connect to it and access the internet through it. The attacker gains access to all sent and received data.

SSL Hijacking

Secure Sockets Layers (SSL) encrypt the connection between a browser and a web server. In Secure Sockets Layers (SSL) hijacking, the attacker intercepts the SSL/TLS traffic between the sender and receiver’s device and impersonates a server. The attacker forces a downgraded SSL connection, steals the SSL certificate and key, and mimics the genuine website, making the victim believe they are interacting with a genuine server.

The attacker can then decrypt the intercepted SSL/TLS traffic, giving them full access to the data exchanged between the user and the server. This may include sensitive information like login credentials, credit card details, or personal information, which they can misuse for malicious purposes.

SSL BEAST

SSL Browser Exploit Against SSL/TLS (BEAST) targets a specific Transport Layer Security (TLS) vulnerability in SSL. The attacker infects their target’s computer with malicious JavaScript to seize encrypted cookies sent by a web application. The application’s cipher block chaining (CBC) is then compromised so the attacker can decrypt its cookies and authentication tokens. Then, the attacker can impersonate the victim and gain access to their web application accounts. As a result, they can cause harm to the victim by stealing sensitive information or performing fraudulent transactions.

SSL Stripping

This man in the middle method intercepts the TLS authentication sent from an application to a user and downgrades an HTTPS connection to HTTP. The attacker sends the user an unencrypted version of the application’s site. Even when the victim maintains a secure session within the application, the session is visible to the hacker, meaning that sensitive information like passwords or financial data are exposed.

Example: example.com, an HTTPS-enabled website, typically sends a secure TLS authentication to each browser. But in this instance, the attacker intercepts this TLS authentication sent by example.com to the user’s browser, removes the extra layer of security that HTTPS enables, and routes the unsecured version to the user’s browser. This exposes the user to exploitation and theft.

Have MITM Attacks Happened Before? What Are Some Examples of MITM Attacks?

Yes, there have been several notable MITM attacks. Let’s review some of the most potent and infamous instances:

FirmImpact
DarkHotel (2017)DarkHotel is a group specializing in hacking hotel guests. In 2017, they used MITM attacks to steal sensitive data from business travelers staying in luxury hotels.
The Superfish scandal (2015)This scandal occurred in 2015 when Lenovo laptops were shipped with adware that exposed personal information—such as login credentials—to phishing attacks using MITM methods.
Hacking Team (2015)Italian cybersecurity company Hacking Team sells surveillance and intrusion software to governments and law enforcement agencies worldwide. In 2015, they experienced a data breach whereby attackers utilized a MITM attack to grab the two-factor authentication code of an employee, which gave them access to the organization’s servers and sensitive company information.
The Jackpotting attack (2014)In this 2014 attack, cybercriminals used insecure Wi-Fi connections to conduct MITM attacks on ATMs. They targeted the network infrastructures of ATMs and infected them with malware, allowing them to hijack the machines, intercept card data and dispense cash illegally. This attack resulted in the theft of millions of dollars from banks.
Target Corporation (2013)In 2013, Target Corporation experienced a massive data breach that affected over 110 million customers. Attackers used a variant of a MITM attack known as RAM scraping to steal sensitive information, such as credit card data, during transactions at point-of-sale (POS) systems.
The 2015 GBP 333,000 attackIn 2015, Paul and Ann Lupton’s email exchange with their real estate solicitor was intercepted by cybercriminals. The cybercriminals requested the Luptons’ bank accounts for the transfer of funds from a home sale. The solicitor sent the funds worth just over GBP 330,000 to the criminals’ accounts. It took a few days before either party discovered that there had been a breach.

Can MITM attacks be prevented?

Yes, MITM can be prevented in many instances. Facebook and Apple offer case studies of organizations that successfully mitigated MITM attacks, and the preventative techniques they used afterwards to strengthen protection against MITM attacks.

The fact that tech giants suffer from MITM attacks shows that MITM attacks can happen to anyone—and the techniques they used can be applied by businesses of all types and sizes.

Facebook

In 2011, researchers uncovered a vulnerability in Facebook’s SSL/TLS implementation, which could have allowed attackers to conduct a MITM attack on Facebook users. Facebook implemented “forward secrecy” technology to prevent such attacks for all SSL/TLS connections. This means that if an attacker successfully intercepts the SSL/TLS session, previous user interactions can not be decrypted.

As a result of discovering this weakness, Facebook additionally implemented a domain name system security extension (DNSSEC,) which prevents DNS tampering and spoofing. They also employed Secure Hash Algorithm 2 (SHA-256) to secure their SSL/TLS certificates.

Apple

In 2014, Apple faced potential man in the middle attacks on iOS devices due to a critical security flaw within the app’s API. To prevent such attacks, Apple released patches for its iOS devices. The patches introduced features such as Application Transport Security (ATS,) which ensures that an app connected to the internet or a local network must use secure communication protocols (HTTPS) to protect communication between a server and an app.

Apple devices also feature Wi-Fi Assist to secure Wi-Fi network communications and prevent MITM attacks. This feature automatically switches off connection to unsecured networks and switches to cellular networks when Wi-Fi reliability is poor.

7 Best Practices to Prevent MITM Attacks

If tech royalty can get tangled up in a mess of MITM attacks, then every single organization must use preventive best practices to ensure they steer clear of this danger. These best practices aren’t foolproof, but they’ll give you a serious head start to deter attacks before they start and make a successful attack less likely. Here are eight best practices you can immediately implement.

1. Encrypt your Network and Channels

Encryption involves encoding data into a code that only the sender and the receiver can access. In this age of remote work, it is important to use encrypted Wi-Fi networks and ensure that your online transactions are HTTPS-enabled. Encrypting both the data and the communication channel offers superior protection. You can encrypt data both in transit (i.e., data transferred from one device to another) or at rest (i.e., data stored on devices.) Both forms of encryption are possible using SSL and TLS.

Weak encryptions can still be decrypted by attackers, as mentioned earlier. This makes strong encryption all the more important for avoiding and preventing MITM attacks.

2. Use Strong Authentication Protocols

Use strong authentication protocols such as Multi-factor authentication (MFA) that are difficult to bypass and require the provision of two or more proofs of authenticity. If hackers intercept credentials such as usernames and passwords, they cannot gain access without the second authentication factor, which may comprise biometric data, smart cards, or hardware tokens.

Token-based authentication is another MFA solution you should consider. By utilizing a unique device that generates a temporary passcode, both parties in the network are granted access to sensitive data and network systems.

3. Use VPNs

Virtual private networks (VPNs) provide a secure tunnel between a user’s device and the internet, making it difficult for attackers to intercept data. By encrypting the data in transit, attackers cannot read the contents of the data even if they intercept it.

4. Install Intrusion Detection/Prevention Systems (IDS/IPS)

IDS and IPS monitor network traffic and alert administrators when there is abnormal activity, such as attempts to hijack your network’s traffic. Intrusion prevention systems can also prevent attacks by blocking malicious traffic or applying mitigation measures.

5. Undertake Regular Network Security Audits

Regular network security audits can help identify potential MITM vulnerabilities early and assist organizations in taking proactive measures to address them. SSL/TLS certificates protect emails in transit, and PGP/GPG encryption protects them at rest.

Additionally, setting segmentation policies—such as endpoint micro segmentation—is important, because it moves users into a protected environment, isolating them from the local network. Some segmentation policies operate as a bidirectional firewall to prevent data leakage and maintain secure traffic within the network gateway.

6. Update and Patch Software

Separate sensitive data from other data located in hybrid storage. Implement efficient patch management by regularly updating the software and antivirus security systems, promptly applying software patches on all devices, and scheduling auditing and monitoring to alert you about normal and unusual activities within your network. Efficient patch management also entails revisiting and upgrading your firewalls as your data volumes grow.

7. Offer Employees Security Awareness and Training

One of the most common methods of man in the middle attacks is phishing. With this method, attackers trick individual employees into divulging login credentials or installing malware on their devices. According to IBM’s 2022 Cost of Data Breach Report, phishing was the second most common cause of a breach, accounting for 16% of cases. It was also the costliest, averaging USD $4.91 million in breach costs.

Employees must therefore be trained to avoid clicking on suspicious links and emails. Organizations should also warn their staff from using public Wi-Fi networks for their job as part of security training.

8. Use a Third-Party Protection Solution

Your in-house cybersecurity tools may also be prone to MITM attacks orchestrated through social engineering methods like phishing. Adding an extra layer of protection by employing third-party services like Gcore boosts protection from MITM attacks.

However, not all solutions out there are efficient. Search for reviews and feedback from other customers; make sure whatever solution you employ has been in business for a while and uses next-generation technology like ML-enabled data encryption. Finally, ensure that the solution has a responsive customer support team and a service-level agreement (SLA) that defines the quality of service you can expect.

Gcore Tools Help Prevent Man-in-the-Middle (MITM) Attacks

Gcore is a trusted security solutions provider with products that can help prevent all methods employed in Man-in-the Middle (MITM) attacks. We offer DDoS mitigation, DNS hosting, and web application security for business.

Conclusion

A Man-in-the-Middle (MITM) attack is a sophisticated and common cyber-attack that can adversely impact the security of individuals and organizations. Preventing MITM attacks requires an understanding of the attack process and implementation of comprehensive security measures. A reliable third-party, like Gcore, can provide robust protection against MITM attacks. Get a free consultation with our security expert to learn more.

Related articles

How to protect login pages with Gcore WAAP

Exposed login pages are a common vulnerability across web applications. Attackers often use automated tools to guess credentials in brute-force or credential-stuffing attacks, probe for login behavior to exploit session or authentication logic, or overload your infrastructure with fake requests.Without specific rules for login-related traffic, your application might miss these threats or apply overly broad protections that disrupt real users. Fortunately, Gcore WAAP makes it easy to defend these sensitive endpoints without touching your application code.In this guide, we’ll show you how to use WAAP’s custom rule engine to identify login traffic and apply protections like CAPTCHA to reduce risk, block automated abuse, and maintain a smooth experience for legitimate users. We’ve also included a complete video walkthrough from Gcore’s Security Presales Engineer, Michal Zalewski.Video walkthroughHere’s Gcore’s Michal Zalewski giving a full walkthrough of the steps in this article.Step 1: Access your WAAP configurationGo to portal.gcore.com and log in.Navigate to WAAP in the sidebar. If you’re not yet a WAAP user, it costs just $26/month.Select the resource that hosts your login form; for example, gcore.zalewski.cloud.Step 2: Create a custom ruleIn the main panel of your selected resource, go to WAAP Rules.Click Add Custom Rule in the upper-right corner.Step 3: Define the login page URLIdentify the login endpoint you want to protect:Use tools like Burp Suite or the "Inspect" feature in your browser to verify the login page URL.In Burp Suite, use the Proxy tab, or in the browser, check the Network tab to inspect a login request.Look for the path (e.g., /login.php) and HTTP method (POST).In the custom rule setup:Enter the URL (e.g., /login.php).Tag the request using a predefined tag. Select Login Page.Step 4: Name and save the ruleProvide a name for the rule, such as “Login Page URL”, and save it.Step 5: Add a CAPTCHA challenge ruleTo protect the login page from automated abuse:Create a new custom rule.Name it something like “Login Page Challenge”.Under Conditions, select the previously created Login Page tag.Set the Action to CAPTCHA.Save the rule.Step 6: Test the protectionReturn to your browser and turn off any proxy tools.Refresh the login page.You should now be challenged with a CAPTCHA each time the login page loads.Once the CAPTCHA is completed successfully, users can log in as usual.Monitor, adapt, and alertAfter deployment:Track rate limit trigger frequencyMonitor WAAP logs for anomaly detectionRotate exemptions or thresholds based on live behaviorFor analytics, refer to the WAAP analytics documentation.Bonus tips for hardened protectionCombine with bot protection: Enable WAAP’s bot mitigation to identify headless browsers and automation tools like Puppeteer or Selenium. See our bot protection docs for setup instructions.Customize 429 responses: Replace default error pages with branded messages or a fallback action. Consider including a support link or CAPTCHA challenge. Check out our response pages documentation for more details.Use geo or ASN exceptions: Whitelist trusted locations or block known bot-heavy ASNs if your audience is localized.Automate it: optional API and Terraform supportTeams with IaC pipelines or security automation workflows might want to automate login page protection with rate limiting. This keeps your WAAP config version-controlled and repeatable.You can use the WAAP API or Terraform to:Create or update rulesRotate session keys or thresholdsExport logs for auditingExplore the WAAP API documentation and WAAP Terraform provider documentation for more details.Stop abuse before it starts with GcoreLogin pages are high-value targets, but they don’t have to be high risk. With Gcore WAAP, setting up robust defenses takes just a few minutes. By tagging login traffic and applying challenge rules like CAPTCHA, you can reduce automated attack risk without sacrificing user experience.As your application grows, revisit your WAAP rules regularly to adapt to new threats, add behavior-based detection, and fine-tune your protective layers. For more advanced configurations, check out our documentation or reach out to Gcore support.Get WAAP today for just $26/month

3 underestimated security risks of AI workloads and how to overcome them

3 underestimated security risks of AI workloads and how to overcome them

Artificial intelligence workloads introduce a fundamentally different security landscape for engineering and security teams. Unlike traditional applications, AI systems must protect not just endpoints and networks, but also training data pipelines, feature stores, model repositories, and inference APIs. Each phase of the AI life cycle presents distinct attack vectors that adversaries can exploit to corrupt model behavior, extract proprietary logic, or manipulate downstream outputs.In this article, we uncover three security vulnerabilities of AI workloads and explain how developers and MLOps teams can overcome them. We also look at how investing in your AI security can save time and money, explore the challenges that lie ahead for AI security, and offer a simplified way to protect your AI workloads with Gcore.Risk #1: data poisoningData poisoning is a targeted attack on the integrity of AI systems, where malicious actors subtly inject corrupted or manipulated data into training pipelines. The result is a model that behaves unpredictably, generates biased or false outputs, or embeds hidden logic that can be triggered post-deployment. This can undermine business-critical applications—from fraud detection and medical diagnostics to content moderation and autonomous decision-making.For developers, the stakes are high: poisoned models are hard to detect once deployed, and even small perturbations in training data can have system-wide consequences. Luckily, you can take a few steps to mitigate against data poisoning and then implement zero-trust AI to further protect your workloads.Mitigation and hardeningRestrict dataset access using IAM, RBAC, or identity-aware proxies.Store all datasets in versioned, signed, and hashed formats.Validate datasets with automated schema checks, label distribution scans, and statistical outlier detection before training.Track data provenance with metadata logs and checksums.Block training runs if datasets fail predefined data quality gates.Integrate data validation scripts into CI/CD pipelines pre-training.Enforce zero-trust access policies for data ingestion services.Solution integration: zero-trust AIImplement continuous authentication and authorization for each component interacting with data (e.g., preprocessing scripts, training jobs).Enable real-time threat detection during training using runtime security tools.Automate incident response triggers for unexpected file access or data source changes.Risk #2: adversarial attacksAdversarial attacks manipulate model inputs in subtle ways that trick AI systems into making incorrect or dangerous decisions. These perturbations—often imperceptible to humans—can cause models to misclassify images, misinterpret speech, or misread sensor data. In high-stakes environments like facial recognition, autonomous vehicles, or fraud detection, these failures can result in security breaches, legal liabilities, or physical harm.For developers, the threat is real: even state-of-the-art models can be easily fooled without adversarial hardening. The good news? You can make your models more robust by combining defensive training techniques, input sanitization, and secure API practices. While encrypted inference doesn’t directly block adversarial manipulation, it ensures that sensitive inference data stays protected even if attackers attempt to probe the system.Mitigation and hardeningUse adversarial training frameworks like CleverHans or IBM ART to expose models to perturbed inputs during training.Apply input sanitization layers (e.g., JPEG re-encoding, blurring, or noise filters) before data reaches the model.Implement rate limiting and authentication on inference APIs to block automated adversarial probing.Use model ensembles or randomized smoothing to improve resilience to small input perturbations.Log and analyze input-output patterns to detect high-variance or abnormal responses.Test models regularly against known attack vectors using robustness evaluation tools.Solution integration: encrypted inferenceWhile encryption doesn't prevent adversarial inputs, it does mean that input data and model responses remain confidential and protected from observation or tampering during inference.Run inference in trusted environments like Intel SGX or AWS Nitro Enclaves to protect model and data integrity.Use homomorphic encryption or SMPC to process encrypted data without exposing sensitive input.Ensure that all intermediate and output data is encrypted at rest and in transit.Deploy access policies that restrict inference to verified users and approved applications.Risk #3: model leakage of intellectual assetsModel leakage—or model extraction—happens when an attacker interacts with a deployed model in ways that allow them to reverse-engineer its structure, logic, or parameters. Once leaked, a model can be cloned, monetized, or used to bypass the very defenses it was meant to enforce. For businesses, this means losing competitive IP, compromising user privacy, or enabling downstream attacks.For developers and MLOps teams, the challenge is securing deployed models in a way that balances performance and privacy. If you're exposing inference APIs, you’re exposing potential entry points—but with the right controls and architecture, you can drastically reduce the risk of model theft.Mitigation and hardeningEnforce rate limits and usage quotas on all inference endpoints.Monitor for suspicious or repeated queries that indicate model extraction attempts.Implement model watermarking or fingerprinting to trace unauthorized model use.Obfuscate models before deployment using quantization, pruning, or graph rewriting.Disable or tightly control any model export functionality in your platform.Sign and verify inference requests and responses to ensure authenticity.Integrate security checks into CI/CD pipelines to detect risky configurations—such as public model endpoints, export-enabled containers, or missing inference authentication—before they reach production.Solution integration: native security integrationIntegrate model validation, packaging, and signing into CI/CD pipelines.Serve models from encrypted containers or TEEs, with minimal runtime exposure.Use container and image scanning tools to catch misconfigurations before deployment.Centralize monitoring and protection with tools like Gcore WAAP for real-time anomaly detection and automated response.How investing in AI security can save your business moneyFrom a financial point of view, the use of AI and machine learning in cybersecurity can lead to massive cost savings. Organizations that utilize AI and automation in cybersecurity have saved an average of $2.22 million per data breach compared to organizations that do not have these protections in place. This is because the necessity for manual oversight is reduced, lowering the total cost of ownership, and averting costly security breaches. The initial investment in advanced security technologies yields returns through decreased downtime, fewer false positives, and an enhanced overall security posture.Challenges aheadWhile securing the AI lifecycle is essential, it’s still difficult to balance robust security with a positive user experience. Rigid scrutiny can add additional latency or false positives that can stop operations, but AI-powered security can avoid such incidents.Another concern organizations must contend with is how to maintain current AI models. With threats changing so rapidly, today's newest model could easily become outdated by tomorrow’s. Solutions must have an ongoing learning ability so that security detection parameters can be revised.Operational maturity is also a concern, especially for companies that operate in multiple geographies. Well-thought-out strategies and sound governance processes must accompany the integration of complex AI/ML tools with existing infrastructure, but automation still offers the most benefits by reducing the overhead on security teams and helping ensure consistent deployment of security policies.Get ahead of AI security with GcoreAI workloads introduce new and often overlooked security risks that can compromise data integrity, model behavior, and intellectual property. By implementing practices like zero-trust architecture, encrypted inference, and native security integration, developers can build more resilient and trustworthy AI systems. As threats evolve, staying ahead means embedding security at every phase of the AI lifecycle.Gcore helps teams apply these principles at scale, offering native support for zero-trust AI, encrypted inference, and intelligent API protection. As an experienced AI and security solutions provider, our DDoS Protection and AI-enabled WAAP solutions integrate natively with Everywhere Inference and GPU Cloud across 210+ global points of presence. That means low latency, high performance, and proven, robust security, no matter where your customers are located.Talk with our AI security experts and secure your workloads today

Flexible DDoS mitigation with BGP Flowspec cover image

Flexible DDoS mitigation with BGP Flowspec

For customers who understand their own network traffic patterns, rigid DDoS protection can be more of a limitation than a safeguard. That’s why Gcore supports BGP Flowspec: a flexible, standards-based method for defining granular filters that block or rate-limit malicious traffic in real time…before it reaches your infrastructure.In this article, we’ll walk through:What Flowspec is and how it worksThe specific filters and actions Gcore supportsCommon use cases, with example rule definitionsHow to activate and monitor Flowspec in your environmentWhat is the BGP Flowspec?BGP Flowspec (RFC 8955) extends Border Gateway Protocol to distribute traffic filtering rules alongside routing updates. Instead of static ACLs or reactive blackholing, Flowspec enables near-instantaneous propagation of mitigation rules across networks.BGP tells routers how to reach IP prefixes across the internet. With Flowspec, those same BGP announcements can now carry rules, not just routes. Each rule describes a pattern of traffic (e.g., TCP SYN packets >1000 bytes from a specific subnet) and what action to take (drop, rate-limit, mark, or redirect).What are the benefits of the BGP Flowspec?Most traditional DDoS protection services react to threats after they start, whether by blackholing traffic to a target IP, redirecting flows to a scrubbing center, or applying rigid, static filters. These approaches can block legitimate traffic, introduce latency, or be too slow to respond to fast-evolving attacks.Flowspec offers a more flexible alternative.Proactive mitigation: Instead of waiting for attacks, you can define known-bad traffic patterns ahead of time and block them instantly. Flowspec lets experienced operators prevent incidents before they start.Granular filtering: You’re not limited to blocking by IP or port. With Flowspec, you can match on packet size, TCP flags, ICMP codes, and more, enabling fine-tuned control that traditional ACLs or RTBH don’t support.Edge offloading: Filtering happens directly on Gcore’s routers, offloading your infrastructure and avoiding scrubbing latency.Real-time updates: Changes to rules are distributed across the network via BGP and take effect immediately, faster than manual intervention or standard blackholing.You still have the option to block traffic during an active attack, but with Flowspec, you gain the flexibility to protect services with minimal disruption and greater precision than conventional tools allow.Which parts of the Flowspec does Gcore implement?Gcore supports twelve filter types and four actions of the Flowspec.Supported filter typesGcore supports all 12 standard Flowspec match components.Filter FieldDescriptionDestination prefixTarget subnet (usually your service or app)Source prefixSource of traffic (e.g., attacker IP range)IP protocolTCP, UDP, ICMP, etc.Port / Source portMatch specific client or server portsDestination portMatch destination-side service portsICMP type/codeFilter echo requests, errors, etc.TCP flagsFilter packets by SYN, ACK, RST, FIN, combinationsPacket lengthFilter based on payload sizeDSCPQuality of service code pointFragmentMatch on packet fragmentation characteristicsSupported actionsGcore DDoS Protection supports the following Flowspec actions, which can be triggered when traffic matches a specific filter:ActionDescriptionTraffic-rate (0x8006)Throttle/rate limit traffic by byte-per-second rateredirectRedirect traffic to alternate location (e.g., scrubbing)traffic-markingApply DSCP marks for downstream classificationno-action (drop)Drop packets (rate-limit 0)Rule orderingRFC 5575 defines the implicit order of Flowspec rules. The crucial point is that more specific announcements take preference, not the order in which the rules are propagated.Gcore also respects Flowspec rule ordering per RFC 5575. More specific filters override broader ones. Future support for Flowspec v2 (with explicit ordering) is under consideration, pending vendor adoption.Blackholing and extended blackholing (eBH)Remote-triggered blackhole (RTBH) is a standardized protection method that the client manages via BGP by analyzing traffic, identifying the direction of the attack (i.e., the destination IP address). This method protects against volumetric attacks.Customers using Gcore IP Transit can trigger immediate blackholing for attacked prefixes via BGP, using the well-known blackhole community tag 65000:666. All traffic to that destination IP is dropped at Gcore’s edge.The list of supported BGP communities is available here.BGP extended blackholeExtended blackhole (eBH) allows for more granular blackholing that does not affect legitimate traffic. For customers unable to implement Flowspec directly, Gcore supports eBH. You announce target prefixes with pre-agreed BGP communities, and Gcore translates them into Flowspec mitigations.To configure this option, contact our NOC at noc@gcore.lu.Monitoring and limitationsGcore can support several logging transports, including mail and Slack.If the number of Flowspec prefixes exceeds the configured limit, Gcore DDoS Protection stops accepting new announcements, but BGP sessions and existing prefixes will stay active. Gcore will receive a notification that you reached the limit.How to activateActivation takes just two steps:Define rules on your edge router using Flowspec NLRI formatAnnounce rules via BGP to Gcore’s intermediate control planeThen, Gcore validates and propagates the filters to border routers. Filters are installed on edge devices and take effect immediately.If attack patterns are unknown, you’ll first need to detect anomalies using your existing monitoring stack, then define the appropriate Flowspec rules.Need help activating Flowspec? Get in touch via our 24/7 support channels and our experts will be glad to assist.Set up GRE and benefit from Flowspec today

Securing AI from the ground up: defense across the lifecycle

As more AI workloads shift to the edge for lower latency and localized processing, the attack surface expands. Defending a data center is old news. Now, you’re securing distributed training pipelines, mobile inference APIs, and storage environments that may operate independently of centralized infrastructure, especially in edge or federated learning contexts. Every stage introduces unique risks. Each one needs its own defenses.Let’s walk through the key security challenges across each phase of the AI lifecycle, and the hardening strategies that actually work.PhaseTop threatsHardening stepsTrainingData poisoning, leaksValidation, dataset integrity tracking, RBAC, adversarial trainingDevelopmentModel extraction, inversionRate limits, obfuscation, watermarking, penetration testingInferenceAdversarial inputs, spoofed accessInput filtering, endpoint auth, encryption, TEEsStorage and deploymentModel theft, tamperingEncrypted containers, signed builds, MFA, anomaly monitoringTraining: your model is only as good as its dataThe training phase sets the foundation. If the data going in is poisoned, biased, or tampered with, the model will learn all the wrong lessons and carry those flaws into production.Why it mattersData poisoning is subtle. You won’t see a red flag during training logs or a catastrophic failure at launch. These attacks don’t break training, they bend it.A poisoned model may appear functional, but behaves unpredictably, embeds logic triggers, or amplifies harmful bias. The impact is serious later in the AI workflow: compromised outputs, unexpected behavior, or regulatory non-compliance…not due to drift, but due to training-time manipulation.How to protect itValidate datasets with schema checks, label audits, and outlier detection.Version, sign, and hash all training data to verify integrity and trace changes.Apply RBAC and identity-aware proxies (like OPA or SPIFFE) to limit who can alter or inject data.Use adversarial training to improve model robustness against manipulated inputs.Development and testing: guard the logicOnce you’ve got a trained model, the next challenge is protecting the logic itself: what it knows and how it works. The goal here is to make attacks economically unfeasible.Why it mattersModels encode proprietary logic. When exposed via poorly secured APIs or unprotected inference endpoints, they’re vulnerable to:Model inversion: Extracting training dataExtraction: Reconstructing logicMembership inference: Revealing whether a datapoint was in trainingHow to protect itApply rate limits, logging, and anomaly detection to monitor usage patterns.Disable model export by default. Only enable with approval and logging.Use quantization, pruning, or graph obfuscation to reduce extractability.Explore output fingerprinting or watermarking to trace unauthorized use in high-value inference scenarios.Run white-box and black-box adversarial evaluations during testing.Integrate these security checks into your CI/CD pipeline as part of your MLOps workflow.Inference: real-time, real riskInference doesn’t get a free pass because it’s fast. Security needs to be just as real-time as the insights your AI delivers.Why it mattersAdversarial attacks exploit the way models generalize. A single pixel change or word swap can flip the classification.When inference powers fraud detection or autonomous systems, a small change can have a big impact.How to protect itSanitize input using JPEG compression, denoising, or frequency filtering.Train on adversarial examples to improve robustness.Enforce authentication and access control for all inference APIs—no open ports.Encrypt inference traffic with TLS. For added privacy, use trusted execution environments (TEEs).For highly sensitive cases, consider homomorphic encryption or SMPC—strong but compute-intensive solutions.Check out our free white paper on inference optimization.Storage and deployment: don’t let your model leakOnce your model’s trained and tested, you’ve still got to deploy and store it securely—often across multiple locations.Why it mattersUnsecured storage is a goldmine for attackers. With access to the model binary, they can reverse-engineer, clone, or rehost your IP.How to protect itStore models on encrypted volumes or within enclaves.Sign and verify builds before deployment.Enforce MFA, RBAC, and immutable logging on deployment pipelines.Monitor for anomalous access patterns—rate, volume, or source-based.Edge strategy: security that moves with your AIAs AI moves to the edge, centralized security breaks down. You need protection that operates as close to the data as your inference does.That’s why we at Gcore integrate protection into AI workflows from start to finish:WAAP and DDoS mitigation at edge nodes—not just centralized DCs.Encrypted transport (TLS 1.3) and in-node processing reduce exposure.Inline detection of API abuse and L7 attacks with auto-mitigation.180+ global PoPs to maintain consistency across regions.AI security is lifecycle securityNo single firewall, model tweak, or security plugin can secure AI workloads in isolation. You need defense in depth: layered, lifecycle-wide protections that work at the data layer, the API surface, and the edge.Ready to secure your AI stack from data to edge inference?Talk to our AI security experts

3 ways to safeguard your website against DDoS attacks—and why it matters

DDoS (distributed denial-of-service) attacks are a type of cyberattack in which a hacker overwhelms a server with an excessive number of requests, causing the server to stop functioning correctly and denying access to legitimate users. The volume of these types of attacks is increasing, with a 56% year-on-year rise recorded in late 2024, driven by factors including the growing availability of AI-powered tools, poorly secured IoT devices, and geopolitical tensions worldwide.Fortunately, there are effective ways to defend against DDoS attacks. Because these threats can target different layers of your network, a single tool isn’t enough, and a multi-layered approach is necessary. Businesses need to protect both the website itself and the infrastructure behind it. This article explores the three key security solutions that work together to protect your website—and the costly consequences of failing to prepare.The consequences of not protecting your website against DDoS attacksIf your website isn’t sufficiently protected, DDoS attacks can have severe and far-reaching impacts on your website, business, and reputation. They not only disrupt the user experience but can spiral into complex, costly recovery efforts. Safeguarding your website against DDoS attacks is essential to preventing the following serious outcomes:Downtime: DDoS attacks can exhaust server resources (CPU, RAM, throughput), taking websites offline and making them unavailable to end users.Loss of business/customers: Frustrated users will leave, and many won’t return after failed checkouts or broken sessions.Financial losses: By obstructing online sales, DDoS attacks can cause businesses to suffer substantial loss of revenue.Reputational damage: Websites or businesses that suffer repeated unmitigated DDoS attacks may cause customers to lose trust in them.Loss of SEO rankings: A website could lose its hard-won SEO ranking if it experiences extended downtime due to DDoS attacks.Disaster recovery costs: DDoS disaster recovery costs can escalate quickly, encompassing hardware replacement, software upgrades, and the need to hire external specialists.Solution #1: Implement dedicated DDoS protection to safeguard your infrastructureAdvanced DDoS protection measures are customized solutions designed to protect your servers and infrastructure against DDoS attacks. DDoS protection helps defend against malicious traffic designed to crash servers and interrupt service.Solutions like Gcore DDoS Protection continuously monitor incoming traffic for suspicious patterns, allowing them to automatically detect and mitigate attacks in real time. If your resources are attacked, the system filters out harmful traffic before it reaches your servers. This means that real users can access your website without interruption, even during an attack.For example, a financial services provider could be targeted by cybercriminals attempting to disrupt services with a large-scale volumetric DDoS attack. With dedicated DDoS protection, the provider can automatically detect and filter out malicious traffic before it impacts users. Customers can continue to log in, check balances, and complete transactions, while the system adapts to the evolving nature of the attack in the background, maintaining uninterrupted service.The protection scales with your business needs, automatically adapting to higher traffic loads or more complex attacks. Up-to-date reports and round-the-clock technical support allow you to keep track of your website status at all times.Solution #2: Enable WAAP to protect your websiteGcore WAAP (web application and API protection) is a comprehensive solution that monitors, detects, and mitigates cyber threats, including DDoS layer 7 attacks. WAAP uses AI-driven algorithms to monitor, detect, and mitigate threats in real time, offering an additional layer of defense against sophisticated attackers. Once set up, the system provides powerful tools to create custom rules and set specific triggers. For example, you can specify the conditions under which certain requests should be blocked, such as sudden spikes in API calls or specific malicious patterns common in DDoS attacks.For instance, an e-commerce platform during a major sale like Black Friday could be targeted by bots attempting to flood the site with fake login or checkout requests. WAAP can differentiate between genuine users and malicious bots by analyzing traffic patterns, rate of requests, and attack behaviors. It blocks malicious requests so that real customers can continue to complete transactions without disruption.Solution #3: Connect to a CDN to strengthen defenses furtherA trustworthy content delivery network (CDN) is another valuable addition to your security stack. A CDN is a globally distributed server network that ensures efficient content delivery. CDNs spread traffic across multiple global edge servers, reducing the load on the origin server. During a DDoS attack, a CDN with DDoS protection can protect servers and end users. It filters traffic at the edge, blocking threats before they ever reach your infrastructure. Caching servers within the CDN network then deliver the requested content to legitimate users, preventing network congestion and denial of service to end users.For instance, a gaming company launching a highly anticipated multiplayer title could face a massive surge in traffic as players around the world attempt to download and access the game simultaneously. This critical moment also makes the platform a prime target for DDoS attacks aimed at disrupting the launch. A CDN with integrated DDoS protection can absorb and filter out malicious traffic at the edge before it reaches the core infrastructure. Legitimate players continue to enjoy fast downloads and seamless gameplay, while the origin servers remain stable and protected from overload or downtime.In addition, Super Transit intelligently routes your traffic via Gcore’s 180+ point-of-presence global network, proactively detecting, mitigating, and filtering DDoS attacks. Even mid-attack, users experience seamless access with no interruptions. They also benefit from an enhanced end-user experience, thanks to shorter routes between users and servers that reduce latency.Taking the next steps to protect your websiteDDoS attacks pose significant threats to websites, but a proactive approach is the best way to keep your site online, secure, and resilient. Regardless of your industry or location, it’s crucial to take action to safeguard your website and maintain its uninterrupted availability.Enabling Gcore DDoS protection is a simple and proven way to boost your digital infrastructure’s resiliency against different types of DDoS attacks. Gcore DDoS protection also integrates with other security solutions, including Gcore WAAP, which protects your website and CDNs. These tools work seamlessly together to provide advanced website protection, offering improved security and performance in one intuitive platform.If you’re ready to try Gcore Edge Security, fill in the form below and one of our security experts will be in touch for a personalized consultation.

From reactive to proactive: how AI is transforming WAF cybersecurity solutions

While digital transformation in recent years has driven great innovation, cyber threats have changed in parallel, evolving to target the very applications businesses rely on to thrive. Traditional web application security measures, foundational as they may be, are no longer effective in combating sophisticated attacks in time. Enter the next generation of WAFs (web application firewalls) powered by artificial intelligence.Next-generation WAFs, often incorporated into WAAP solutions, do much more than respond to threats; instead, they will use AI and ML-powered techniques to predict and neutralize threats in real time. This helps businesses to stay ahead of bad actors by securing applications, keeping valuable data safe, and protecting hard-earned brand reputations against ever-present dangers in an expanding digital world.From static to AI-powered web application firewallsTraditional WAFs were relied on to protect web applications against known threats, such as SQL injection and cross-site scripting. They’ve done a great job as the first line of defense, but their reliance on static rules and signature-based detection means they struggle to keep up with today’s fast-evolving cyber threats. To understand in depth why traditional WAFs are no longer sufficient in today’s threat landscape, read our ebook.AI and ML have already revolutionized what a WAF can do. AI/ML-driven WAFs can examine vast streams of traffic data and detect patterns, including new threats, right at the emergence stage. The real-time adaptability that this allows is effective even against zero-day attacks and complex new hacking techniques.How AI-powered WAP proactively stops threatsOne of the most significant advantages of AI/ML-powered WAFs is proactive identification and prevention capabilities. Here's how this works:Traffic pattern analysis: AI systems monitor both incoming and outgoing traffic to set up baselines for normal behavior. This can then allow for the detection of anomalies that could show a zero-day attack or malicious activity.Real-time decision making: Machine learning models keep learning from live traffic and detect suspicious activities on the go sans waiting for any updates in the rule set. This proactive approach ensures that businesses are guarded from emerging threats before they escalate.Heuristic tagging and behavioral insights: Advanced heuristics used by AI-driven systems tag everything from sessionless clients to unusual request frequencies. It helps administrators classify potential bots or automated attacks much faster.Ability to counter zero-day attacks: Traditional WAF solutions can only mitigate attacks that are already in the process of accessing sensitive areas. AI/ML-powered WAFs, on the other hand, can use data to identify and detect patterns indicative of future attacks, stopping attackers in their tracks and preventing future damage.Intelligent policy management: Adaptive WAFs detect suspicious activity and alert users to misconfigured security policies accordingly. They reduce the need for manual configuration while assuring better protection.Integrated defense layers: One of the strongest features of AI/ML-powered systems is the ease with which they integrate other layers of security, including bot protection and DDoS mitigation, into a connected architecture that protects several attack surfaces.User experience and operational impactAI-driven WAFs improve the day-to-day operations of security teams by transforming how they approach threat management. With intuitive dashboards and clearly presented analytics, as offered by Gcore WAAP, these tools empower security professionals to quickly interpret complex data, streamline decision-making, and respond proactively to threats.Instead of manually analyzing vast amounts of traffic data, teams now receive immediate alerts highlighting critical security events, such as abnormal IP behaviors or unusual session activity. Each alert includes actionable recommendations, enabling rapid adjustments to security policies without guesswork or delay.By automating the identification of sophisticated threats such as credential stuffing, scraping, and DDoS attacks, AI-powered solutions significantly reduce manual workloads. Advanced behavioral profiling and heuristic tagging pinpoint genuine threats with high accuracy, allowing security teams to concentrate their efforts where they're most needed.Embracing intelligent security with Gcore’s AI-driven WAAPOur AI-powered WAAP solution provides intelligent, interrelated protection to empower companies to actively outperform even the most sophisticated, ever-changing threats by applying advanced traffic analysis, heuristic tagging, and adaptive learning. With its cross-domain functionality and actionable security insights, this solution stands out as an invaluable tool for both security architects and strategic decision-makers. It combines innovation and practicality to address the needs of modern businesses.Curious to learn more about WAAP? Check out our ebook for cybersecurity best practices, the most common threats to look out for, and how WAAP can safeguard your businesses’ digital assets. Or, get in touch with our team to learn more about Gcore WAAP.Learn why WAAP is essential for modern businesses with a free ebook

Subscribe to our newsletter

Get the latest industry trends, exclusive insights, and Gcore updates delivered straight to your inbox.