PHP
CVE-2026-39963
MEDIUM
Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconIntercept login request traffic
-
DeliveryInject attacker.com Host header
-
ExploitTrigger serendipity_setCookie() with poisoned domain
-
InstallSet-Cookie issued with domain=attacker.com
-
C2Admin credentials cached to wrong domain scope
-
ExecuteAttacker retrieves authentication token
-
ImpactSession hijacking achieved
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V3 - Web Frontend Security Cookie integrity validation
|
| Impact | CVSS 6.9 (AV:N/AC:H/PR:N/UI:R/S:C) with changed scope reflects moderate-to-high impact but higher attack complexity and user interaction requirement. Exploitation probability (EPSS 6.9) aligns with the CVSS assessment. The AC:H (high complexity) factor reflects the need for attacker control over the HTTP Host header, which requires MITM, reverse proxy misconfiguration, or load balancer compromise-realistic but not trivial in properly configured environments. UI:R (user interaction required) mandates that the victim must authenticate during the attack window, further reducing real-world exploitation likelihood in automated attack scenarios. However, the S:C (scope changed) and high confidentiality impact (C:H) indicate that successful exploitation compromises authentication boundaries and grants access to privileged accounts (admin tokens), making this a real priority for Serendipity deployments in untrusted networks or behind misconfigured reverse proxies. The existence of proof-of-concept code elevates practical risk slightly. Overall assessment: medium-priority vulnerability requiring patching in production environments, especially those accepting requests from untrusted upstream proxies or operating in shared hosting/CDN scenarios where Host header control is easier. |
| Exploit ScenarioDerived | An attacker positioned as a man-in-the-middle (or controlling a misconfigured reverse proxy) intercepts a Serendipity administrator's login request and injects Host: attacker.com into the HTTP headers. The serendipity_setCookie() function uses this poisoned Host header to set the author_token cookie with domain=attacker.com instead of the legitimate domain. When the administrator's browser sends subsequent requests to attacker.com, it automatically includes the stolen authentication token, granting the attacker authenticated access to the Serendipity admin panel. A proof-of-concept curl command demonstrates the vulnerability by triggering cookie domain poisoning via a POST to serendipity_admin.php with a crafted Host header. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Apr 15, 2026
Serendipity's serendipity_setCookie() function accepts unsanitized HTTP_HOST header values as the cookie domain parameter, allowing remote attackers to scope authentication cookies (session tokens, auto-login tokens) to attacker-controlled domains and facilitate session hijacking. The vulnerability requires user interaction (victim authentication during poisoned Host header) and man-in-the-middle or reverse proxy misconfiguration to exploit, affecting all versions of Serendipity that use the vulnerable function. A proof-of-concept demonstrating cookie domain poisoning exists; exploitation probability is moderate (EPSS 6.9, CVSS AC:H reflects attack complexity), and no evidence of active exploitation has been identified.
RemediationAI
Validate the HTTP_HOST header against the configured serendipity['url'] before using it as a cookie domain. The vendor-suggested fix (referenced in the CVE description) implements hostname parsing and comparison: extract the configured hostname using parse_url($serendipity['url'], PHP_URL_HOST), sanitize the HTTP_HOST header with preg_replace('/:[0-9]+$/', '', ...) to strip port numbers, and use the configured hostname if the request's Host header does not match. Apply the patch provided in the GitHub security advisory (https://github.com/advisories/GHSA-4m6c-649p-f6gf). Alternatively, implement a Content Security Policy and configure reverse proxies to validate and normalize Host headers before forwarding requests to Serendipity. Monitor for signs of session hijacking by reviewing cookie domains in browser developer tools and server logs for mismatched Host headers.
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in composer
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
Serendipity is a lightweight PHP blog engine. The vulnerability resides in the serendipity_setCookie() function (include/functions_config.inc.php:726), which directly uses the HTTP_HOST server variable-attacker-controllable in HTTP requests-as the domain parameter to PHP's setcookie() function without validation against the configured server hostname. The root cause (CWE-565: Reliance on Cookies without Validation and Integrity Checking) stems from trusting untrusted input (HTTP_HOST header) for security-critical cookie scope decisions. While the code does strip port numbers when securebyprot=true, this defensive measure is insufficient because the hostname itself remains unvalidated. The function sets cookies with httponly and samesite=Strict flags, which provide some mitigation, but the domain poisoning bypasses the intended audience of the cookie. Affected product: Serendipity (pkg:composer/s9y_serendipity) in versions prior to patching.
Know when PHP gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N
Primary rating from Vendor (https://github.com/s9y/Serendipity) · only source for this CVE.
CVSS VectorVendor: https://github.com/s9y/Serendipity
Lifecycle Timeline
2DescriptionCVE.org
Summary
The serendipity_setCookie() function uses $_SERVER['HTTP_HOST'] without validation as the domain parameter of setcookie(). An attacker can force authentication cookies - including session tokens and auto-login tokens - to be scoped to an attacker-controlled domain, facilitating session hijacking.
Details
In include/functions_config.inc.php:726:
function serendipity_setCookie($name, $value, $securebyprot = true, ...) {
$host = $_SERVER['HTTP_HOST']; // ← attacker-controlled, no validation
if ($securebyprot) {
if ($pos = strpos($host, ":")) {
$host = substr($host, 0, $pos); // strips port only
}
}
setcookie("serendipity[$name]", $value, [
'domain' => $host, // ← poisoned domain
'httponly' => $httpOnly,
'samesite' => 'Strict'
]);
}This function is called during login with sensitive cookies:
// functions_config.inc.php:455-498
serendipity_setCookie('author_autologintoken', $rnd, true, false, true);
serendipity_setCookie('author_username', $user);
serendipity_setCookie('author_token', $hash);If an attacker can influence the Host header at login time (e.g. via MITM, reverse proxy misconfiguration, or load balancer), authentication cookies are issued scoped to the attacker's domain instead of the legitimate one.
PoC
curl -v -X POST \
-H "Host: attacker.com" \
-d "serendipity[user]=admin&serendipity[pass]=admin" \
http://[TARGET]/serendipity_admin.php 2>&1 | grep -i "set-cookie"Expected output:
Set-Cookie: serendipity[author_token]=; domain=attacker.com; HttpOnlyImpact
- Session fixation - attacker pre-sets a cookie scoped to their domain, then tricks the victim into authenticating, inheriting the poisoned token
- Token leakage -
author_autologintokenscoped to wrong domain may be sent to attacker-controlled infrastructure - Privilege escalation - if admin logs in under a poisoned Host header, their admin token is compromised
Suggested Fix
Validate HTTP_HOST against the configured $serendipity['url'] before use:
function serendipity_setCookie($name, $value, ...) {
global $serendipity;
$configured = parse_url($serendipity['url'], PHP_URL_HOST);
$host = preg_replace('/:[0-9]+$/', '', $_SERVER['HTTP_HOST']);
$host = ($host === $configured) ? $host : $configured;
setcookie("serendipity[$name]", $value, [
'domain' => $host,
...
]);
}Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Affected Products (CPE)CVE.org
In PHP versions 7.1.x below 7.1.33, 7.2.x below 7.2.24 and 7.3.x below 7.3.11 in certain configurations of FPM setup it
sapi/cgi/cgi_main.c in PHP before 5.3.12 and 5.4.x before 5.4.2, when configured as a CGI script (aka php-cgi), does not
(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear
The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by
ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C
Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au
Util/PHP/eval-stdin.php in PHPUnit before 4.8.28 and 5.x before 5.6.3 allows remote attackers to execute arbitrary PHP c
Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re
The get_referers function in /opt/ws/bin/sblistpack in Sophos Web Appliance before 3.7.9.1 and 3.8 before 3.8.1.1 allows
The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1
GHSA-4m6c-649p-f6gf
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB