CVE-2026-129304: Guard Core: Unvalidated X-Forwarded-For-derived string used as a Redis key component and interpolated into a KEYS glob pattern
Guard Core is an API security core engine for the FastAPI-Guard, FlaskAPI Guard, and DjAPI Guard adapters. From 1.0.0 until 3.13.0, extractfromforwardedheader() in guardcore/utils.py returns the selected X-Forwarded-For entry without validating that it is an IP address. In deployments configured with trustedproxies where the selected entry is attacker-controlled, the arbitrary clientip string reaches BehaviorTracker in guardcore/handlers/behaviorhandler.py and is interpolated into Redis key names and blocking KEYS glob patterns. Glob metacharacters can cause one request to count other clients' behavior events, embedded separators can disturb key parsing, and rotating identities can create unbounded keys while repeatedly scanning the shared Redis keyspace. A non-IP identity can also reach a ban action and cause an uncaught validation error. This issue is fixed in version 3.13.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in 3.13.0
Event History
Frequently Asked Questions
Which deployments are exposed?
Deployments using Guard Core versions from 1.0.0 before 3.13.0 are affected when trusted_proxies is configured such that an attacker can control the selected X-Forwarded-For entry.
Does exploitation require authentication?
No authentication is required. Exploitation also depends on the attacker being able to influence the X-Forwarded-For value selected by the trusted-proxy configuration.
What can an attacker cause through the affected behavior tracking path?
Glob metacharacters can make one request count behavior events belonging to other clients, while embedded separators can disrupt Redis key parsing. Rotating identities can create unbounded keys and repeatedly scan the shared Redis keyspace; a non-IP identity reaching a ban action can also trigger an uncaught validation error.
What version contains the fix?
The issue is fixed in Guard Core version 3.13.0.