GHSA-v472-jp5g-c53f: 
Ruby Analyse et atténuation de la vulnérabilité

Summary

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.

Details

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.

Proof of concept

Verified with Docker (Ruby 3.4, real ActiveRecord + SQLite) over HTTP against the shipped demo.

  1. Serve the bundled demo: pagy keynav (serves gem/apps/keynav.ru on http://127.0.0.1:8000). Its keyset is [animal, name, birthdate, id].
  2. The decoded cursor array is [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.

Impact

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.

Patches

Fixed in 43.8.3.

  • The decoded 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.
  • The visited pages are always fetched with a LIMIT, so a forged cutoff can no longer pull more than one page of records. The fix was reviewed and verified by @7a6163, who also reported the vulnerability.

Workarounds

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

Connexe Ruby Vulnérabilités :

CVE ID

Gravité

Partition

Technologies

Nom du composant

Exploit CISA KEV

A corrigé

Date de publication

GHSA-v472-jp5g-c53fHIGH7.5
  • Ruby logoRuby
  • pagy
NonOuiNov 18, 2026
CVE-2026-115472MEDIUM6.5
  • Ruby logoRuby
  • doorkeeper
NonOuiNov 17, 2026
GHSA-h648-g954-826qMEDIUM6.1
  • Ruby logoRuby
  • pagy
NonOuiNov 18, 2026
GHSA-w5jj-r577-97mqMEDIUM5.3
  • Ruby logoRuby
  • faye
NonOuiNov 17, 2026
GHSA-wqwf-8p4q-mwqjHIGHN/A
  • Ruby logoRuby
  • graphql
NonOuiNov 17, 2026

Évaluation gratuite des vulnérabilités

Évaluez votre posture de sécurité cloud

É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.

Évaluation de la demande

Ressources Wiz supplémentaires

Obtenez une démo personnalisée

Prêt(e) à voir Wiz en action ?

"La meilleure expérience utilisateur que j’ai jamais vue, offre une visibilité totale sur les workloads cloud."
David EstlickRSSI
"Wiz fournit une interface unique pour voir ce qui se passe dans nos environnements cloud."
Adam FletcherChef du service de sécurité
"Nous savons que si Wiz identifie quelque chose comme critique, c’est qu’il l’est réellement."
Greg PoniatowskiResponsable de la gestion des menaces et des vulnérabilités