{"id":"GHSA-7r87-cj48-wj45","summary":"Potential Captcha Validate Bypass in flask-session-captcha","details":"### Impact\nflask-session-captcha is a package which allows users to extend Flask by adding an image based captcha stored in a server side session.\n\nThe `captcha.validate()` function would return `None` if passed no value (e.g. by submitting a request with an empty form).\n\nIf implementing users were checking the return value to be **False**, the captcha verification check could be bypassed.\n\nSample vulnerable code:\n```python\nif captcha.validate() == False:\n    ... # abort\nelse:\n   ... # do stuff\n```\n\n### Patches\nA new version (1.2.1) is available that fixes the issue.\n\n### Workarounds\nUsers can workaround the issue by not explicitly checking that the value is False. \n\nChecking the return value less explicitly should still work. \n\n```python\nif not captcha.validate():\n    ... # abort\nelse:\n   ... # do stuff\n```\n\n```python\nif captcha.validate():\n    ... # do stuff\nelse:\n   ... # abort\n```\n\n### References\nhttps://github.com/Tethik/flask-session-captcha/pull/27\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [the github repo](https://github.com/Tethik/flask-session-captcha)\n","aliases":["CVE-2022-24880","PYSEC-2022-193"],"modified":"2025-02-21T05:43:04.937255Z","published":"2022-04-26T21:19:52Z","database_specific":{"cwe_ids":["CWE-253","CWE-394","CWE-754"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2022-04-26T21:19:52Z","nvd_published_at":"2022-04-25T22:15:00Z"},"references":[{"type":"WEB","url":"https://github.com/Tethik/flask-session-captcha/security/advisories/GHSA-7r87-cj48-wj45"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-24880"},{"type":"WEB","url":"https://github.com/Tethik/flask-session-captcha/pull/27"},{"type":"WEB","url":"https://github.com/Tethik/flask-session-captcha/commit/2811ae23a38d33b620fb7a07de8837c6d65c13e4"},{"type":"PACKAGE","url":"https://github.com/Tethik/flask-session-captcha"},{"type":"WEB","url":"https://github.com/Tethik/flask-session-captcha/releases/tag/v1.2.1"},{"type":"WEB","url":"https://github.com/pypa/advisory-database/tree/main/vulns/flask-session-captcha/PYSEC-2022-193.yaml"}],"affected":[{"package":{"name":"flask-session-captcha","ecosystem":"PyPI","purl":"pkg:pypi/flask-session-captcha"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.2.1"}]}],"versions":["1.0.0","1.0.1","1.0.2","1.0.3","1.1.0","1.2.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2022/04/GHSA-7r87-cj48-wj45/GHSA-7r87-cj48-wj45.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N"},{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"}]}