Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-7mqq-6cf9-v2qp

Опубликовано: 02 апр. 2026
Источник: github
Github: Прошло ревью
CVSS3: 5.3

Описание

Rack has a root directory disclosure via unescaped regex interpolation in Rack::Directory

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.

Пакеты

Наименование

rack

rubygems
Затронутые версииВерсия исправления

< 2.2.23

2.2.23

Наименование

rack

rubygems
Затронутые версииВерсия исправления

>= 3.0.0.beta1, < 3.1.21

3.1.21

Наименование

rack

rubygems
Затронутые версииВерсия исправления

>= 3.2.0, < 3.2.6

3.2.6

EPSS

Процентиль: 15%
0.0024
Низкий

5.3 Medium

CVSS3

Дефекты

CWE-625

Связанные уязвимости

CVSS3: 5.3
ubuntu
4 месяца назад

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.

CVSS3: 5.3
redhat
4 месяца назад

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.

CVSS3: 5.3
nvd
4 месяца назад

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.

CVSS3: 5.3
debian
4 месяца назад

Rack is a modular Ruby web server interface. Prior to versions 2.2.23, ...

CVSS3: 5.3
fstec
4 месяца назад

Уязвимость модульного интерфейса веб-сервера Rack языка программирования Ruby, позволяющая нарушителю получить несанкционированный доступ к защищаемой информации

EPSS

Процентиль: 15%
0.0024
Низкий

5.3 Medium

CVSS3

Дефекты

CWE-625