CVE-2021-21264
JSON

5.2medium

Bypass of fix for CVE-2020-26231, Twig sandbox escape

Severity
5.2medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.27% (higher than 19% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-fcr8-6q7r-m4wg

Description

October is a free, open-source, self-hosted CMS platform based on the Laravel PHP Framework. A bypass of CVE-2020-26231 (fixed in 1.0.470/471 and 1.1.1) was discovered that has the same impact as CVE-2020-26231 & CVE-2020-15247. An authenticated backend user with the `cms.manage_pages`, `cms.manage_layouts`, or `cms.manage_partials` permissions who would **normally** not be permitted to provide PHP code to be executed by the CMS due to `cms.enableSafeMode` being enabled is able to write specific Twig code to escape the Twig sandbox and execute arbitrary PHP. This is not a problem for anyone that trusts their users with those permissions to normally write & manage PHP within the CMS by not having `cms.enableSafeMode` enabled, but would be a problem for anyone relying on `cms.enableSafeMode` to ensure that users with those permissions in production do not have access to write & execute arbitrary PHP. Issue has been patched in Build 472 (v1.0.472) and v1.1.2. As a workaround, apply https://github.com/octobercms/october/commit/f63519ff1e8d375df30deba63156a2fc97aa9ee7 to your installation manually if unable to upgrade to Build 472 or v1.1.2.

Affected

Product or packageVersionsReported by
octobercms october1.0.471, 1.1.1, up to 1.0.471, from 1.1.0 up to 1.1.1CVE List, NVD
october/cms (Packagist)from 1.0.471 before 1.0.472, from 1.1.1 before 1.1.2GitHub Advisory Database

All scores

GitHub_M5.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L
GitHub5.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L
NVD5.2medium CVSS:3.1CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L
NVD4.4medium CVSS:2.0AV:L/AC:M/Au:N/C:P/I:P/A:P

Classification

What each source says

CVE List

October is a free, open-source, self-hosted CMS platform based on the Laravel PHP Framework. A bypass of CVE-2020-26231 (fixed in 1.0.470/471 and 1.1.1) was discovered that has the same impact as CVE-2020-26231 & CVE-2020-15247. An authenticated backend user with the `cms.manage_pages`, `cms.manage_layouts`, or `cms.manage_partials` permissions who would **normally** not be permitted to provide PHP code to be executed by the CMS due to `cms.enableSafeMode` being enabled is able to write specific Twig code to escape the Twig sandbox and execute arbitrary PHP. This is not a problem for anyone that trusts their users with those permissions to normally write & manage PHP within the CMS by not having `cms.enableSafeMode` enabled, but would be a problem for anyone relying on `cms.enableSafeMode` to ensure that users with those permissions in production do not have access to write & execute arbitrary PHP. Issue has been patched in Build 472 (v1.0.472) and v1.1.2. As a workaround, apply https://github.com/octobercms/october/commit/f63519ff1e8d375df30deba63156a2fc97aa9ee7 to your installation manually if unable to upgrade to Build 472 or v1.1.2.

GitHub Advisory Database
Impact

A bypass of CVE-2020-26231 (fixed in 1.0.470/471 and 1.1.1) was discovered that has the same impact as CVE-2020-26231 & CVE-2020-15247:

An authenticated backend user with the cms.manage_pages, cms.manage_layouts, or cms.manage_partials permissions who would normally not be permitted to provide PHP code to be executed by the CMS due to cms.enableSafeMode being enabled is able to write specific Twig code to escape the Twig sandbox and execute arbitrary PHP.

This is not a problem for anyone that trusts their users with those permissions to normally write & manage PHP within the CMS by not having cms.enableSafeMode enabled, but would be a problem for anyone relying on cms.enableSafeMode to ensure that users with those permissions in production do not have access to write & execute arbitrary PHP.

Patches

Issue has been patched in Build 472 (v1.0.472) and v1.1.2.

Workarounds

Apply https://github.com/octobercms/october/commit/f63519ff1e8d375df30deba63156a2fc97aa9ee7 to your installation manually if unable to upgrade to Build 472 or v1.1.2.

References

Reported by ka1n4t

For more information

If you have any questions or comments about this advisory:

Threat assessment:
Screen Shot 2020-10-10 at 1 21 13 PM
NVD (es)

October es una plataforma CMS gratuita, de código abierto y autohosteada basada en Laravel PHP Framework. Se detectó una omisión de CVE-2020-26231 (corregido en las versiones 1.0.470/471 y 1.1.1) que tiene el mismo impacto que CVE-2020-26231 y CVE-2020-15247. Un usuario de back-end autenticado con los permisos "cms.manage_pages", "cms.manage_layouts" o "cms.manage_partials" que **normalmente** no podría proporcionar código PHP para ser ejecutado por el CMS debido a "cms.enableSafeMode" que está habilitado es capaz de escribir código Twig específico para escapar del sandbox Twig y ejecutar PHP arbitrario. Esto no es un problema para cualquiera que confíe a sus usuarios con esos permisos para escribir y administrar PHP normalmente dentro del CMS al no tener habilitado "cms.enableSafeMode", pero sería un problema para cualquiera que confíe en "cms.enableSafeMode" para asegurarse de que los usuarios con esos permisos en producción no tienen acceso para escribir y ejecutar PHP arbitrario. El problema se corrigió en la compilación 472 (v1.0.472) y v1.1.2. Como solución alternativa, aplique https://github.com/octobercms/october/commit/f63519ff1e8d375df30deba63156a2fc97aa9ee7 a su instalación manualmente si no puede actualizar a la compilación 472 o v1.1.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21264 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-fcr8-6q7r-m4wg changed 2026-07-08CC-BY-4.0
NVDCVE-2021-21264 changed 2026-06-17Public domain