CVE-2025-27794: Flarum/core Flarum Vulnerable To Session Hijacking Vulnerability

MODERATE
Advisory Identifier: GHSA-hg9j-64wp-m9px
CVSS 6.8
CWE-74
Published
Advisory Summary

CVE-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

CVE Identifier CVE-2025-27794
GHSA Identifier GHSA-hg9j-64wp-m9px
Severity MODERATE
CVSS v3.1 Base Score 6.8
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Flarum/core
Package Ecosystem Packagist
Published Date
Last Updated

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).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability None (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.

flarum/core fixed: 1.8.10
Upgrade flarum/core to 1.8.10
flarum/framework fixed: 1.8.10
Upgrade flarum/framework to 1.8.10
Verify Direct and Transitive Dependencies

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

## **Summary** A 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. **Key Constraints**: - Attacker must control **any subdomain** under the parent domain (e.g., `evil.host.com` or `x.y.host.com`). - Parent domain must **not** be on the [Public Suffix List](https://publicsuffix.org/). Due 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. --- ## **Proof of Concept (Deno)** ```ts Deno.serve({ port: 8000, // default hostname: 'localhost', onListen: (o) => console.log(`Server started at http://${o.hostname}:${o.port}`, o), }, async (req) => (console.log(req), new Response( `You've been served! You came from ${req.headers.get('referer')}`, { //status: 302, // would redirect user to page they came from status: 200, headers: { 'set-cookie': 'session_cookie=mytoken; Domain=.deno.dev; Secure; HttpOnly', 'location': req.headers.get('referer') } } )) ); ``` ### **Attack Flow** 1. **Attacker Setup**: Hosts server at `evil.host.com`. 2. **Harvest Session Token**: Attacker visits `community.host.com` to get a session token for himself to replace the victim's token with his own. 3. **Victim Interaction**: User clicks link to `https://evil.host.com`. 4. **Cookie Override**: Server sets cookie with `Domain=.host.com` and the harvested token from step 2. 5. **Session Hijacking**: Victim's future requests to `community.host.com` use attacker's token. --- ## **Why Reverse DNS Subdomains Fail** Browsers block cookie setting for parent domains unless: 1. **Authoritative Subdomain**: Server must belong to a direct child domain (e.g., `a.host.com`, not `x.y.host.com`). 2. **Public Suffix Exclusion**: If `host.com` is on the Public Suffix List (e.g., like `github.io`), browsers block cross-subdomain cookies. **Example**: - ❌ `123.cust.dynamic.host.com` → Cannot set `Domain=.host.com`. - ✅ `evil.host.com` → Can set `Domain=.host.com` (if not on PSL). --- ## **Browser Security Behavior** ### 1. **Cookie Domain Validation** Per [RFC 6265 §5.3](https://datatracker.ietf.org/doc/html/rfc6265#section-5.3): > Cookies can only be set for domains the server is authoritative for. ### 2. **Public Suffix List (PSL)** Domains like `host.com` on the PSL trigger browser protections: > Subdomains of PSL-listed domains cannot set cookies for parent domains. **Verification**: - Check PSL status: https://publicsuffix.org/list/ --- ## **Impact** - **Account Takeover**: Attacker gains authenticated session access. - **Data Exposure**: Email, private messages, and other personal data exposed. - **Exploitable Only If**: - Parent domain is **not** PSL-listed. - Attacker controls **direct child subdomain** (e.g., `evil.host.com`). --- ## **Remediation** 1. **Session Token Rotation**: ```ts // After authentication: invalidateOldSession(); const newToken = generateToken(); ``` 2. **Cookie Scoping (already in place)**: ```ts // Restrict cookies to explicit subdomain: "Set-Cookie": "session=token; Domain=community.host.com; Secure; HttpOnly; SameSite=Lax"; ``` 3. **Public Suffix Registration**: Add `host.com` to the Public Suffix List via [PSL Submission](https://publicsuffix.org/submit/). --- ## **Revised Vulnerability Criteria** **Prerequisites**: - Attacker controls authoritative subdomain (e.g., `evil.host.com`). - Parent domain (`host.com`) is **not** PSL-listed. - Session tokens persist post-authentication. --- ## **References** - [RFC 6265: HTTP Cookie Handling](https://tools.ietf.org/html/rfc6265) - [Public Suffix List](https://publicsuffix.org/)

CVE-2025-27794 Affected Flarum/core Versions

2 component(s)
Fixed Versions:
1.8.10
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?
CVE-2025-27794 is a security vulnerability in Flarum/core involving Flarum Vulnerable to Session Hijacking via Authoritative Subdomain Cookie Overwrite under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Flarum/core versions are affected?
Affected versions include releases prior to 1.8.10 across affected packages: flarum/core, flarum/framework.
What version fixes CVE-2025-27794?
Upgrading to 1.8.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is flarum/core affected?
Yes, flarum/core is affected in releases prior to 1.8.10. Upgrade your dependency to 1.8.10 or later.
Is flarum/framework affected?
Yes, flarum/framework is affected in releases prior to 1.8.10. Upgrade your dependency to 1.8.10 or later.
What is the CVSS score of CVE-2025-27794?
CVE-2025-27794 has a CVSS v3.1 base score of 6.8 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:N.
What CWE is associated with CVE-2025-27794?
CVE-2025-27794 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (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.).
How can I check Packagist dependencies for CVE-2025-27794?
Run the dependency tree command: 'inspect dependencies for flarum/core'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "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"
  }
}