CVE-2026-39963: Serendipity: Host Header Injection enables authentication cookie scoping to an attacker-controlled domain

Published Apr 14, 2026
·
Updated

Summary The serendipitysetCookie() function uses $SERVER['HTTPHOST'] 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/functionsconfig.inc.php:726: php function serendipitysetCookie($name, $value, $securebyprot = true, ...) { $host = $SERVER['HTTPHOST']; // ← 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: php // functionsconfig.inc.php:455-498 serendipitysetCookie('authorautologintoken', $rnd, true, false, true); serendipitysetCookie('authorusername', $user); serendipitysetCookie('authortoken', $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 bash curl -v -X POST \ -H "Host: attacker.com" \ -d "serendipity[user]=admin&serendipity[pass]=admin" \ http://[TARGET]/serendipityadmin.php 2>&1 | grep -i "set-cookie"

Expected output: http Set-Cookie: serendipity[authortoken]=; domain=attacker.com; HttpOnly

Impact - Session fixation — attacker pre-sets a cookie scoped to their domain, then tricks the victim into authenticating, inheriting the poisoned token - Token leakage — authorautologintoken scoped 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 HTTPHOST against the configured $serendipity['url'] before use: php function serendipitysetCookie($name, $value, ...) { global $serendipity; $configured = parseurl($serendipity['url'], PHPURLHOST); $host = pregreplace('/:[0-9]+$/', '', $SERVER['HTTPHOST']); $host = ($host === $configured) ? $host : $configured;

setcookie("serendipity[$name]", $value, [ 'domain' => $host, ... ]); }

Other sources

Serendipity is a PHP-powered weblog engine. In versions 2.6-beta2 and below, the serendipitysetCookie() function in include/functionsconfig.inc.php uses $SERVER['HTTPHOST'] without validation as the domain parameter of setcookie(). An attacker who can influence the Host header at login time, such as via MITM, reverse proxy misconfiguration, or load balancer manipulation, can force authentication cookies including session tokens and auto-login tokens to be scoped to an attacker-controlled domain. This enables session fixation, token leakage to attacker-controlled infrastructure, and privilege escalation if an admin logs in under a poisoned Host header. This issue has been fixed in version 2.6.0.

MITRE

Affected Software

3 affected componentsFixes available
composer/s9y/serendipity<2.6.0
2.6.0
S9Y Serendipity<2.6.0
S9Y Serendipity=2.6.0-beta1

Event History

Apr 14, 2026
Advisory Published
via GitHub·10:32 PM
Data Sourced
via GitHub·10:32 PM
DescriptionSeverityWeaknessAffected Software
CVE Published
via MITRE·11:31 PM
Data Sourced
via MITRE·11:31 PM
DescriptionSeverityWeakness
Apr 15, 2026
Data Sourced
via NVD·04:17 AM
DescriptionSeverityWeakness
Data Sourced
via NVD·04:17 AM
Affected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2026-39963?

CVE-2026-39963 is considered a high severity vulnerability due to its potential to allow attackers to hijack user sessions.

2

How do I fix CVE-2026-39963?

To fix CVE-2026-39963, upgrade to Serendipity version 2.6.0 or later where the vulnerability is patched.

3

What kind of attack can CVE-2026-39963 facilitate?

CVE-2026-39963 can facilitate session hijacking attacks by allowing an attacker to manipulate cookies sent to an attacker-controlled domain.

4

Which software is affected by CVE-2026-39963?

CVE-2026-39963 affects versions of the Serendipity blogging software prior to version 2.6.0.

5

What function is responsible for the vulnerability in CVE-2026-39963?

The vulnerability in CVE-2026-39963 originates from the `serendipity_setCookie()` function using `$_SERVER['HTTP_HOST']` without proper validation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203