mirror of https://github.com/interlegis/sapl.git
Browse Source
_handle_api checked _is_same_origin() before any of the IP-prefix, global (rl:ip:<ip>:blocked), and API-specific (rl:api:ip:<ip>:blocked) block keys — short-circuiting straight to get_response() on a match. Since Origin/Referer are entirely client-controlled and trivially spoofable, any caller could defeat every /api/ block and counter (including an operator-set global block) by simply sending Origin: https://<sapl-host>. Reorder the checks so IP-prefix/global/API block lookups always run first; the same-origin bypass now only exempts legitimate same-origin polling from quota and per-minute rate-limit accounting, never from an active block. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>rate-limiter-2026
2 changed files with 93 additions and 13 deletions
Loading…
Reference in new issue