
During a security assessment of the PayTR Virtual Pos iFrame API WHMCS payment gateway module (v9.0.0), I discovered and responsibly reported 3 security vulnerabilities that were officially validated and assigned CVE identifiers credited to Efe Kırbaş:
| # | Vulnerability | CVE | CWE | CVSS | Researcher |
|---|---|---|---|---|---|
| 1 | Client IP Spoofing | CVE-2026-16272 | CWE-348 | 9.1 (Critical) | Efe Kırbaş |
| 2 | Improper Payment Validation | CVE-2026-16025 | CWE-1284 | 7.5 (High) | Efe Kırbaş |
| 3 | Callback Authentication Bypass via Timing Attack | CVE-2026-16037 | CWE-208 | 7.5 (High) | Efe Kırbaş |
File: paytr.php
Routine: getUserIp()
Parameter: HTTP_CLIENT_IP / HTTP_X_FORWARDED_FOR
The getUserIp() method checks HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR headers to determine the client IP address. Since these headers can be freely manipulated by the client, an attacker can spoof the user_ip parameter in the token generation request. The token generation includes this value in the HMAC-SHA256 calculation, bypassing fraud detection and IP verification mechanisms.

Fraud detection and IP verification mechanisms are bypassed. Token generation occurs with an attacker-controlled IP address.
// Use only REMOTE_ADDR
$ip = $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0';
File: callback/paytr.php
Routine: callback()
Parameter: total_amount (POST)
The payment callback handler validates the HMAC-SHA256 signature but does not compare the total_amount value against the WHMCS invoice total. The addInvoicePayment() call is made with an empty amount parameter, causing WHMCS to mark the invoice as fully paid regardless of the actual payment amount.

An attacker can mark an invoice as fully paid with a partial or zero payment, causing direct financial loss.
$invoice = localAPI('GetInvoice', ['invoiceid' => $invoice_id]);
if ((float)$total_amount < (float)$invoice['total']) {
logTransaction($gatewayModuleName, $total_amount, 'Partial payment detected');
exit;
}
addInvoicePayment($invoice_id, $merchant_oid, $total_amount, '', $gatewayModuleName);
File: callback/paytr.php
Routine: callback()
Parameter: hash (POST)
The callback handler verifies the incoming HMAC-SHA256 signature using PHP's standard equality operator (!=). Standard string comparison terminates early on the first mismatched byte, creating measurable execution time differences proportional to the number of correctly guessed characters. An attacker can perform statistical timing analysis over high-frequency automated requests to extract the valid signature character-by-character, completely bypassing callback authentication.

| Sent hash | Matching chars | Response time |
|---|---|---|
| AAAAAAAAAA... | 0 chars | 0.31ms |
| dG9wYXR0... | 3 chars | 0.38ms |
| dG9wYXR0dG8... | 8 chars | 0.46ms |
| dG9wYXR0dG8hdHR... | 15 chars | 0.59ms |
| dG9wYXR0dG8hdHRY2s= | FULL | 0.71ms ✓ |
An attacker can forge valid payment confirmation callbacks by recovering hash signatures via timing side-channels, enabling unauthorized invoice clearance without valid merchant credentials.
// Use constant-time comparison to prevent timing attacks
if (!hash_equals($expected_md5, $md5_hash)) {
http_response_code(400);
exit 'INVALID HASH';
}
| Date | Event |
|---|---|
| 11 Jul 2026 | Vulnerabilities discovered by Efe Kırbaş |
| 12 Aug 2026 | Reported to vendor (PayTR) under coordinated disclosure |
| 9 Sep 2026 | 3 CVEs assigned to Efe Kırbaş (CVE-2026-16272, CVE-2026-16025, CVE-2026-16037) |
| 9 Sep 2026 | v9.0.3 patch released by PayTR |
This analysis demonstrates how security controls in a payment gateway module are interconnected:
Each is dangerous on their own, but combined they form a complete payment bypass chain.