# CVE-2024-21641: Flarum's Logout Route allows open redirects

> Attackers can redirect users from a trusted Flarum domain to malicious sites via the logout route, potentially facilitating phishing or spam campaigns.

- **Severity:** Medium 6.5 (`CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 5 Jan 2024
- **Updated:** 3 Jun 2025
- **Also known as:** GHSA-733r-8xcp-w9mr

## What is CVE-2024-21641?

CVE-2024-21641 is a medium-severity vulnerability in flarum framework, published on 5 Jan 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

Flarum is open source discussion platform software. Prior to version 1.8.5, the Flarum `/logout` route includes a redirect parameter that allows any third party to redirect users from a (trusted) domain of the Flarum installation to redirect to any link. For logged-in users, the logout must be confirmed. Guests are immediately redirected. This could be used by spammers to redirect to a web address using a trusted domain of a running Flarum installation. The vulnerability has been fixed and published as flarum/core v1.8.5. As a workaround, some extensions modifying the logout route can remedy this issue if their implementation is safe.

Weakness: CWE-601 (URL Redirection to Untrusted Site)

## Which versions are affected by CVE-2024-21641?

4 open source packages ship an affected version, including flarum/framework and flarum/core. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `flarum/framework` | Packagist | All versions | 1.8.5 |
| `flarum/framework` | Packagist | All versions | 1.8.5 |
| `flarum/core` | Packagist | All versions | 1.8.5 |
| `flarum/core` | Packagist | All versions | 1.8.5 |

Products: Flarum Flarum.

## How do I fix CVE-2024-21641?

Upgrade flarum/framework to 1.8.5 or later.

## Is CVE-2024-21641 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21641 exists.

Public exploit code:

- Flarum < 1.8.5 - Open Redirect (nuclei): http/cves/2024/CVE-2024-21641.yaml

## Other vulnerabilities in flarum framework

- [CVE-2021-32671](https://insights.sbomify.com/CVE-2021-32671/): XSS vulnerability with translator (critical 10.0)
- [CVE-2022-41938](https://insights.sbomify.com/CVE-2022-41938/): Cross site scripting vulnerability with discussion titles in flarum (critical 9.0)
- [CVE-2019-13183](https://insights.sbomify.com/CVE-2019-13183/): Cross-site request forgery in n/a (high 8.8)
- [CVE-2023-22487](https://insights.sbomify.com/CVE-2023-22487/): Post mentions can be used to read any post on the forum without access control (high 7.7)
- [CVE-2019-11514](https://insights.sbomify.com/CVE-2019-11514/): Flarum mishandles invalidation of user email tokens (high 7.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-21641 and fix it if it is affected.

What it is: CVE-2024-21641 is a medium-severity vulnerability in flarum framework, published on 5 Jan 2024. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: It is not confirmed as exploited in the wild, but public exploit code for CVE-2024-21641 exists.

Affected packages and fixed versions:
- flarum/framework (Packagist): affected all versions; fixed in 1.8.5
- flarum/framework (Packagist): affected all versions; fixed in 1.8.5
- flarum/core (Packagist): affected all versions; fixed in 1.8.5
- flarum/core (Packagist): affected all versions; fixed in 1.8.5

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-21641/ (Markdown: https://insights.sbomify.com/CVE-2024-21641/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-21641
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-21641
- OSV: https://osv.dev/vulnerability/CVE-2024-21641

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-21641/
Summaries are generated and may contain mistakes; the official description above is the record.
