RubySec

Providing security resources for the Ruby community

CVE-2026-54659 (pagy): Pagy I18n locale option is not validated before being used in a file path

Pagy I18n locale option is not validated before being used in a file path

Published: July 28, 2026

SECURITY IDENTIFIERS

GEM

pagy

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 (&lt;locale&gt;.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