CVE-2026-33661: Yansongda/pay WeChat Pay Callback Signature Verification Vulnerability
HIGHCVE-2026-33661 is a HIGH (CVSS 8.6) wechat pay callback signature verification vulnerability (CWE-290: Authentication Bypass by Spoofing) affecting Yansongda/pay libraries in the Packagist ecosystem. The issue involves wechat pay callback signature verification bypassed when host header is localhost. Remediation is available by upgrading affected packages to version 3.7.20.
CVE-2026-33661 at a Glance
Security Impact
CVSS: 8.6
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:N/I:H/A:N).
How to Fix CVE-2026-33661
To remediate this vulnerability, upgrade all affected Yansongda/pay 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 yansongda/pay to 3.7.20
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for yansongda/pay
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-33661, inspect your project dependencies for Yansongda/pay:
inspect dependencies for yansongda/pay
Analyze the terminal output to locate any version of Yansongda/pay in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.7.20), 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-290: Authentication Bypass by Spoofing, where this attack-focused weakness is caused by incorrectly implemented authentication schemes that are subject to spoofing attacks. In Yansongda/pay, 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-33661 Affected Yansongda/pay Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
yansongda/pay
|
Packagist |
< 3.7.20
|
3.7.20
|
References
Frequently Asked Questions
What is CVE-2026-33661?
Which Yansongda/pay versions are affected?
What version fixes CVE-2026-33661?
Is yansongda/pay affected?
What is the CVSS score of CVE-2026-33661?
What CWE is associated with CVE-2026-33661?
How can I check Packagist dependencies for CVE-2026-33661?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-q938-ghwv-8gvc",
"modified" : "2026-03-27T22:10:51Z",
"published" : "2026-03-25T19:30:09Z",
"aliases" : [ "CVE-2026-33661" ],
"summary" : "WeChat Pay callback signature verification bypassed when Host header is localhost",
"details" : "## Summary\n\nThe `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.\n\nThis allows forging fake WeChat Pay payment success notifications, potentially causing applications to mark orders as paid without actual payment.\n\n## Vulnerable Code\n\n**`src/Functions.php` lines 243-246:**\n```php\nfunction verify_wechat_sign(ResponseInterface|ServerRequestInterface $message, array $params): void\n{\n // BYPASS: Returns without any signature check if Host header is localhost\n if ($message instanceof ServerRequestInterface && 'localhost' === $message->getUri()->getHost()) {\n return; // No signature verified!\n }\n\n // ... openssl_verify() only reached when Host != localhost\n $wechatSerial = $message->getHeaderLine('Wechatpay-Serial');\n $sign = $message->getHeaderLine('Wechatpay-Signature');\n $result = 1 === openssl_verify($content, base64_decode($sign), $public, 'sha256WithRSAEncryption');\n}\n```\n\nIn PSR-7 implementations (Nyholm, Guzzle PSR-7, etc.), `$request->getUri()->getHost()` reads the `Host` HTTP header, which is fully attacker-controlled.\n\n## Proof of Concept\n\n```bash\ncurl -X POST https://merchant.example.com/payment/wechat/callback \\\n -H \"Host: localhost\" \\\n -H \"Content-Type: application/json\" \\\n -H \"Wechatpay-Serial: any\" \\\n -H \"Wechatpay-Timestamp: 1234567890\" \\\n -H \"Wechatpay-Nonce: abc\" \\\n -H \"Wechatpay-Signature: AAAA\" \\\n -d '{\"id\":\"fake-order\",\"event_type\":\"TRANSACTION.SUCCESS\"}'\n```\n\n`verify_wechat_sign()` returns immediately without verifying the signature. The application marks the order as paid.\n\n## Impact\n\n- **Payment fraud**: Attacker receives goods/services without actual payment by forging WeChat Pay callbacks\n- **No authentication required**: Pure network attack, zero privileges needed\n- **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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:H/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Packagist",
"name" : "yansongda/pay"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "3.7.20"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 3.7.19"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/yansongda/pay/security/advisories/GHSA-q938-ghwv-8gvc"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-33661"
}, {
"type" : "WEB",
"url" : "https://github.com/yansongda/pay/commit/26987ebf789f1e7f0a85febb640986ab4289fd7f"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/yansongda/pay"
}, {
"type" : "WEB",
"url" : "https://github.com/yansongda/pay/releases/tag/v3.7.20"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-290" ],
"severity" : "HIGH",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-25T19:30:09Z",
"nvd_published_at" : "2026-03-26T22:16:29Z"
}
}