GHSA-R63R-HJFQ-PWF8
Server Environment and Header Disclosure via Twig Request Object
CVSS:3.1/AV:N/AC:H/PR:H/UI:N/S:U/C:L/I:N/A:N
Fuente: GitHub
Ciclo de vida de la vulnerabilidad
| Fecha | Fase | Evento | Detalle |
|---|---|---|---|
| Divulgación | Publicada | GHSA-R63R-HJFQ-PWF8 divulgada · CVSS 2.2 (GitHub) | |
| Monitoreo | Detectada | Ingresó al índice | |
| Monitoreo | Verificada | Última verificación contra las fuentes |
The Twig sandbox `SecurityPolicy` allowlisted `Illuminate\Http\Request` with no method-level restrictions, and the fully-hydrated request object was injected into every CMS page render as `this.request`. A backend user with CMS markup editing access could call `this.request.server()` from a Safe Mode template to read the full `$_SERVER` superglobal (which contains `.env` secrets such as `APP_KEY`, `DB_PASSWORD`, and third-party API credentials in PHP-FPM and equivalent deployments), or call `this.request.header()` / `this.request.cookie()` / `this.request.bearerToken()` to read incoming request headers and cookies.
This issue only affects installations running with `cms.safe_mode` enabled. Safe Mode is a niche opt-in feature, primarily used for demo installations and multi-tenant or shared-editor scenarios where untrusted users are deliberately granted access to the CMS markup editor. In standard production deployments Safe Mode is off, backend access is restricted to trusted administrators, and a markup editor can already read `$_SERVER` directly via raw PHP. The disclosure path closed here is the Safe Mode boundary itself, so installations without Safe Mode enabled are not exposed.
### Impact
- Disclosure of the full `$_SERVER` array from a Safe Mode Twig template, including environment variables on deployments that surface `.env` via `$_SERVER` (PHP-FPM, Apache `SetEnv`, etc.). On affected deployments this typically includes `APP_KEY`, database credentials, and third-party API keys.
- Disclosure of incoming request headers (including `Authorization` and other credential-bearing headers) and cookies (including session cookies).
- Disclosure of the raw request body via `getContent()`.
- Requires `cms.safe_mode` to be enabled, and a backend user with CMS markup editing access who is not intended to be trusted as a full administrator.
- Not exploitable when Safe Mode is disabled.
### Patches
The vulnerability has been patched in v3.7.17 and v4.2.21. The `Illuminate\Http\Request` instance is no longer allowlisted directly in the Twig sandbox; instead it is wrapped via `castMethodObjectToSafeObject` in a new `SafeRequest` proxy. The proxy exposes an explicit allowlist of read-only methods that themes legitimately use (URL/routing methods such as `url`, `path`, `method`, `is`; request-type checks such as `ajax`, `pjax`, `secure`; user-supplied input methods such as `input`, `query`, `has`; and low-sensitivity network metadata such as `ip`, `userAgent`). Methods that expose server environment, request headers, cookies, raw body, or authentication state (`server`, `header`, `cookie`, `getContent`, `bearerToken`, `getPassword`, `getUser`, `session`, `user`) are blocked.
### Workarounds
If upgrading immediately is not possible, restrict CMS markup editing access to fully trusted administrators only, the standard October CMS recommendation for any deployment.
### References
- Reported by kid1412-byte
Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.
Desglose de métricas
Rangos afectados
Estado del parche por paquete
| Paquete / producto | Estado | Corregida en | Desde divulgación | Última versión |
|---|---|---|---|---|
Packagistoctober/system |
Sin parche | — | — | — |
Arsenal público
Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.
https://github.com/octobercms/october/security/advisories/GHSA-r63r-hjfq-pwf8Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.
