Плагин EmailKit — Email Customizer for WooCommerce & WP для WordPress уязвим к произвольному чтению файлов посредством обхода пути во всех версиях до 1.6.3 включительно. Это связано с тем, что функция action() в классе TemplateData передает введенные пользователем данные из параметра REST API 'emailkit-editor-template' непосредственно в file_get_contents() без какой-либо проверки пути, очистки или ограничения разрешенного каталога. Это позволяет прошедшим проверку подлинности злоумышленникам с доступом на уровне администратора читать произвольные файлы на сервере (например, /etc/passwd или wp-config.php), предоставляя путь обхода.
Содержимое файла сохраняется как мета-пост и впоследствии может быть получено через конечную точку REST API выборки данных. Примечательно, что класс CheckForm в том же плагине реализует правильную проверку пути с использованием realpath() и ограничения каталога, демонстрируя, что разработчик знал о риске, но не смог применить ту же защиту к конечной точке TemplateData.
Показать оригинальное описание (EN)
The EmailKit – Email Customizer for WooCommerce & WP plugin for WordPress is vulnerable to arbitrary file read via path traversal in all versions up to, and including, 1.6.3. This is due to the action() function in the TemplateData class passing user-supplied input from the 'emailkit-editor-template' REST API parameter directly to file_get_contents() without any path validation, sanitization, or restriction to an allowed directory. This makes it possible for authenticated attackers, with Administrator-level access, to read arbitrary files on the server (such as /etc/passwd or wp-config.php) by supplying a traversal path. The file contents are stored as post meta and can subsequently be retrieved via the fetch-data REST API endpoint. Notably, the CheckForm class in the same plugin implements proper path validation using realpath() and directory restriction, demonstrating that the developer was aware of the risk but failed to apply the same protections to the TemplateData endpoint.
Характеристики атаки
Последствия
Строка CVSS v3.1