CVE-2026-34763
JSON

5.3medium

Rack: Rack::Directory info disclosure and DoS via unescaped regex interpolation

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.28% (higher than 22% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-7mqq-6cf9-v2qp

Description

Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Directory interpolates the configured root path directly into a regular expression when deriving the displayed directory path. If root contains regex metacharacters such as +, *, or ., the prefix stripping can fail and the generated directory listing may expose the full filesystem path in the HTML output. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.

Affected

Product or packageVersionsReported by
rack rack< 2.2.23, >= 3.0.0.beta1, < 3.1.21, >= 3.2.0, < 3.2.6, before 2.2.23, from 3.0.0 before 3.1.21, from 3.2.0 before 3.2.6CVE List, NVD
rack (RubyGems)before 2.2.23, from 3.0.0.beta1 before 3.1.21, from 3.2.0 before 3.2.6GitHub Advisory Database

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
GitHub5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N

Classification

CWE-625

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Rack is a modular Ruby web server interface. Prior to versions 2.2.23, 3.1.21, and 3.2.6, Rack::Directory interpolates the configured root path directly into a regular expression when deriving the displayed directory path. If root contains regex metacharacters such as +, *, or ., the prefix stripping can fail and the generated directory listing may expose the full filesystem path in the HTML output. This issue has been patched in versions 2.2.23, 3.1.21, and 3.2.6.

GitHub Advisory Database

Summary

Rack::Directory interpolates the configured root path directly into a regular expression when deriving the displayed directory path. If root contains regex metacharacters such as +, *, or ., the prefix stripping can fail and the generated directory listing may expose the full filesystem path in the HTML output.

Details

Rack::Directory::DirectoryBody#each computes the visible path using code equivalent to:

show_path = Utils.escape_html(path.sub(/\A#{root}/, ''))

Here, root is a developer-configured filesystem path. It is normalized earlier with File.expand_path(root) and then inserted directly into a regular expression without escaping.

Because the value is treated as regex syntax rather than as a literal string, metacharacters in the configured path can change how the prefix match behaves. When that happens, the expected root prefix is not removed from path, and the absolute filesystem path is rendered into the HTML directory listing.

Impact

If Rack::Directory is configured to serve a directory whose absolute path contains regex metacharacters, the generated directory listing may disclose the full server filesystem path instead of only the request-relative path.

This can expose internal deployment details such as directory layout, usernames, mount points, or naming conventions that would otherwise not be visible to clients.

Mitigation

  • Update to a patched version of Rack in which the root prefix is removed using an escaped regular expression.
  • Avoid using Rack::Directory with a root path that contains regular expression metacharacters.
NVD (es)

Rack es una interfaz modular de servidor web Ruby. Antes de las versiones 2.2.23, 3.1.21 y 3.2.6, Rack::Directory interpola la ruta raíz configurada directamente en una expresión regular al derivar la ruta del directorio mostrada. Si la raíz contiene metacaracteres de expresiones regulares como +, *, o ., la eliminación del prefijo puede fallar y la lista de directorios generada puede exponer la ruta completa del sistema de archivos en la salida HTML. Este problema ha sido parcheado en las versiones 2.2.23, 3.1.21 y 3.2.6.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-34763 changed 2026-04-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-7mqq-6cf9-v2qp changed 2026-09-10CC-BY-4.0
NVDCVE-2026-34763 changed 2026-07-24Public domain