CVE-2023-40021
JSON

5.3medium

Timing Attack Reveals CSRF Tokens in oppia

Severity
5.3medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.77% (higher than 56% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M

Description

Oppia is an online learning platform. When comparing a received CSRF token against the expected token, Oppia uses the string equality operator (`==`), which is not safe against timing attacks. By repeatedly submitting invalid tokens, an attacker can brute-force the expected CSRF token character by character. Once they have recovered the token, they can then submit a forged request on behalf of a logged-in user and execute privileged actions on that user's behalf. In particular the function to validate received CSRF tokens is at `oppia.core.controllers.base.CsrfTokenManager.is_csrf_token_valid`. An attacker who can lure a logged-in Oppia user to a malicious website can perform any change on Oppia that the user is authorized to do, including changing profile information; creating, deleting, and changing explorations; etc. Note that the attacker cannot change a user's login credentials. An attack would need to complete within 1 second because every second, the time used in computing the token changes. This issue has been addressed in commit `b89bf80837` which has been included in release `3.3.2-hotfix-2`. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
oppia oppia>= 1.1.0, < 3.3.2-hotfix-2, from 1.1.0 before 3.3.2, 3.3.2CVE List, NVD

All scores

GitHub_M5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N
NVD5.3medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N

Classification

CWE-203CWE-208

SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial.

What each source says

CVE List

Oppia is an online learning platform. When comparing a received CSRF token against the expected token, Oppia uses the string equality operator (`==`), which is not safe against timing attacks. By repeatedly submitting invalid tokens, an attacker can brute-force the expected CSRF token character by character. Once they have recovered the token, they can then submit a forged request on behalf of a logged-in user and execute privileged actions on that user's behalf. In particular the function to validate received CSRF tokens is at `oppia.core.controllers.base.CsrfTokenManager.is_csrf_token_valid`. An attacker who can lure a logged-in Oppia user to a malicious website can perform any change on Oppia that the user is authorized to do, including changing profile information; creating, deleting, and changing explorations; etc. Note that the attacker cannot change a user's login credentials. An attack would need to complete within 1 second because every second, the time used in computing the token changes. This issue has been addressed in commit `b89bf80837` which has been included in release `3.3.2-hotfix-2`. Users are advised to upgrade. There are no known workarounds for this vulnerability.

NVD (es)

Oppia es una plataforma de aprendizaje en línea. Al comparar un token CSRF recibido con el token esperado, Oppia utiliza el operador de igualdad de cadenas (“==”), que no es seguro contra ataques de temporización. Al enviar repetidamente tokens no válidos, un atacante puede forzar por fuerza bruta el token CSRF esperado carácter por carácter. Una vez que han recuperado el token, pueden enviar una solicitud falsificada en nombre de un usuario autenticado y ejecutar acciones privilegiadas en nombre de ese usuario. En particular, la función para validar los tokens CSRF recibidos se encuentra en “oppia.core.controllers.base.CsrfTokenManager.is_csrf_token_valid”. Un atacante que pueda atraer a un usuario de Oppia autenticado a un sitio web malicioso puede realizar cualquier cambio en Oppia que el usuario esté autorizado a hacer, incluyendo cambiar información de perfil; crear, eliminar y modificar exploraciones; etc. Tenga en cuenta que el atacante no puede cambiar las credenciales de inicio de sesión de un usuario. Un ataque debería completarse en 1 segundo porque cada segundo, el tiempo utilizado en el cálculo del token cambia. Este problema ha sido abordado en el commit “b89bf80837”, que ha sido incluido en la versión “3.3.2-hotfix-2”. Se aconseja a los usuarios que actualicen. No se conocen soluciones alternativas para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2023-40021 changed 2024-10-03CVE Terms of Use
NVDCVE-2023-40021 changed 2026-11-10Public domain