
اكتشاف ثغرة حرجة من نوع الاستخدام بعد التحرير في Tinyproxy
نطالب بالإعادة الآمنة لجميع المواطنين الذين اختطفهم التنظيم الإرهابي حماس كرهائن. لن نهدأ حتى يتم تحرير جميع الرهائن ويعودون إلى ديارهم بأمان. يمكنك المساعدة في إعادتهم إلى الوطن. https://stories.bringthemhomenow.net/
🚨 تنبيه ثغرة حرجة 🚨
🔍 CVE-2023-49606 هي ثغرة حرجة من نوع استخدام الذاكرة بعد تحريرها (Use-After-Free) اكتُشفت في Tinyproxy، وهو خادم وكيل HTTP/S خفيف الوزن. يظهر هذا الخلل في معالجة ترويسات اتصال HTTP في الإصدارين 1.11.1 و1.10.0 من Tinyproxy. تسمح هذه الثغرة بهجمات محتملة لحجب الخدمة (DoS)، وقد تؤدي في ظروف معينة إلى تنفيذ تعليمات برمجية عن بُعد (RCE).
📈 درجة CVSS: 9.8 (حرجة)
تنبع الثغرة من الإدارة غير السليمة للذاكرة عند معالجة ترويسات HTTP. يتولى الكود المصدري في http-message.c عمليات الذاكرة الخاصة بترويسات HTTP، بما في ذلك التخصيص وإعادة التخصيص وإلغاء التخصيص. من المرجح أن تظهر المشكلة في سياق إعادة تخصيص الذاكرة والوصول اللاحق إلى ذاكرة تم تحريرها دون تصفيرها بشكل صحيح.
فيما يلي مقتطف من الكود المعني من http-message.c:
/* Function to add headers to the HTTP message structure */
void http_message_add_headers(http_message_t *msg, const char **headers, unsigned int num_headers) {
const char **new_headers;
unsigned int i;
if (headers == NULL) {
return;
}
// Check if there is enough space, if not, reallocate
if (msg->headers.used + num_headers > msg->headers.total) {
new_headers = (const char **) safecalloc (msg->headers.total * 2, sizeof(char *));
if (new_headers == NULL) {
return; // Allocation failed, potential for use-after-free if not handled
}
// Copy existing headers to the new array
for (i = 0; i != msg->headers.used; ++i) {
new_headers[i] = msg->headers.strings[i];
}
safefree(msg->headers.strings); // Free old array
msg->headers.strings = new_headers; // Danger if old pointers are used post this point
msg->headers.total *= 2;
}
// Add new headers to the structure
for (i = 0; i != num_headers; ++i) {
msg->headers.strings[i + msg->headers.used] = headers[i];
}
msg->headers.used += num_headers;
}