6.2medium
Statamic CMS Unguarded Exposure of 2FA Recovery Codes via Antlers current_user Variable
- Severity
- 6.2medium CVSS:3.1 by TuranSec
- Exploit likelihood
- 0.21% (higher than 12% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- TuranSec
- Also known as
- GHSA-jppw-r5j3-xf7x
Description
Statamic CMS's user-augmentation resolver, AugmentedUser::get in src/Auth/AugmentedUser.php, contains an explicit case for the handle that returns the user's raw two-factor recovery codes with no access restriction.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| statamic cms | up to 6.23.0 | CVE List |
| statamic/cms (Packagist) | from 6.0.0-alpha.1 up to 6.30.0 | GitHub Advisory Database |
All scores
| TuranSec | 6.2medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:N/A:N |
| GitHub | 6.2medium CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:N/A:N |
Classification
What each source says
CVE List
Statamic CMS's user-augmentation resolver, AugmentedUser::get in src/Auth/AugmentedUser.php, contains an explicit case for the handle that returns the user's raw two-factor recovery codes with no access restriction.
GitHub Advisory Database
Statamic CMS's user-augmentation resolver, AugmentedUser::get() in src/Auth/AugmentedUser.php, contains an explicit case for the two_factor_recovery_codes handle that returns the user's raw two-factor recovery codes with no access restriction: if ($handle === 'two_factor_recovery_codes') { return new Value($this->data->get('two_factor_recovery_codes'), ...); }. Unlike sensitive fields such as password/password_hash, which are excluded from AugmentedUser entirely, two_factor_recovery_codes is neither excluded from augmentation nor present in Statamic's Antlers variable guard lists (guardedVariablePatterns/guardedContentVariablePatterns in src/Providers/ViewServiceProvider.php, and the runtime GlobalRuntimeState guard paths), which by default only guard config.app.key. On any Antlers template field where raw/dynamic template rendering is enabled for a given field (an admin/developer-configured, blueprint-level field option), a template such as {{ current_user.two_factor_recovery_codes }}{{ value }}|{{ /current_user.two_factor_recovery_codes }} renders the viewing user's own 2FA recovery codes directly into the HTML response, allowing an attacker who can view or capture that response (e.g. via a shared/observable page, or a crafted link causing a victim to render it) to obtain the codes and bypass 2FA. Exploitation requires that dynamic Antlers rendering already be enabled on a field the target user's data flows through, which is a blueprint-configuration privilege rather than a standard content-editing permission.
NVD (es)
El resolvedor de aumento de usuario de Statamic CMS, AugmentedUser::get() en src/Auth/AugmentedUser.php, contiene un caso explícito para el manejador ’two_factor_recovery_codes’ que devuelve los códigos de recuperación de doble factor sin procesar del usuario sin restricción de acceso: ’if ($handle === ’two_factor_recovery_codes’) { return new Value($this -> data -> get(’two_factor_recovery_codes’), ...); }’. A diferencia de campos sensibles como password/password_hash, que están completamente excluidos de AugmentedUser, two_factor_recovery_codes no está excluido del aumento ni presente en las listas de protección de variables Antlers de Statamic (guardedVariablePatterns/guardedContentVariablePatterns en src/Providers/ViewServiceProvider.php, y las rutas de protección de GlobalRuntimeState en tiempo de ejecución), que por defecto solo protegen config.app.key. En cualquier campo de plantilla Antlers donde la renderización de plantilla sin procesar/dinámica esté habilitada para un campo dado (una opción de campo a nivel de blueprint, configurada por un administrador/desarrollador), una plantilla como ’{{ current_user.two_factor_recovery_codes }}{{ value }}|{{ /current_user.two_factor_recovery_codes }}’ renderiza los propios códigos de recuperación 2FA del usuario que visualiza directamente en la respuesta HTML, permitiendo a un atacante que pueda ver o capturar esa respuesta (por ejemplo, a través de una página compartida/observable, o un enlace manipulado que haga que una víctima lo renderice) obtener los códigos y eludir la 2FA. La explotación requiere que la renderización dinámica de Antlers ya esté habilitada en un campo por el que fluyen los datos del usuario objetivo, lo cual es un privilegio de configuración de blueprint en lugar de un permiso estándar de edición de contenido.
References
| https://github.com/statamic/cms | package, third-party-advisory | |
| https://github.com/statamic/cms/blob/master/src/Auth/AugmentedUser.php | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2026-71293 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-71293 changed 2026-08-10 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-jppw-r5j3-xf7x changed 2026-09-01 | CC-BY-4.0 |
| NVD | CVE-2026-71293 changed 2026-10-23 | Public domain |