Flask-AppBuilder vulnerable to incorrect authentication when using auth type OpenID
What fixes it
- 4.3.11Flask-AppBuilder, pipGitHub
- 4.3.11flask-appbuilder, PyPIOSV
pip install "flask-appbuilder>=4.3.11"
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
Impact
When Flask-AppBuilder is set to AUTH_TYPE AUTH_OID, allows an attacker to forge an HTTP request, that could deceive the backend into using any requested OpenID service. This vulnerability could grant an attacker unauthorised privilege access if a custom OpenID service is deployed by the attacker and accessible by the backend.
This vulnerability is only exploitable when the application is using the old (deprecated 10 years ago) OpenID 2.0 authorization protocol (which is very different from the popular OIDC - Open ID Connect - popular protocol used today). Currently, this protocol is regarded as legacy, with significantly reduced usage and not supported for several years by major authorization providers.
Patches
Upgrade to Flask-AppBuilder 4.3.11
Workarounds
If upgrade is not possible add the following to your config:
from flask import flash, redirect
from flask_appbuilder import expose
from flask_appbuilder.security.sqla.manager import SecurityManager
from flask_appbuilder.security.views import AuthOIDView
from flask_appbuilder.security.forms import LoginForm_oid
basedir = os.path.abspath(os.path.dirname(__file__))
class FixedOIDView(AuthOIDView):
@expose("/login/", methods=["GET", "POST"])
def login(self, flag=True):
form = LoginForm_oid()
if form.validate_on_submit():
identity_url = None
for provider in self.appbuilder.sm.openid_providers:
if provider.get("url") == form.openid.data:
identity_url = form.openid.data
if identity_url is None:
flash(self.invalid_login_message, "warning")
return redirect(self.appbuilder.get_url_for_login)
return super().login(flag=flag)
class FixedSecurityManager(SecurityManager):
authoidview = FixedOIDView
FAB_SECURITY_MANAGER_CLASS = "config.FixedSecurityManager"Text from GitHub Advisory Database
Affected versions 53
- Flask-AppBuilder, pip< 4.3.11GitHub
- Flask-AppBuilderaffected: < 4.3.11CVE List
- flask-appbuilder, PyPIfrom first release, fixed in 4.3.11OSV
- flask-appbuilder, PyPI0.1.10OSV
- flask-appbuilder, PyPI0.1.11OSV
- flask-appbuilder, PyPI0.1.12OSV
- flask-appbuilder, PyPI0.1.13OSV
- flask-appbuilder, PyPI0.1.14OSV
- flask-appbuilder, PyPI0.1.15OSV
- flask-appbuilder, PyPI0.1.16OSV
- flask-appbuilder, PyPI0.1.17OSV
- flask-appbuilder, PyPI0.1.18OSV
- flask-appbuilder, PyPI0.1.19OSV
- flask-appbuilder, PyPI0.1.20OSV
- flask-appbuilder, PyPI0.1.21OSV
- flask-appbuilder, PyPI0.1.22OSV
- flask-appbuilder, PyPI0.1.23OSV
- flask-appbuilder, PyPI0.1.24OSV
- flask-appbuilder, PyPI0.1.25OSV
- flask-appbuilder, PyPI0.1.26OSV
- flask-appbuilder, PyPI0.1.27OSV
- flask-appbuilder, PyPI0.1.28OSV
- flask-appbuilder, PyPI0.1.29OSV
- flask-appbuilder, PyPI0.1.3OSV
- flask-appbuilder, PyPI0.1.33OSV
- flask-appbuilder, PyPI0.1.34OSV
- flask-appbuilder, PyPI0.1.35OSV
- flask-appbuilder, PyPI0.1.36OSV
- flask-appbuilder, PyPI0.1.37OSV
- flask-appbuilder, PyPI0.1.38OSV
- flask-appbuilder, PyPI0.1.4OSV
- flask-appbuilder, PyPI0.1.43OSV
- flask-appbuilder, PyPI0.1.44OSV
- flask-appbuilder, PyPI0.1.45OSV
- flask-appbuilder, PyPI0.1.46OSV
- flask-appbuilder, PyPI0.1.47OSV
- flask-appbuilder, PyPI0.1.5OSV
- flask-appbuilder, PyPI0.1.6OSV
- flask-appbuilder, PyPI0.1.7OSV
- flask-appbuilder, PyPI0.1.8OSV
- flask-appbuilder, PyPI0.1.9OSV
- flask-appbuilder, PyPI0.10.0OSV
- flask-appbuilder, PyPI0.10.1OSV
- flask-appbuilder, PyPI0.10.2OSV
- flask-appbuilder, PyPI0.10.3OSV
- flask-appbuilder, PyPI0.10.4OSV
- flask-appbuilder, PyPI0.10.5OSV
- flask-appbuilder, PyPI0.10.6OSV
- flask-appbuilder, PyPI0.10.7OSV
- flask-appbuilder, PyPI0.2.0OSV
- flask-appbuilder, PyPI0.2.1OSV
- flask-appbuilder, PyPI0.2.2OSV
- flask-appbuilder, PyPI0.3.0OSV
References 6
- github.com/dpgaspar/Flask-AppBuilder/commit/6336456d83f8f111c842b2b53d1e89627f2502c8Fixvia CVE List
- github.com/dpgaspar/Flask-AppBuilder/security/advisories/GHSA-j2pw-vp55-fqqjAdvisoryvia CVE List
- github.com/pypa/advisory-database/tree/main/vulns/flask-appbuilder/PYSEC-2026-340.yamlAdvisoryvia GitHub
- github.com/advisories/GHSA-j2pw-vp55-fqqjAdvisoryvia GitHub
- nvd.nist.gov/vuln/detail/CVE-2024-25128Referencevia GitHub
- pypi.org/project/flask-appbuilderReferencevia GitHub