efek.me/blog

PayTR WHMCS Module — 3 CVEs in Payment Gateway (CVE-2026-16272, CVE-2026-16025, CVE-2026-16037)

October 8, 2026•7 min read•Cybersecurity
PayTR WHMCS Module — 3 CVEs in Payment Gateway (CVE-2026-16272, CVE-2026-16025, CVE-2026-16037)

Overview

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ş:

#VulnerabilityCVECWECVSSResearcher
1Client IP SpoofingCVE-2026-16272CWE-3489.1 (Critical)Efe Kırbaş
2Improper Payment ValidationCVE-2026-16025CWE-12847.5 (High)Efe Kırbaş
3Callback Authentication Bypass via Timing AttackCVE-2026-16037CWE-2087.5 (High)Efe Kırbaş

CVE-2026-16272: Client IP Spoofing

File: paytr.php Routine: getUserIp() Parameter: HTTP_CLIENT_IP / HTTP_X_FORWARDED_FOR

Description

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.

IP Spoofing

Impact

Fraud detection and IP verification mechanisms are bypassed. Token generation occurs with an attacker-controlled IP address.

Remediation

// Use only REMOTE_ADDR
$ip = $_SERVER['REMOTE_ADDR'] ?? '0.0.0.0';

CVE-2026-16025: Improper Payment Validation

File: callback/paytr.php Routine: callback() Parameter: total_amount (POST)

Description

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.

Payment Amount Not Validated

Impact

An attacker can mark an invoice as fully paid with a partial or zero payment, causing direct financial loss.

Remediation

$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);

CVE-2026-16037: Callback Authentication Bypass via Timing Attack

File: callback/paytr.php Routine: callback() Parameter: hash (POST)

Description

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.

Timing Attack

Timing Analysis

Sent hashMatching charsResponse time
AAAAAAAAAA...0 chars0.31ms
dG9wYXR0...3 chars0.38ms
dG9wYXR0dG8...8 chars0.46ms
dG9wYXR0dG8hdHR...15 chars0.59ms
dG9wYXR0dG8hdHRY2s=FULL0.71ms ✓

Impact

An attacker can forge valid payment confirmation callbacks by recovering hash signatures via timing side-channels, enabling unauthorized invoice clearance without valid merchant credentials.

Remediation

// Use constant-time comparison to prevent timing attacks
if (!hash_equals($expected_md5, $md5_hash)) {
    http_response_code(400);
    exit 'INVALID HASH';
}

Timeline & Coordinated Disclosure

DateEvent
11 Jul 2026Vulnerabilities discovered by Efe Kırbaş
12 Aug 2026Reported to vendor (PayTR) under coordinated disclosure
9 Sep 20263 CVEs assigned to Efe Kırbaş (CVE-2026-16272, CVE-2026-16025, CVE-2026-16037)
9 Sep 2026v9.0.3 patch released by PayTR

Conclusion

This analysis demonstrates how security controls in a payment gateway module are interconnected:

  • IP Spoofing (Critical 9.1) → fraud detection bypass
  • Improper Payment Validation (High 7.5) → invoice marked as fully paid
  • Timing Attack (High 7.5) → HMAC hash extraction and authentication bypass

Each is dangerous on their own, but combined they form a complete payment bypass chain.


References