When API Rate Limiting Breaks Down Mid-Campaign and the Traffic Keeps Coming

By IPThreat Team July 29, 2026

The Problem Operators Face Before the Logs Make It Obvious

Most API rate limiting configurations get set once, tested during a low-traffic window, and then left alone. That works until a coordinated abuse campaign hits. At that point, the limits that looked reasonable during staging turn out to be far too permissive, or too coarse-grained, or attached to the wrong identifier entirely. Attackers are not probing blindly anymore. Threat intelligence reporting from Recorded Future and others tracking Advanced Persistent Threat groups consistently shows that reconnaissance precedes API abuse campaigns by days or weeks. By the time traffic volumes start triggering alerts, the attacker already knows the shape of your endpoints, your throttle thresholds, and which paths are unprotected.

The practical damage is not always a breach in the first wave. It can be account enumeration, data harvesting through paginated endpoints, credential validation via authentication flows, or infrastructure resource exhaustion designed to create availability gaps that other attack vectors then exploit. CISA's recent guidance on isolating vital systems during cyberattacks reflects a broader recognition that modern attacks move across multiple layers simultaneously. Rate limiting that only operates at the perimeter layer leaves interior API surfaces exposed to abuse that never looks volumetric until it is already finished.

This article addresses how to build rate limiting strategies that hold under adversarial pressure, what operators should fix today with existing tools, and how to mature the program over the coming weeks and quarter.

Why Single-Dimension Rate Limiting Fails Against Distributed Campaigns

The most common implementation is IP-based rate limiting: count requests per IP address, reject when the count exceeds a threshold. This approach made sense when abusive traffic came from individual machines or small botnets. It does not hold against distributed campaigns where hundreds or thousands of source IPs each send a volume of requests that individually stays below any reasonable threshold.

Modern attack infrastructure, as documented in recent APT tracking reports, uses residential proxies, compromised cloud instances, and rented botnets. Each source IP generates ten or fifteen requests per minute. Your threshold is set at thirty. The campaign never trips the limit. Meanwhile, a single endpoint is receiving several thousand requests per minute from what the rate limiter sees as several hundred distinct, well-behaved clients.

Effective rate limiting requires multiple concurrent dimensions working together rather than a single check against IP address. The dimensions that matter most in production environments are:

  • IP address: Still necessary as one layer, but insufficient alone.
  • User account or session token: Catches cases where a single credential is being hammered from distributed infrastructure.
  • Endpoint-level limits: Different endpoints carry different risk profiles and should have independently configured limits.
  • Behavioral fingerprint: Request pattern, header consistency, timing intervals, and user-agent characteristics that persist across IP changes.
  • ASN or network range: Aggregate limits that catch when many IPs from the same autonomous system are all hitting the same endpoint simultaneously.

The combination of these dimensions means an attacker cannot simply rotate IPs to evade limits. Rotating IPs while reusing the same session token still triggers account-level limits. Rotating both IPs and session tokens while coming from the same ASN still triggers network-range limits. Building these layers requires more configuration effort upfront, but the operational payoff during an active campaign is significant.

Configuring Limits That Match Real Risk Profiles

Flat rate limits applied uniformly across all endpoints produce two failure modes. The first is that sensitive endpoints are under-protected because the limit was set at a level tolerable for high-traffic endpoints. The second is that legitimate traffic to high-volume endpoints gets throttled because the limit was set conservatively based on the most sensitive surface.

Endpoint classification should drive limit configuration. Group endpoints into at least three tiers based on their abuse potential and business sensitivity.

Tier One: Authentication and Account Endpoints

Login, password reset, account creation, and multi-factor challenge endpoints carry the highest abuse risk. These are the targets in credential stuffing and account takeover campaigns. Limits here should be aggressive. A good baseline for authentication endpoints is five attempts per IP per minute, twenty attempts per IP per hour, with progressive back-off after the third failure within a sixty-second window. Account-level limits should be tighter still: three failed attempts in five minutes should trigger a temporary lock and alert, not just a rejection.

The campaign targeting government-facing APIs documented in recent threat intelligence reports demonstrated exactly how credential stuffing operations probe authentication flows. The CL-STA-1062 activity showed attackers sending just enough authentication attempts per IP to stay under standard thresholds, while accumulating thousands of validation attempts in aggregate. Account-level rate limiting catches this pattern even when IP-level limits are not tripped.

Tier Two: Data and Search Endpoints

Endpoints that return data in response to queries are common targets for harvesting campaigns. A user-facing search API might legitimately serve a few hundred requests per hour from a single account, but an automated harvesting tool will push thousands. Set per-account limits based on observed legitimate usage patterns, add a burst allowance for short spikes, and enforce a hard ceiling that triggers investigation rather than just rejection.

Pagination is a specific concern here. Endpoints that return paginated results are frequently iterated automatically to extract entire datasets. Implement per-account limits on page depth traversal within a session, and flag sessions that hit page fifty or beyond with elevated scrutiny.

Tier Three: Public or Low-Sensitivity Endpoints

Status endpoints, public data feeds, and documentation endpoints still require rate limiting to prevent resource exhaustion, but limits can be more permissive. The focus here is volumetric protection rather than abuse prevention. Set limits that prevent a single source from consuming a disproportionate share of infrastructure capacity, and ensure these endpoints are not a path to higher-privilege functionality through chaining.

What to Do Today: Immediate Configuration Actions

Security teams operating under active threat pressure or simply recognizing gaps in their current posture need a set of actions that can be implemented within hours rather than waiting for a larger architectural change.

  1. Audit current rate limit configurations across all production APIs. Document which endpoints have limits, what those limits are, and which dimension they operate on. Many organizations discover during this audit that significant portions of their API surface have no rate limiting at all, or have limits inherited from a default configuration that was never reviewed.
  2. Enable rate limiting on authentication endpoints if not already active. This is the highest-priority surface. Even a simple IP-based limit with a low threshold is substantially better than no limit during an active credential stuffing campaign.
  3. Turn on logging for rate limit events. Rate limit logs are distinct from error logs and are frequently missing from SIEM pipelines. Without visibility into when and where limits are being hit, you cannot detect campaigns that are staying just under thresholds across distributed sources.
  4. Set alerts on rate limit trigger rates rather than individual triggers. A single rate limit hit is noise. A spike in rate limit events across multiple IPs hitting the same endpoint in a five-minute window is a campaign signal. Configure alerting on the aggregate rate, not individual events.
  5. Implement a block list integration so rate limit violations feed into your IP reputation pipeline. An IP that trips a rate limit should not get a clean slate sixty seconds later. Feed violation data into a short-duration block that decays over hours rather than minutes.

This Week: Expanding Coverage and Adding Intelligence

Once immediate gaps are addressed, the focus shifts to expanding the sophistication of the rate limiting approach over the course of a week of deliberate work.

Implementing Token Bucket or Sliding Window Algorithms

Fixed window rate limiting is the simplest implementation but has a well-known vulnerability: a client can send double the allowed request count by splitting requests across a window boundary. Token bucket and sliding window algorithms eliminate this by maintaining a continuous count that does not reset on a clock boundary. Most API gateways support these algorithms natively. Switching from fixed window to sliding window on authentication endpoints takes a configuration change, not a code change, in platforms like AWS API Gateway, Kong, Nginx, and Apigee.

Adding Behavioral Velocity Checks

Velocity checks look at the rate of change in request patterns rather than just absolute counts. A legitimate user who normally makes twenty requests per hour and suddenly makes two hundred in five minutes is worth examining even if the two hundred requests stay under an absolute hourly limit. Velocity checks require baseline data, which means running monitoring in observation mode before enforcement. Spend the first half of the week collecting baseline data per endpoint and per account tier, then configure alerts at two standard deviations above the mean before setting hard enforcement limits based on that data.

Building ASN-Level Aggregate Limits

IP rotation across a single ASN is a common evasion technique. When an abuse campaign uses cloud provider infrastructure or a commercial proxy network, hundreds of IPs in the campaign may share an ASN or a small set of ASNs. Aggregate request counts by ASN and set ceiling limits that prevent any single autonomous system from accounting for more than a defined percentage of traffic to sensitive endpoints in a given time window. This does not block the ASN outright, but it caps the damage any single network can cause before triggering escalation.

Integrating External Threat Intelligence

Rate limiting works better when it is informed by what is known about the source. Integrate threat intelligence feeds into your gateway configuration so that IPs with known bad reputation receive tighter limits immediately rather than waiting to accumulate violation history on your own infrastructure. This matters most for authentication endpoints, where even a handful of attempts from a known credential-stuffing infrastructure IP represents elevated risk.

The practical integration is usually a lookup at request processing time against a threat intelligence API or a locally cached blocklist that updates on a defined interval. Keep the lookup path fast, target under five milliseconds, or cache aggressively to avoid adding latency to the critical authentication path.

This Quarter: Building Adaptive Rate Limiting into the Architecture

Mature rate limiting programs move from static configuration to adaptive systems that adjust limits based on current conditions and observed behavior. This is a quarter-scale project because it requires architectural decisions, instrumentation work, and validation cycles.

Adaptive Thresholds Based on Traffic Conditions

Static limits set during normal traffic conditions may be too permissive during low-traffic periods, when a smaller denominator makes any campaign more impactful, and too restrictive during legitimate traffic spikes. Adaptive rate limiting systems observe current baseline traffic and adjust thresholds proportionally. During a legitimate high-traffic event, limits scale up to avoid blocking real users. During quiet periods, limits tighten automatically to reduce the window for low-and-slow abuse.

Implementing adaptive thresholds requires a feedback loop between your traffic monitoring infrastructure and your gateway configuration. This is achievable with standard observability tooling and a scripted configuration update mechanism, but it needs careful testing to avoid creating a feedback loop that an attacker can manipulate by artificially inflating baseline traffic.

Layering Rate Limiting Across the Stack

Rate limiting should not live at a single point in the infrastructure. Effective layered implementations place limits at the CDN or edge layer for volumetric protection, at the API gateway for endpoint-specific and account-level limits, and within the application layer for business logic-level controls like pagination depth and session-level operation counts.

Each layer has a different view of the traffic and catches different abuse patterns. The edge layer sees raw IP volume and blocks DDoS-scale floods before they reach the gateway. The gateway enforces per-account and per-endpoint policies. The application layer catches abuse patterns that look legitimate at the protocol level but violate expected usage patterns, like an account iterating through every other user's profile by incrementing a numeric ID.

CISA's guidance on isolating vital systems maps directly onto this principle. The approach is not to have one strong layer at the front, but to ensure that compromise or bypass of any single layer does not give an attacker unfettered access to the layers behind it.

Response Strategies Beyond Simple Rejection

Returning a 429 Too Many Requests response tells an automated attacker exactly where the limit is and when to retry. More sophisticated response strategies reduce the information value of rate limit feedback to the attacker while maintaining the protective effect.

Tarpit responses, which accept the connection and respond extremely slowly rather than rejecting immediately, consume attacker resources without revealing limit thresholds. Shadow rate limiting accepts the request, returns a normal-looking response, but returns fake or empty data rather than real results. This is particularly useful for enumeration attempts against user account endpoints. The attacker receives a 200 response with no error, but the data is not real, so the harvesting operation produces nothing useful while consuming attacker infrastructure time and cost.

Implement these response strategies thoughtfully. They require additional application logic and should be limited to endpoints where the false response cannot cause harm to legitimate users who might hit limits accidentally. Always ensure legitimate users receive clear feedback through standard channels when they genuinely encounter limits.

Incident Response Integration

Rate limiting is a detection mechanism as much as a prevention mechanism. Build runbooks specifically for rate limit campaign scenarios so that when aggregate limit triggers indicate an active campaign, the response is defined rather than improvised. The runbook should include thresholds that trigger escalation from automated blocking to human review, contact points for affected business teams if the campaign is targeting a specific endpoint that serves a critical business function, and criteria for emergency limit adjustments during active attacks.

Given the threat landscape described in recent intelligence reporting, including APT groups conducting espionage operations through webmail APIs and ransomware operators using APIs as initial access vectors, the incident response integration for rate limiting is not a theoretical concern. It is preparation for scenarios that are actively occurring against organizations of every size.

Monitoring That Actually Surfaces Campaign Activity

The monitoring architecture for rate limiting needs to capture signals that individually look like noise but collectively reveal patterns. The following metrics should be tracked and visualized continuously:

  • Rate limit trigger events per endpoint per minute, trended over time to establish baselines and detect deviations.
  • Unique IP count per endpoint per time window, with alerts when a sudden increase in unique IPs all hitting the same endpoint indicates distributed sourcing.
  • ASN concentration metrics showing what percentage of traffic to each endpoint originates from each ASN, with alerts on unusual concentration.
  • Account-level velocity anomalies showing accounts whose request rate deviates significantly from their own historical baseline.
  • Retry pattern analysis looking for sources that consistently retry at regular intervals after receiving a 429, which indicates automated tooling rather than human behavior.

Feed these metrics into your SIEM alongside traditional security event data. Rate limiting events that correlate in time with authentication failures, account lockouts, or privilege escalation attempts tell a more complete story than any single data stream. Cyber readiness for organizations at every scale, including SMBs without dedicated security operations staff, begins with ensuring that the monitoring infrastructure captures these signals and routes them to whoever is responsible for responding.

Configuration Pitfalls That Undermine Otherwise Sound Strategies

Several common configuration mistakes reduce the effectiveness of rate limiting strategies that are otherwise well designed.

Applying rate limits only in production and not in staging or test environments means that attackers who discover a staging endpoint have an unmetered path that may share backend infrastructure with production. Apply rate limiting consistently across all exposed environments.

Trusting X-Forwarded-For headers without validation allows attackers to spoof their source IP by injecting a trusted or private IP address into the header, bypassing IP-based limits entirely. Validate and sanitize forwarded headers at the edge layer and only trust them from known proxy sources in your infrastructure.

Setting retry-after headers with exact retry timing in 429 responses gives automated tooling precise information about when limits reset. Use approximate values or omit the header entirely for high-risk endpoints where you do not want to optimize the attacker's retry strategy.

Configuring limits on HTTP layer only leaves WebSocket connections and gRPC streaming endpoints uncovered. These protocols are increasingly used in modern APIs and require explicit rate limiting configuration that is not inherited from HTTP gateway rules.

Building a Program That Evolves With the Threat

Rate limiting is not a one-time configuration project. The threat landscape shifts continuously. Attackers study deployed limits and adjust their tooling to stay below detection thresholds, as demonstrated by multiple campaigns documented in recent threat intelligence. The defensive program needs a review cycle that treats rate limiting configuration as a living document rather than a completed task.

Schedule quarterly reviews of limit configurations against observed traffic baselines and against any new campaign tactics documented in threat intelligence reporting. When a new campaign targeting API endpoints is documented publicly, compare the described tactics against your current configuration and identify whether any aspect of the attack pattern would pass through your current controls without triggering limits or alerts.

Establish a testing practice that includes rate limit evasion scenarios. Red team or purple team exercises that specifically test whether multi-dimensional limits hold against distributed sourcing, IP rotation, and timing-based evasion provide ground truth about actual defensive posture rather than theoretical coverage. Run these exercises against staging environments at least annually and against production configurations using synthetic traffic at the same cadence.

The organizations that maintain resilient API security postures are the ones that treat rate limiting as a continuous program with defined ownership, regular testing, and a feedback loop between observed attacks and configuration adjustments. That discipline, applied consistently, is what separates rate limiting that holds during an active campaign from rate limiting that simply delays the inevitable.

Contact IPThreat