Claude MCP skill rate limit bypass via HTTP request smuggling and chunked transfer encoding — SA-SKL-RATELIMIT11
HTTP request smuggling exploits disagreements between a frontend proxy and a backend server about where one HTTP request ends and the next begins. When a rate limit is enforced at the proxy layer but the backend processes smuggled requests that the proxy never counted, an attacker can run unlimited requests against the backend while the proxy believes the rate limit is being respected. MCP skill audit endpoints, scan-trigger APIs, and webhook receivers are all high-value targets for this class of bypass because they are expensive to run and operators rely on rate limits to prevent abuse. Four SA-SKL-RATELIMIT11 patterns cover the most common request-smuggling rate-limit bypasses seen in MCP skill infrastructure, with HAProxy, Nginx, CDN edge, and Express-layer variants.
limit_req_zone keyed on $request_uri; smuggled request changes the apparent URI seen by Nginx's log but rate limit was already incremented for the original URI; attacker reaches /api/audit/trigger via a smuggled request keyed under /api/health which has a much higher limitHost header; attacker sends HTTP/2 HEADERS frame with lowercase host pseudo-header instead of :authority; backend accepts it and routes normally but CDN never increments its rate limit counter for the connectionexpress-rate-limit configured with skipSuccessfulRequests: true for UX smoothing; smuggled requests all return HTTP 200 from the inner handler; none are ever counted; attacker triggers unlimited paid audit jobs returning 200 responsesRATELIMIT11-001 — HAProxy CL+TE smuggling bypasses frontend rate limit
HTTP request smuggling via Content-Length / Transfer-Encoding conflict (CL+TE) works by sending a request where the frontend proxy uses Content-Length to determine the request boundary but the backend uses Transfer-Encoding: chunked. The frontend reads the request as one complete message and applies its rate limit. The backend, however, reads the chunked body and finds a second HTTP request embedded inside it. That second request is processed without passing through the frontend's rate limit logic.
In MCP skill infrastructure this is especially dangerous when the frontend HAProxy instance enforces per-IP rate limits on /api/audit but the backend Express server is reachable on an internal port that the smuggled request can target directly.
# VULNERABLE — RATELIMIT11-001
# HAProxy frontend: rate limit is enforced here on the frontend connection count.
# HAProxy uses Content-Length to decide request end: sees one request, increments counter once.
frontend skill_audit_api
bind *:443 ssl crt /etc/ssl/skillaudit.pem
default_backend express_backend
# HAProxy counts THIS request against the IP. Only one counter increment.
# The smuggled request inside the chunked body bypasses this entirely.
stick-table type ip size 10k expire 60s store http_req_rate(60s)
http-request track-sc0 src
http-request deny deny_status 429 if { sc_http_req_rate(0) gt 10 }
# Backend Express sees TWO requests from one HAProxy forward:
# Request 1: the legitimate request (rate-limited)
# Request 2: the smuggled request hidden in the chunked body (not rate-limited)
# FIXED — RATELIMIT11-001 # 1. Reject any request that contains BOTH Content-Length AND Transfer-Encoding headers. # 2. Force HTTP/1.1 connection reuse off between HAProxy and backend (http-reuse never). # 3. Normalize ambiguous encoding before forwarding. frontend skill_audit_api bind *:443 ssl crt /etc/ssl/skillaudit.pem default_backend express_backend # FIX 1: Deny CL+TE ambiguous requests — the root cause of CL+TE smuggling. # RFC 7230 says a server MUST NOT process a request with both headers. acl has_cl req.hdr_cnt(Content-Length) gt 0 acl has_te req.hdr_cnt(Transfer-Encoding) gt 0 http-request deny deny_status 400 if has_cl has_te # FIX 2: Normalize Transfer-Encoding — strip unknown values, downcase. http-request replace-header Transfer-Encoding ^(?i)chunked$ chunked # FIX 3: Disable connection reuse between HAProxy and backend so smuggled # bytes from one client cannot bleed into another client's request slot. http-reuse never backend express_backend server app1 127.0.0.1:3000 check
Detection: SkillAudit's infrastructure scanner checks HAProxy and Nginx configurations for missing CL+TE conflict rejection rules. It also sends a benign CL+TE probe request to the audit endpoint and measures whether the backend processes one or two requests, confirming whether request desync is possible.
RATELIMIT11-002 — Nginx limit_req_zone keyed on smuggled URI
Nginx's limit_req_zone directive applies a rate limit per key. When the key is $request_uri, the rate limit bucket is determined by the URI Nginx sees at the moment the directive fires. In a request smuggling scenario, the smuggled inner request presents a different URI. If the outer request is for a low-value endpoint (like /api/health) with a generous rate limit, and the inner smuggled request targets a high-cost endpoint (like /api/audit/trigger) with a strict rate limit, the inner request is counted against the outer request's zone — not the audit endpoint's zone.
# VULNERABLE — RATELIMIT11-002
# Nginx rate limit zones are keyed by $request_uri.
# /api/health allows 100 req/s; /api/audit/trigger allows only 5 req/s.
# A smuggled request inside a /api/health body reaches /api/audit/trigger
# but was counted against the /api/health zone (100/s), not the /api/audit zone.
http {
limit_req_zone $binary_remote_addr$request_uri zone=health:10m rate=100r/s;
limit_req_zone $binary_remote_addr$request_uri zone=audit:10m rate=5r/s;
server {
location /api/health { limit_req zone=health burst=20 nodelay; proxy_pass http://app; }
location /api/audit/trigger { limit_req zone=audit burst=2 nodelay; proxy_pass http://app; }
# Smuggled request for /api/audit/trigger arrives here but Nginx already
# applied the /api/health zone rate limit — not the audit zone.
}
}
# FIXED — RATELIMIT11-002
# Fix 1: Key the rate limit zone on the client IP alone, not IP+URI.
# This means ALL requests from one IP share one counter regardless of
# which endpoint the smuggled request claims to target.
# Fix 2: Reject requests with both Content-Length and Transfer-Encoding.
# Fix 3: Use http2 (browsers prefer h2 which is immune to CL+TE smuggling).
http {
# FIX: single zone keyed on IP only — smuggling cannot split the counter
limit_req_zone $binary_remote_addr zone=per_ip:10m rate=10r/s;
server {
# FIX: reject ambiguous CL+TE at Nginx level
if ($http_transfer_encoding ~* "chunked") {
set $has_te 1;
}
if ($http_content_length) {
set $has_cl 1;
}
# Deny when both are present (requires lua or map — shown as map below)
}
}
# More robust: use map to detect and deny CL+TE conflict
map "$http_content_length:$http_transfer_encoding" $bad_framing {
default 0;
"~^.+:.+" 1; # Both headers present
}
server {
if ($bad_framing) { return 400; }
location /api/audit/trigger { limit_req zone=per_ip burst=2 nodelay; proxy_pass http://app; }
}
RATELIMIT11-003 — CDN rate limit bypass via HTTP/2 HEADERS frame with lowercase host
HTTP/2 uses HPACK-compressed header frames instead of plain-text headers. The :authority pseudo-header is the HTTP/2 equivalent of the HTTP/1.1 Host header. Some CDN edge rate-limit implementations key on the Host header as translated from :authority. If an attacker sends an HTTP/2 HEADERS frame with a lowercase host pseudo-header (not :authority) and the CDN passes it through without normalizing, the backend processes the request with the host present but the CDN's rate limit counter never fires because it was looking for :authority.
/* VULNERABLE — RATELIMIT11-003 (conceptual Node.js http2 client demonstration)
* CDN keyed its rate limit on the :authority pseudo-header.
* Sending a custom host header (non-pseudo-header) in the HEADERS frame
* causes some CDN implementations to skip the rate limit increment.
* The backend still processes the request normally.
*/
const http2 = require('http2');
const client = http2.connect('https://skillaudit.dev');
// Vulnerable: custom host header bypasses CDN rate-limit keyed on :authority
// Some CDNs do not normalize host -> :authority before rate-limit check.
for (let i = 0; i < 1000; i++) {
const req = client.request({
':method': 'POST',
':path': '/api/audit/trigger',
':scheme': 'https',
// Using 'host' instead of ':authority' — CDN rate limit may not fire
'host': 'skillaudit.dev',
'content-type': 'application/json',
});
req.write(JSON.stringify({ repo: 'target/skill' }));
req.end();
}
# FIXED — RATELIMIT11-003
# CDN / proxy configuration fix: enforce that :authority matches Host before rate limiting.
# Nginx example — reject requests where http2 :authority and host header disagree.
server {
listen 443 ssl http2;
# FIX: Normalize — if :authority is present (http2), use it as the Host.
# Reject requests where the two disagree to prevent smuggling via header confusion.
set $h2_authority $http2_authority; # available in Nginx with ngx_http_v2_module
if ($h2_authority != "" ) {
# If :authority is set but doesn't match $host, it's a mismatch attack.
# Return 400 Bad Request.
}
}
# Cloudflare / CDN rule (WAF custom rule pseudocode):
# if (http.version == "HTTP/2" and
# not (http.host == http.request.headers["authority"])) {
# action: block, status: 400
# }
RATELIMIT11-004 — express-rate-limit skipSuccessfulRequests abused for unlimited throughput
express-rate-limit includes a skipSuccessfulRequests option that, when set to true, only counts requests that result in an error response (4xx or 5xx). The intent is UX improvement: a user hitting a page repeatedly while loading doesn't burn their rate limit quota. However, when skipSuccessfulRequests: true is applied to an abuse-prevention rate limit on an expensive endpoint, an attacker who can ensure their requests return HTTP 200 (which is trivial for a scan-trigger endpoint that accepts the input) can fire unlimited requests and none will be counted against the limit.
// VULNERABLE — RATELIMIT11-004
// express-rate-limit with skipSuccessfulRequests: true applied to audit trigger endpoint.
// Every scan that starts successfully returns 202 Accepted.
// None of these count against the limit — attacker can trigger unlimited scans.
import rateLimit from 'express-rate-limit';
const auditTriggerLimiter = rateLimit({
windowMs: 60 * 1000, // 1 minute
max: 5, // 5 audit requests per minute — intended to prevent abuse
skipSuccessfulRequests: true, // VULNERABLE: 202 Accepted responses not counted
message: { error: 'Too many audit requests, please slow down.' },
});
app.post('/api/audit/trigger', auditTriggerLimiter, async (req, res) => {
const job = await enqueueAudit(req.body.repoUrl);
res.status(202).json({ jobId: job.id }); // 202 = not counted by skipSuccessfulRequests
});
// FIXED — RATELIMIT11-004
// Never use skipSuccessfulRequests for abuse prevention.
// skipSuccessfulRequests is only appropriate for UX rate-limit softening
// (e.g., page loads) where you don't want users burning quota on 304 hits.
// For abuse prevention, count ALL requests including successful ones.
import rateLimit from 'express-rate-limit';
const auditTriggerLimiter = rateLimit({
windowMs: 60 * 1000,
max: 5,
// FIX: removed skipSuccessfulRequests — every request counts, success or not
standardHeaders: true, // return X-RateLimit-* headers
legacyHeaders: false,
message: { error: 'Rate limit exceeded: maximum 5 audit triggers per minute.' },
});
// Also add: per-user rate limit on top of per-IP to handle shared NAT/proxies.
const perUserLimiter = rateLimit({
windowMs: 60 * 1000,
max: 5,
keyGenerator: (req) => req.user?.id || req.ip, // key on authenticated user
standardHeaders: true,
legacyHeaders: false,
});
app.post('/api/audit/trigger',
requireAuth, // must be authenticated first
auditTriggerLimiter, // then per-IP rate limit
perUserLimiter, // then per-user rate limit
async (req, res) => {
const job = await enqueueAudit(req.body.repoUrl, req.user.id);
res.status(202).json({ jobId: job.id });
}
);
Why these patterns matter for MCP skills: MCP skill audit endpoints are CPU- and API-credit-intensive. A single audit job can consume significant Anthropic API tokens for LLM-assisted prompt-injection probing. Rate limit bypasses on audit trigger endpoints directly translate into financial abuse and denial-of-service for other users. Request smuggling is not theoretical — it was used in real-world attacks against major CDNs and can be tested with Burp Suite's HTTP Request Smuggler extension or the publicly available smuggler.py tool.
Summary — SA-SKL-RATELIMIT11 at a glance
| Pattern | Root cause | Fix | Severity |
|---|---|---|---|
| RATELIMIT11-001 | HAProxy forwards CL+TE ambiguous request; backend processes smuggled inner request not counted by rate limit | Deny requests with both Content-Length and Transfer-Encoding; set http-reuse never | Critical |
| RATELIMIT11-002 | Nginx limit_req_zone keyed on $request_uri; smuggled request targets high-cost zone but counted against low-cost zone | Key rate limit on IP only, not IP+URI; reject CL+TE at Nginx level | Critical |
| RATELIMIT11-003 | CDN keys rate limit on :authority; HTTP/2 HEADERS frame with host header accepted by backend but not counted by CDN | Enforce :authority == Host normalization; reject mismatched h2 frames | High |
| RATELIMIT11-004 | express-rate-limit skipSuccessfulRequests: true causes 200 responses to never be counted against the limit | Remove skipSuccessfulRequests from abuse-prevention limiters; add per-user rate limit alongside per-IP | High |
Does your MCP skill's rate limiting hold up against request smuggling?
SkillAudit scans for CL+TE ambiguity, rate-limit key misconfigurations, and skipSuccessfulRequests abuse across your infrastructure config and application code — before attackers find them.