Skip to main content

Boteraser | Website and Server Security Solutions

🛡️ CVE-2026-39963 — serendipity

🟡 CVSS 6.9 — Medium ✅ No Known Exploit CWE-565 NVD
6.9
CVSS Score
0 Low4 Medium7 High9 Critical10

Description

Serendipity has a Host Header Injection allows authentication cookie scoping to attacker-controlled domain in functions_config.inc.php

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:

```php

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:

```php

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

```bash

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:

```http

Set-Cookie: serendipity[author_token]=; 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 leakageauthor_autologintoken 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 HTTP_HOST against the configured $serendipity['url'] before use:

```php

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,

...

]);

}

```

How this vulnerability can be exploited

This issue can be reached over the network, attack complexity is high, an attacker needs no privileges on the target. A user must be tricked into taking some action. The scope is changed, meaning a successful attack can affect components beyond the vulnerable one. Rated impact: confidentiality high, integrity low, availability none.

CVSS metrics in full

The score comes from this vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N

  • Attack vector: Network — reachable from anywhere that can route to the service.
  • Attack complexity: High — the attacker first has to win a race, learn a secret or otherwise prepare the target.
  • Privileges required: None — an unauthenticated stranger can try it.
  • User interaction: Required — someone has to click, open or visit something.
  • Scope: Changed — a successful attack reaches components beyond the vulnerable one.
  • Confidentiality impact: High — total loss, or loss the attacker controls.
  • Integrity impact: Low — limited, and the attacker does not choose what is affected.
  • Availability impact: None.

Weakness class

CVE-2026-39963 is classified as CWE-565: Reliance on Cookies without Validation. Security decisions are based on cookie values that the client can freely modify.

Affected software

CVE-2026-39963 is recorded against 2 packages.

  • s9y/serendipity (fixed in 2.6.0)
  • serendipity

Timeline and source

Published on 14 April 2026 and last revised on 15 April 2026. No public exploit is currently recorded for this entry. Record sourced from NVD.

References

github.com (Web)
nvd.nist.gov (Advisory)
github.com (Package)
github.com (Web)

Other advisories for this package

s9y/serendipity has other advisories on record. If you are patching this one, these are worth checking on the same host:

Same weakness in other software

These advisories are the same class of weakness (CWE-565: Reliance on Cookies without Validation) in other software:

Details

Severity Medium
CVSS Score 6.9
CVSS Vector CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:H/I:L/A:N
CWE CWE-565
Public Exploit ✅ No
Source NVD
Published 2026-04-14
Updated 2026-08-20
Modified 2026-04-15
Fix URL N/A

Affected Packages

Software From version Fixed in
s9y/serendipity 2.6.0
serendipity

Similar Threats

Vulnerability Monitoring

Track new vulnerabilities in serendipity

CVE-2026-39963 is rated CVSS 6.9 Medium. BotEraser monitors your WordPress installation and notifies you when software you use appears in our vulnerability database.

Set Up Free Alerts →

No credit card required  ·  Results in minutes

ⓘ Data Notice: The information presented above has been compiled from publicly available internet sources. Boteraser aggregates this data solely for informational purposes and does not independently classify, evaluate, or endorse any findings about the vulnerabilities listed. The accuracy and completeness of this information is the sole responsibility of the original publishers. Boteraser and its operators accept no liability for any decisions made based on this data.

Browse related advisories

All advisoriesCVECVE 2026