{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2023-40021","id":"CVE-2023-40021","title":"Timing Attack Reveals CSRF Tokens in oppia","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 l","descriptionLong":"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.","published":"2023-08-16T20:25:22.726Z","updated":"2026-11-12T02:31:01.134129415Z","reserved":"2023-08-08T13:46:25.243Z","status":"Modified","rejected":false,"assigner":"GitHub_M","metric":{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"GitHub_M"},"metrics":[{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"GitHub_M"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"github.com"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"NVD"},{"version":"3.1","score":5.3,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:N/I:H/A:N","rating":"medium","source":"OSV"}],"rating":"medium","products":["oppia"],"affectedProducts":[{"vendor":"oppia","product":"oppia","defaultStatus":null,"versions":[{"version":">= 1.1.0, < 3.3.2-hotfix-2","status":"affected"}],"platforms":[]}],"packages":[],"cwes":["CWE-203","CWE-208"],"aliases":["GHSA-49jp-pjc3-2532"],"references":[{"url":"https://github.com/oppia/oppia/security/advisories/GHSA-49jp-pjc3-2532","tags":["x_refsource_CONFIRM","x_transferred","Exploit","Vendor Advisory","advisory"]},{"url":"https://github.com/oppia/oppia/pull/18769","tags":["x_refsource_MISC","x_transferred","Patch","fix"]},{"url":"https://github.com/oppia/oppia/commit/b89bf808378c1236874b5797a7bda32c77b4af23","tags":["x_refsource_MISC","x_transferred","Patch","fix"]},{"url":"https://github.com/oppia/oppia/blob/3a05c3558a292f3db9e658e60e708c266c003fd0/core/controllers/base.py#L964-L990","tags":["x_refsource_MISC","x_transferred","Product","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/40xxx/CVE-2023-40021.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-40021","tags":["advisory"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":true,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial"},"epss":0.00774,"epssPercentile":0.56646,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2023-40021","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-40021","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2023-40021","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2023-40021","ok":true,"note":"scored 2026-11-20"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}