# CVE-2024-25128: Flask-AppBuilder vulnerable to incorrect authentication when using auth type OpenID

Source: https://junglewise.ai/threats/cve-2024-25128-flask-appbuilder-vulnerable-to-incorrect-authentication-when  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2024-02-28  
License: CC BY 4.0 with a link back

CVE-2024-25128 · Severity: critical · CVSS 9.1 · Published 2024-02-28

### 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"
```

Technologies: [flask-appbuilder (PyPI)](https://junglewise.ai/threats/technologies/flask-appbuilder). Vendors: [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2024-25128 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2024-25128 being exploited in the wild.

**How severe is CVE-2024-25128?** Critical severity, with a CVSS score of 9.1, published 28 February 2024.

**Which products and versions are affected?** flask-appbuilder (PyPI) < 4.3.11, ECOSYSTEM:introduced=0,fixed=4.3.11.

**Is there a fix for CVE-2024-25128?** Yes. flask-appbuilder (PyPI): upgrade to 4.3.11 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2024-25128?** Check whether you run flask-appbuilder (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- flask-appbuilder (PyPI): upgrade to 4.3.11 or later

  ```sh
  pip install "flask-appbuilder>=4.3.11"
  ```


## Affected products

- flask-appbuilder (PyPI) < 4.3.11, ECOSYSTEM:introduced=0,fixed=4.3.11

## Identifiers

- CVE-2024-25128
- GHSA-j2pw-vp55-fqqj
- PYSEC-2026-340

## Related threats

- [PYSEC-2026-1378 - Flask App Builder has an Authentication Bypass vulnerability when using non AUTH_DB methods](https://junglewise.ai/threats/cve-2025-58065-flask-app-builder-has-an-authentication-bypass-vulnerability-when)
- [PYSEC-2026-1379 - Flask-AppBuilder open redirect vulnerability using HTTP host injection](https://junglewise.ai/threats/cve-2025-32962-flask-appbuilder-open-redirect-vulnerability-using-http-host)
- [PYSEC-2026-1382 - Flask-AppBuilder's login form allows browser to cache sensitive fields](https://junglewise.ai/threats/cve-2024-45314-flask-appbuilder-s-login-form-allows-browser-to-cache-sensitive)
- [PYSEC-2026-1381 - Flask-AppBuilder's OAuth login page subject to Cross Site Scripting (XSS)](https://junglewise.ai/threats/cve-2024-27083-flask-appbuilder-s-oauth-login-page-subject-to-cross-site)
- [PYSEC-2026-1380 - Flask-AppBuilder Has No Rate Limiting on Login AUTH DB](https://junglewise.ai/threats/cve-2023-29005-flask-appbuilder-has-no-rate-limiting-on-login-auth-db)
