Skip to main content

PHP CVE-2026-33661

HIGH
Authentication Bypass by Spoofing (CWE-290)
2026-03-25 https://github.com/yansongda/pay
8.6
CVSS 3.1 · GitHub Advisory
View

Attack ChainAIDerived

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

  1. Access
    Craft HTTP request with Host: localhost header
  2. Delivery
    Send to WeChat Pay callback endpoint
  3. Exploit
    Bypass RSA signature verification
  4. Execution
    Forge payment success notification
  5. Impact
    Mark orders as paid without actual payment

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A07:2025 - Authentication Failures
ASVS 5.0
V6 - Authentication Anti-spoofing controls
MITRE ATT&CK

1 technique across 1 tactic: Defense Evasion

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Remote unauthenticated attacker sends HTTP request to WeChat Pay callback endpoint with Host: localhost header. Affects applications using vulnerable WeChat Pay SDK with verify_wechat_sign() function in src/Functions.php. No victim interaction required.

Impact

The CVSS 3.1 score of 8.6 (AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N) indicates a remotely exploitable vulnerability with low attack complexity requiring no privileges or user interaction, with changed scope and high integrity impact. However, real-world risk is significantly mitigated by common deployment architectures. The attack requires spoofing the Host header, which standard reverse proxies (Nginx, Apache), ingress controllers, CDNs (Cloudflare), and WAFs typically normalize or reject when they don't match the actual destination. The vendor explicitly acknowledges this protection layer in the advisory. While a proof-of-concept exists making the attack technically automatable, successful exploitation requires either direct access to the application server bypassing protective layers, or misconfigured infrastructure that forwards arbitrary Host headers. Organizations using properly configured reverse proxies face minimal risk, while those exposing PHP applications directly to the internet or with permissive proxy configurations face critical payment fraud risk. The vulnerability enables complete authentication bypass for payment callbacks, making it a priority fix for affected users despite environmental mitigations reducing widespread exploitation likelihood.

Exploit ScenarioDerived

An attacker identifies a merchant website using yansongda/pay for WeChat Pay integration and locates the payment callback endpoint (typically /payment/wechat/callback or similar). The attacker crafts a POST request to this endpoint including 'Host: localhost' along with a fake payment success notification containing their order ID, bypassing signature verification entirely. The merchant's application processes the forged callback as legitimate, marks the order as paid, and ships goods or grants service access without any actual payment occurring. A working proof-of-concept curl command demonstrating this attack is included in the advisory, making exploitation straightforward for attackers who can reach the endpoint directly or through misconfigured proxies.

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

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

Alert me

AnalysisAIv1 – Mar 25, 2026

The yansongda/pay PHP library contains an authentication bypass vulnerability that allows attackers to forge WeChat Pay payment notifications by including a 'Host: localhost' header in HTTP requests. The verify_wechat_sign() function unconditionally skips RSA signature verification when it detects localhost as the hostname, enabling attackers to send fake payment success callbacks that applications may process as legitimate transactions. A proof-of-concept exploit exists demonstrating the attack, though the vendor notes most production environments with properly configured reverse proxies, WAFs, or CDNs will reject forged Host headers, significantly reducing real-world exploitability.

RemediationAI

Upgrade yansongda/pay to version 3.7.20 or later, which addresses the authentication bypass as documented in the release notes at https://github.com/yansongda/pay/releases/tag/v3.7.20. The fix commit is available at https://github.com/yansongda/pay/commit/26987ebf789f1e7f0a85febb640986ab4289fd7f for review. Until patching is possible, implement strict Host header validation at the reverse proxy or application layer to ensure the Host header matches expected domain names and reject requests with localhost or unexpected values. Configure Nginx, Apache, or other reverse proxies to normalize Host headers and drop requests with spoofed values. As an additional defense-in-depth measure, implement IP allowlisting for WeChat Pay callback endpoints to accept notifications only from documented WeChat Pay server IP ranges, and consider implementing additional webhook authentication mechanisms such as shared secrets or request signing at the application layer.

Affected Packages

composer yansongda/pay fix: 3.7.20

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 affects the yansongda/pay Composer package (pkg:composer/yansongda_pay), a PHP library providing integration with WeChat Pay payment services. The flaw is rooted in CWE-290 (Authentication Bypass by Spoofing), where the verification logic in src/Functions.php trusts the attacker-controlled Host header from PSR-7 HTTP request objects. PSR-7 is a PHP standard for HTTP message interfaces, implemented by libraries like Nyholm and Guzzle, where the getUri()->getHost() method directly reads the Host header without validation. The vulnerable code path intended to skip verification during local development but failed to account for header spoofing in production environments, creating a logic flaw that completely bypasses the openssl_verify() RSA signature check that normally validates WeChat Pay's cryptographic signatures.

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

GitHub Advisory PRIMARY 8.6 HIGH
AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N

Primary rating from GitHub Advisory · only source for this CVE.

CVSS VectorGitHub Advisory

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

Lifecycle Timeline

2
Patch released
Mar 25, 2026 - 19:32 nvd
Patch available
CVE Published
Mar 25, 2026 - 19:30 nvd
HIGH 8.6

DescriptionGitHub Advisory

Summary

The verify_wechat_sign() function in src/Functions.php unconditionally skips all signature verification when the PSR-7 request reports localhost as the host. An attacker can exploit this by sending a crafted HTTP request to the WeChat Pay callback endpoint with a Host: localhost header, bypassing the RSA signature check entirely.

This allows forging fake WeChat Pay payment success notifications, potentially causing applications to mark orders as paid without actual payment.

Vulnerable Code

src/Functions.php lines 243-246:

php
function verify_wechat_sign(ResponseInterface|ServerRequestInterface $message, array $params): void
{
    // BYPASS: Returns without any signature check if Host header is localhost
    if ($message instanceof ServerRequestInterface && 'localhost' === $message->getUri()->getHost()) {
        return;  // No signature verified!
    }

    // ... openssl_verify() only reached when Host != localhost
    $wechatSerial = $message->getHeaderLine('Wechatpay-Serial');
    $sign = $message->getHeaderLine('Wechatpay-Signature');
    $result = 1 === openssl_verify($content, base64_decode($sign), $public, 'sha256WithRSAEncryption');
}

In PSR-7 implementations (Nyholm, Guzzle PSR-7, etc.), $request->getUri()->getHost() reads the Host HTTP header, which is fully attacker-controlled.

Proof of Concept

bash
curl -X POST https://merchant.example.com/payment/wechat/callback \
  -H "Host: localhost" \
  -H "Content-Type: application/json" \
  -H "Wechatpay-Serial: any" \
  -H "Wechatpay-Timestamp: 1234567890" \
  -H "Wechatpay-Nonce: abc" \
  -H "Wechatpay-Signature: AAAA" \
  -d '{"id":"fake-order","event_type":"TRANSACTION.SUCCESS"}'

verify_wechat_sign() returns immediately without verifying the signature. The application marks the order as paid.

Impact

  • Payment fraud: Attacker receives goods/services without actual payment by forging WeChat Pay callbacks
  • No authentication required: Pure network attack, zero privileges needed
  • Wide reach: Affects any application using yansongda/pay for WeChat Pay callback validation. However, in most environments, Nginx/Ingress/Cloudflare/WAF will directly reject the forgery of this request header, so there is no need to worry too much.

Executive ViewAI

Why It Matters

A critical authentication bypass in the yansongda/pay library could allow attackers to forge payment notifications and process fraudulent transactions if applications rely on this library for WeChat Pay integration. Organizations using this library in production environments face potential financial loss and customer trust damage, though properly configured network infrastructure significantly mitigates real-world risk.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible: (1) Configure reverse proxy or WAF to reject HTTP requests with 'Host: localhost' header; (2) Implement strict Host header validation at application layer; (3) Enable enhanced logging and monitoring on payment callback handlers; (4) Require mutual TLS authentication for payment notification endpoints; (5) Disable WeChat Pay integration if not actively used.

Threat Intelligence Overview

EPSS Score
0.1%
Top 68% exploitable
Data Quality
4 sources
Confidence: Medium
NVD CVE.org EPSS Vulnrichment 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.1%
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

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

Attack Technique

Authentication bypass attacks exploit flaws in the verification mechanisms that control access to systems and applications.

Affected Products (CPE)GitHub Advisory

pkg:composer/yansongda_pay

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