Pay
WeChat Pay callback signature verification bypassed when Host header is localhost
Pay is an open-source payment SDK extension package for various Chinese payment services. Prior to version 3.7.20, 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. Version 3.7.20 fixes the issue.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.7.20
Fixed in 3.7.20
Mitigation
Upgrade pay to 3.7.20 or later.
References
- Vendor advisory github.com/yansongda/pay/security/advisories/G…
- Patch github.com/yansongda/pay/commit/26987ebf789f1e…
- Release notes github.com/yansongda/pay/releases/tag/v3.7.20
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.