Pagy I18n locale option is not validated before being used in a file path
Published: July 28, 2026
SECURITY IDENTIFIERS
- CVE: CVE-2026-54659 (NVD)
- GHSA: GHSA-2xmw-f8j8-wfxc
GEM
UNAFFECTED VERSIONS
< 43.0.0
PATCHED VERSIONS
>= 43.5.6
DESCRIPTION
Summary
Pagy::I18n.locale= did not validate its argument before using it as a
path component to load the matching dictionary file (<locale>.yml). An
application that assigns untrusted input to the locale — e.g. the common
pattern Pagy::I18n.locale = params[:locale] — let that input influence
which file Pagy attempted to load.
Impact
Information disclosure (CWE-22 / CWE-200): a file-existence / readability
oracle for .yml paths on the host, plus a server-side read of
attacker-chosen files into the process. The file contents are not
returned in the response.
Only applications that pass unsanitized end-user input into
Pagy::I18n.locale= are affected. Applications that set the locale from
trusted values are not affected.
RELATED
- https://nvd.nist.gov/vuln/detail/CVE-2026-54659
- https://github.com/ddnexus/pagy/releases/tag/43.5.6
- https://github.com/ddnexus/pagy/pull/908
- https://github.com/ddnexus/pagy/commit/efcf09690e9fa7d7abdfb987b785a55f87e287df
- https://advisories.gitlab.com/gem/pagy/CVE-2026-54659
- https://github.com/ddnexus/pagy/security/advisories/GHSA-2xmw-f8j8-wfxc
- https://github.com/advisories/GHSA-2xmw-f8j8-wfxc
