В версии Hugo 0.161.0 конвейеры ресурсов Node были размещены за моделью разрешений Node.js, чтобы код, работающий через PostCSS, Babel или TailwindCSS, не мог достичь файловой системы за пределами каталога проекта. В версии Hugo 0.162.0 добавлен Tailwindcss к параметру AllowChildProcess по умолчанию в config/security/securityConfig.go, что заставляет nodePermissionArgs в common/hexec/exec.go добавлять --allow-child-process всякий раз, когда запускаемый инструмент называется Tailwindcss. TailwindCSS загружает файл Tailwind.config.js сайта через require при запуске, поэтому код верхнего уровня в этом файле выполняется внутри разрешенного процесса Node и может вызывать child_process для запуска оболочки. Созданный процесс не является процессом Node и не наследует ни одного из флагов разрешений, поэтому он запускается с полными привилегиями учетной записи, выполняющей сборку.
Таким образом, создание сайта, тема, модуль или начальный шаблон которого предоставляет конфигурацию Tailwind, приводит к выполнению произвольных команд, а не к ограниченному доступу к файлам, для обеспечения которого была введена модель разрешений. В версии Hugo 0.165.0 Tailwindcss удален из списка Security.exec.allow по умолчанию, поэтому инструмент больше не запускается в конфигурации по умолчанию.
Показать оригинальное описание (EN)
Hugo 0.161.0 placed the Node asset pipelines behind the Node.js permission model so that code running through PostCSS, Babel, or TailwindCSS could not reach the file system outside the project directory. Hugo 0.162.0 added tailwindcss to the AllowChildProcess default in config/security/securityConfig.go, which makes nodePermissionArgs in common/hexec/exec.go append --allow-child-process whenever the tool being launched is named tailwindcss. TailwindCSS loads the site's tailwind.config.js through require at startup, so top-level code in that file executes inside the permitted Node process and can call child_process to spawn a shell. The spawned process is not a Node process and inherits none of the permission flags, so it runs with the full privileges of the account performing the build. Building a site whose theme, module, or starter template supplies the Tailwind configuration therefore yields arbitrary command execution rather than the confined file access the permission model was introduced to enforce. Hugo 0.165.0 removes tailwindcss from the default security.exec.allow list, so the tool is no longer launched under the default configuration.
Характеристики атаки
Последствия
Строка CVSS v4.0
Тип уязвимости (CWE)
Уязвимые продукты 1
| Конфигурация | От (включительно) | До (исключительно) |
|---|---|---|
|
Gohugo Hugo
cpe:2.3:a:gohugo:hugo:*:*:*:*:*:*:*:*
|
0.162.0
|
0.165.0
|