A flaw was found in Keycloak. This access control vulnerability in Keycloak's OpenID Connect (OIDC) token introspection endpoint allows a confidential client to bypass audience restrictions. An attacker-controlled client with valid credentials can retrieve sensitive token claims intended for other resource servers, compromising the confidentiality of lightweight access tokens. This issue can be exploited remotely by any confidential client in the realm with valid credentials.
A critical access control vulnerability in Keycloak's OIDC token introspection endpoint allows confidential clients to bypass audience restrictions and access sensitive token claims intended for other resource servers. This vulnerability can be exploited remotely by any authenticated confidential client in the realm, potentially compromising token confidentiality across integrated systems. The lack of available patches makes immediate compensating controls essential for Saudi organizations relying on Keycloak for identity and access management.
IMMEDIATE ACTIONS:
1. Audit all Keycloak instances in your environment to identify token introspection endpoint usage and confidential client configurations
2. Review access logs for suspicious token introspection requests from confidential clients accessing tokens outside their intended audience
3. Implement network segmentation to restrict token introspection endpoint access to trusted clients only
4. Enable detailed audit logging for all token introspection requests including client ID, requested token claims, and timestamps
COMPENSATING CONTROLS (until patch available):
5. Implement API gateway or WAF rules to validate audience claims before allowing token introspection responses
6. Restrict token introspection endpoint access via IP whitelisting to known resource servers only
7. Implement rate limiting on token introspection endpoints to detect anomalous access patterns
8. Deploy additional authorization checks at resource server level to validate token audience claims independently
9. Rotate credentials for all confidential clients and implement stricter credential management policies
10. Monitor for CVE-2026-37979 patch releases from Keycloak project and apply immediately upon availability
DETECTION RULES:
- Alert on token introspection requests where requested_token_audience does not match client_id
- Monitor for single confidential client accessing introspection endpoint for multiple different audiences
- Flag introspection requests returning claims for audiences outside the requesting client's scope
- Track failed audience validation attempts at resource server level
الإجراءات الفورية:
1. تدقيق جميع نوى Keycloak في بيئتك لتحديد استخدام نقطة نهاية فحص الرموز وتكوينات العملاء السريين
2. مراجعة سجلات الوصول للطلبات المريبة لفحص الرموز من العملاء السريين الذين يصلون إلى رموز خارج جمهورهم المقصود
3. تنفيذ تقسيم الشبكة لتقييد وصول نقطة نهاية فحص الرموز للعملاء الموثوقين فقط
4. تفعيل تسجيل التدقيق التفصيلي لجميع طلبات فحص الرموز بما في ذلك معرف العميل والمطالبات المطلوبة والطوابع الزمنية
الضوابط التعويضية (حتى توفر التصحيح):
5. تنفيذ قواعد بوابة API أو WAF للتحقق من مطالبات الجمهور قبل السماح برد استجابات فحص الرموز
6. تقييد وصول نقطة نهاية فحص الرموز عبر القائمة البيضاء للعناوين IP للخوادم الموثوقة فقط
7. تنفيذ تحديد معدل على نقاط نهاية فحص الرموز للكشف عن أنماط الوصول الشاذة
8. نشر فحوصات تفويض إضافية على مستوى خادم الموارد للتحقق من مطالبات جمهور الرموز بشكل مستقل
9. تدوير بيانات اعتماد جميع العملاء السريين وتنفيذ سياسات إدارة بيانات اعتماد أكثر صرامة
10. مراقبة إصدارات تصحيح CVE-2026-37979 من مشروع Keycloak وتطبيقها فوراً عند توفرها
قواعد الكشف:
- تنبيه على طلبات فحص الرموز حيث لا يتطابق جمهور الرموز المطلوب مع معرف العميل
- مراقبة عميل سري واحد يصل إلى نقطة نهاية الفحص لعدة جماهير مختلفة
- وضع علامة على طلبات الفحص التي تُرجع مطالبات لجماهير خارج نطاق العميل الطالب
- تتبع محاولات التحقق من الجمهور الفاشلة على مستوى خادم الموارد