Update codebase

This commit is contained in:
Hamza-Ayed
2026-08-09 16:56:13 +03:00
parent 95e2e4f35d
commit b64debaa88
1058 changed files with 164327 additions and 113928 deletions
+12 -3
View File
@@ -156,7 +156,9 @@ class JwtService
// 3. Issuer (Only check if configured)
if (!empty($this->issuer) && ($decoded->iss ?? '') !== $this->issuer) {
self::abort(401, 'Invalid token issuer: expected ' . $this->issuer . ' but got ' . ($decoded->iss ?? 'none'));
// التفاصيل في اللوج فقط — لا تُكشف في الرد.
error_log('[SECURITY] Issuer mismatch | expected: ' . $this->issuer . ' | got: ' . ($decoded->iss ?? 'none'));
self::abort(401, 'Invalid token issuer');
}
// 3.1 App Signature Verification (Service Only)
@@ -228,8 +230,15 @@ class JwtService
}
if ($fpInToken === null || $fpHeader === null) {
$allHeaders = json_encode(getallheaders());
error_log("[SECURITY] Fingerprint missing | user: $userId | fpInToken: " . ($fpInToken ?? 'NULL') . " | fpHeader: " . ($fpHeader ?? 'NULL') . " | Headers: $allHeaders");
// ملاحظة: ممنوع تسجيل الهيدرز كاملة — كانت تُسرّب الـ
// Authorization: Bearer <token> بالنص الصريح إلى error_log.
// نسجّل فقط أيّ الطرفين ناقص، دون أي قيمة.
error_log(sprintf(
"[SECURITY] Fingerprint missing | user: %s | inToken: %s | inHeader: %s",
$userId,
$fpInToken === null ? 'no' : 'yes',
$fpHeader === null ? 'no' : 'yes'
));
self::abort(403, 'Device verification required');
}