
محاكاة بلغة Python لثغرة CVE-2026-22012، توضح كيف يؤدي غياب Final-Unit-Indication في Diameter Credit-Control إلى السماح بحصة غير محدودة وتجاوز الخدمة في شبكات 5G.
# diameter_credit_control_sim.py - Simulated OCS with missing final-unit indication
class OCS:
def process_CCR(self, request):
# Vulnerability: always returns SUCCESS with same quota, never sends final-unit
return {'Result-Code': 2001, 'Granted-Service-Unit': {'CC-Total-Octets': 5000}}
class Client:
def send_CCR(self):
response = ocs.process_CCR({'type': 'INITIAL'})
print(f"Received quota: {response['Granted-Service-Unit']}")
ocs = OCS()
client = Client()
client.send_CCR()
يفشل تطبيق التحكم في الائتمان في بروتوكول Diameter في إرسال AVP الخاصة بـ Final-Unit-Indication عندما يُستنفد رصيد المشترك. يستمر العميل في منح الخدمة دون خصم الأرصدة، مما يتيح استخدامًا مجانيًا غير محدود.
شغّل المحاكاة:
python diameter_credit_control_sim.py
يحصل العميل على حصة جديدة إلى أجل غير مسمى.