CVE-2025-27794: Flarum/core Flarum Vulnerable To Session Hijacking Vulnerability
MODERATECVE-2025-27794 is a MODERATE (CVSS 6.8) flarum vulnerable to session hijacking vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Flarum/core libraries in the Packagist ecosystem. The issue involves flarum vulnerable to session hijacking via authoritative subdomain cookie overwrite. Remediation is available by upgrading affected packages to version 1.8.10.
CVE-2025-27794 at a Glance
Security Impact
CVSS: 6.8
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N).
How to Fix CVE-2025-27794
To remediate this vulnerability, upgrade all affected Flarum/core dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade flarum/core to 1.8.10
Upgrade flarum/framework to 1.8.10
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for flarum/core
How to Check if You Are Affected
To determine whether your application is affected by CVE-2025-27794, inspect your project dependencies for Flarum/core:
inspect dependencies for flarum/core
Analyze the terminal output to locate any version of Flarum/core in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.8.10), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Flarum/core, 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-2025-27794 Affected Flarum/core Versions
2 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
flarum/core
|
Packagist |
< 1.8.10
|
1.8.10
|
|
flarum/framework
|
Packagist |
< 1.8.10
|
1.8.10
|
References
Frequently Asked Questions
What is CVE-2025-27794?
Which Flarum/core versions are affected?
What version fixes CVE-2025-27794?
Is flarum/core affected?
Is flarum/framework affected?
What is the CVSS score of CVE-2025-27794?
What CWE is associated with CVE-2025-27794?
How can I check Packagist dependencies for CVE-2025-27794?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-hg9j-64wp-m9px",
"modified" : "2025-03-12T22:06:16Z",
"published" : "2025-03-12T22:06:16Z",
"aliases" : [ "CVE-2025-27794" ],
"summary" : "Flarum Vulnerable to Session Hijacking via Authoritative Subdomain Cookie Overwrite",
"details" : "## **Summary** \nA session hijacking vulnerability exists when an attacker-controlled **authoritative subdomain** under a parent domain (e.g., `subdomain.host.com`) sets cookies scoped to the parent domain (`.host.com`). This allows session token replacement for applications hosted on sibling subdomains (e.g., `community.host.com`) if session tokens aren't rotated post-authentication. \n\n**Key Constraints**: \n- Attacker must control **any subdomain** under the parent domain (e.g., `evil.host.com` or `x.y.host.com`). \n- Parent domain must **not** be on the [Public Suffix List](https://publicsuffix.org/).\n\nDue to non-existent session token rotation after authenticating we can theoretically reproduce the vulnerability by using browser dev tools, but due to the browser's security measures this does not seem to be exploitable as described.\n\n---\n\n## **Proof of Concept (Deno)** \n```ts\nDeno.serve({\n port: 8000, // default\n hostname: 'localhost',\n onListen: (o) => console.log(`Server started at http://${o.hostname}:${o.port}`, o),\n },\n async (req) => (console.log(req), new Response(\n `You've been served! You came from ${req.headers.get('referer')}`,\n {\n //status: 302, // would redirect user to page they came from\n status: 200,\n headers: {\n 'set-cookie': 'session_cookie=mytoken; Domain=.deno.dev; Secure; HttpOnly',\n 'location': req.headers.get('referer')\n }\n }\n ))\n);\n```\n\n### **Attack Flow** \n1. **Attacker Setup**: Hosts server at `evil.host.com`.\n2. **Harvest Session Token**: Attacker visits `community.host.com` to get a session token for himself to replace the victim's token with his own.\n3. **Victim Interaction**: User clicks link to `https://evil.host.com`. \n4. **Cookie Override**: Server sets cookie with `Domain=.host.com` and the harvested token from step 2. \n5. **Session Hijacking**: Victim's future requests to `community.host.com` use attacker's token. \n\n---\n\n## **Why Reverse DNS Subdomains Fail** \nBrowsers block cookie setting for parent domains unless: \n1. **Authoritative Subdomain**: Server must belong to a direct child domain (e.g., `a.host.com`, not `x.y.host.com`). \n2. **Public Suffix Exclusion**: If `host.com` is on the Public Suffix List (e.g., like `github.io`), browsers block cross-subdomain cookies. \n\n**Example**: \n- ❌ `123.cust.dynamic.host.com` → Cannot set `Domain=.host.com`. \n- ✅ `evil.host.com` → Can set `Domain=.host.com` (if not on PSL). \n\n---\n\n## **Browser Security Behavior** \n### 1. **Cookie Domain Validation** \nPer [RFC 6265 §5.3](https://datatracker.ietf.org/doc/html/rfc6265#section-5.3): \n> Cookies can only be set for domains the server is authoritative for. \n\n### 2. **Public Suffix List (PSL)** \nDomains like `host.com` on the PSL trigger browser protections: \n> Subdomains of PSL-listed domains cannot set cookies for parent domains. \n\n**Verification**: \n- Check PSL status: https://publicsuffix.org/list/ \n\n---\n\n## **Impact** \n- **Account Takeover**: Attacker gains authenticated session access.\n- **Data Exposure**: Email, private messages, and other personal data exposed.\n- **Exploitable Only If**: \n - Parent domain is **not** PSL-listed. \n - Attacker controls **direct child subdomain** (e.g., `evil.host.com`). \n\n---\n\n## **Remediation** \n1. **Session Token Rotation**: \n ```ts\n // After authentication:\n invalidateOldSession();\n const newToken = generateToken();\n ```\n2. **Cookie Scoping (already in place)**: \n ```ts\n // Restrict cookies to explicit subdomain:\n \"Set-Cookie\": \"session=token; Domain=community.host.com; Secure; HttpOnly; SameSite=Lax\";\n ```\n3. **Public Suffix Registration**: \n Add `host.com` to the Public Suffix List via [PSL Submission](https://publicsuffix.org/submit/). \n\n---\n\n## **Revised Vulnerability Criteria** \n**Prerequisites**: \n- Attacker controls authoritative subdomain (e.g., `evil.host.com`). \n- Parent domain (`host.com`) is **not** PSL-listed. \n- Session tokens persist post-authentication. \n\n---\n\n## **References** \n- [RFC 6265: HTTP Cookie Handling](https://tools.ietf.org/html/rfc6265) \n- [Public Suffix List](https://publicsuffix.org/)",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "flarum/core"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.10"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Packagist",
"name" : "flarum/framework"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.8.10"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/flarum/framework/security/advisories/GHSA-hg9j-64wp-m9px"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-27794"
}, {
"type" : "WEB",
"url" : "https://github.com/flarum/framework/commit/a05aaea3ee1e0a8b870935183193cd6052f1d402"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/flarum/framework"
}, {
"type" : "WEB",
"url" : "https://github.com/flarum/framework/releases/tag/v1.8.10"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-74" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2025-03-12T22:06:16Z",
"nvd_published_at" : "2025-03-12T14:15:17Z"
}
}