
PEACH
Un cadre d’isolation des locataires
The keynav_js paginator decodes the page request parameter (base64url-encoded JSON) into internal pagination state without validation. When the decoded cursor contains a page_cutoff, the record query is executed with the LIMIT removed (@set.limit(nil)), trusting the client-supplied cursor to bound the page. A single unauthenticated request with a crafted page parameter therefore loads an entire table's matching rows into memory — a denial-of-service vector.
Root cause. Pagy::Keyset::Keynav#assign_page (gem/lib/pagy/classes/keyset/keynav.rb) destructures the client-supplied cursor straight into pagination state, with no validation:
storage_key, @page, @last, @prior_cutoff, @page_cutoff = @options[:page]@options[:page] comes from Pagy::KeynavJsPaginator.paginate (gem/lib/pagy/toolbox/paginators/keynav_js.rb), which base64url/JSON-decodes the request page parameter via Keyset.decode. The only check is an equality test between the request cookie and the first decoded element; sending no pagy cookie together with a null storage key passes it.
When a page_cutoff is present, Keynav#fetch_records runs @set.limit(nil).to_a, intentionally dropping the LIMIT and trusting the (now attacker-controlled) cutoff to bound the page. A forged cutoff produces SELECT ... WHERE (NOT (...)) ORDER BY ... with no LIMIT clause, so the database returns every matching row and the ORM materializes them all into memory in a single request.
Verified with Docker (Ruby 3.4, real ActiveRecord + SQLite) over HTTP against the shipped demo.
pagy keynav (serves gem/apps/keynav.ru on http://127.0.0.1:8000). Its keyset is [animal, name, birthdate, id].[cookie_match, storage_key, @page, @last, @prior_cutoff, @page_cutoff]; sending no cookie makes cookie_match = null pass the check. Encode with Pagy::B64.urlsafe_encode(array.to_json).
Cursor [null, null, 2, 2, null, ["zzzzzz","zzzzzz","1900-01-01",999999999]]:curl 'http://127.0.0.1:8000/?page=W251bGwsbnVsbCwyLDIsbnVsbCxbInp6enp6eiIsInp6enp6eiIsIjE5MDAtMDEtMDEiLDk5OTk5OTk5OV1d'Normal requests log SELECT ... LIMIT 5; this request logs SELECT "pets".* FROM "pets" WHERE (NOT (...)) ORDER BY ... with no LIMIT clause (HTTP 200). On a production-sized table this loads the whole matching set into memory.
Any application paginating with pagy(:keynav_js, ...). An unauthenticated client can, with a single crafted page parameter, make the server run an unbounded query and load the entire matching result set into memory, degrading or exhausting the process. Confirmed against the shipped gem/apps/keynav.ru demo.
CWE-770 (Allocation of Resources Without Limits or Throttling). CVSS v3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H = 7.5 (High).
A related reflected-XSS issue with the same root cause (unvalidated keynav cursor) is reported in a separate advisory.
Fixed in 43.8.3.
page array is validated: the types, the range of page and last, and the position of each cutoff. A malformed array restarts the pagination from page 1.Upgrade to 43.8.3 or later. Until then, the only workaround is to replace :keynav_js with another paginator (e.g. :keyset or :countless).
Source: NVD
Évaluation gratuite des vulnérabilités
Évaluez vos pratiques de sécurité cloud dans 9 domaines de sécurité afin d’évaluer votre niveau de risque et d’identifier les lacunes dans vos défenses.
Obtenez une démo personnalisée
"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."