Vulnerabilities in pkg:pypi/flask-session-captcha
PACKAGECVE-2022-24880 is a MODERATE (CVSS 5.3) potential captcha validate bypass vulnerability (CWE-253: Incorrect Check of Function Return Value) affecting Flask session captcha libraries in the PyPI ecosystem. The issue involves potential captcha validate bypass in flask-session-captcha. Remediation is available by upgrading affected packages to version 1.2.1.
pkg:pypi/flask-session-captcha
Vulnerability advisories affecting package pkg:pypi/flask-session-captcha. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-7r87-cj48-wj45 | CVE-2022-24880 | MODERATE | Potential Captcha Validate Bypass in flask-session-captcha |
CVE-2022-24880 at a Glance
Security Impact
CVSS: 5.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2022-24880
To remediate this vulnerability, upgrade all affected Flask session captcha dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install flask-session-captcha>=1.2.1
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show flask-session-captcha
How to Check if You Are Affected
To determine whether your Python environment is affected by CVE-2022-24880, inspect your installed packages using pip:
pip show flask-session-captcha
Analyze the terminal output to locate any version of Flask session captcha in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.1), your application is affected.
Note: The pip show flask-session-captcha command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-253: Incorrect Check of Function Return Value, where the product incorrectly checks a return value from a function, which prevents it from detecting errors or exceptional conditions. In Flask session captcha, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-24880 Affected Flask session captcha Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
flask-session-captcha
|
PyPI |
< 1.2.1
|
1.2.1
|
References
Frequently Asked Questions
What is CVE-2022-24880?
Which Flask session captcha versions are affected?
What version fixes CVE-2022-24880?
Is flask-session-captcha affected?
What is the CVSS score of CVE-2022-24880?
What CWE is associated with CVE-2022-24880?
How can I check PyPI dependencies for CVE-2022-24880?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-7r87-cj48-wj45",
"modified" : "2024-09-20T21:03:06Z",
"published" : "2022-04-26T21:19:52Z",
"aliases" : [ "CVE-2022-24880" ],
"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",
"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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "flask-session-captcha"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.2.1"
} ]
} ]
} ],
"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"
} ],
"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"
}
}