{"id":"CVE-2021-21264","aliases":["CVE-2021-21264","GHSA-fcr8-6q7r-m4wg"],"related":[],"kind":"vulnerability","state":"published","title":"Bypass of fix for CVE-2020-26231, Twig sandbox escape","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\nA 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:\n\nAn 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.\n\nThis 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.\n\n### Patches\nIssue has been patched in Build 472 (v1.0.472) and v1.1.2.\n\n### Workarounds\nApply https://github.com/octobercms/october/commit/f63519ff1e8d375df30deba63156a2fc97aa9ee7 to your installation manually if unable to upgrade to Build 472 or v1.1.2.\n\n### References\nReported by [ka1n4t](https://github.com/ka1n4t)\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Email us at [hello@octobercms.com](mailto:hello@octobercms.com)\n\n### Threat assessment:\n<img width=\"1108\" alt=\"Screen Shot 2020-10-10 at 1 21 13 PM\" src=\"https://user-images.githubusercontent.com/7253840/95663316-7de28b80-0afb-11eb-999d-a6526cf78709.png\">","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2021-05-03T16:00:18.000Z","modified":"2026-07-08T06:30:01.387Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L","score":5.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L","score":5.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L","score":5.2,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:C/C:L/I:L/A:L","score":5.2,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:2.0","vector":"AV:L/AC:M/Au:N/C:P/I:P/A:P","score":4.4,"rating":"MEDIUM"}],"cwes":["CWE-862"],"affected":[{"ranges":[{"version":"1.0.471","status":"affected"},{"version":"1.1.1","status":"affected"}],"vendor":"octobercms","product":"october","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"1.0.471","status":"affected","fixed":"1.0.472"}],"ecosystem":"Packagist","package":"october/cms","purl":"pkg:composer/october/cms","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"1.1.1","status":"affected","fixed":"1.1.2"}],"ecosystem":"Packagist","package":"october/cms","purl":"pkg:composer/october/cms","source":"ghsa"},{"ranges":[{"status":"affected","lastAffected":"1.0.471"},{"status":"affected","introduced":"1.1.0","lastAffected":"1.1.1"}],"vendor":"octobercms","product":"october","cpe":"cpe:2.3:a:octobercms:october:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/octobercms/october/security/advisories/GHSA-fcr8-6q7r-m4wg","tags":["patch","third-party-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21264","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/octobercms/october","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2021-21264","url":"https://www.cve.org/CVERecord?id=CVE-2021-21264","licence":"CVE Terms of Use","modified":"2024-08-03T18:09:14.926Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-fcr8-6q7r-m4wg","url":"https://github.com/advisories/GHSA-fcr8-6q7r-m4wg","licence":"CC-BY-4.0","modified":"2026-07-08T06:30:01.387Z"},{"source":"nvd","name":"NVD","id":"CVE-2021-21264","url":"https://nvd.nist.gov/vuln/detail/CVE-2021-21264","licence":"Public domain","modified":"2026-06-17T03:35:09.167Z"}],"updatedAt":"2026-11-25T22:58:01.133Z","epss":{"score":0.00265,"percentile":0.19633,"date":"2026-12-01T12:00:22.000Z"}}