DOI: https://doi.org/10.1007/s10207-026-01282-6
تاريخ النشر: 2026-08-20
المؤلف: Rijha Safdar وآخرون
الموضوع الرئيسي: أبحاث هندسة البرمجيات
نظرة عامة
في هذا البحث، يستكشف المؤلفون قيود الحلول المعتمدة على الذكاء الاصطناعي في اكتشاف الثغرات داخل البرمجيات، لا سيما عدم قدرتها على التعميم عبر قواعد الشيفرة غير المرئية. يقدمون VulGate، مجموعة بيانات عالية الجودة مصممة لمعالجة هذه العيوب من خلال القضاء على العينات الم mislabeled والمكررة، وتحديث الثغرات، وإدراج بيانات وصفية إضافية. من خلال تجارب واسعة، يظهر المؤلفون أن تنوع وجودة مجموعة البيانات المحسنة تحسن بشكل كبير من قدرات اكتشاف الثغرات. تشير نتائجهم إلى أن النماذج المعتمدة على الترميز، وخاصة UniX coder-Base-Nine، تتفوق على الهياكل الأخرى مثل CodeBERT وCodeGPT-2، محققة تحسينًا بنسبة 6.8% في الاسترجاع على معيار BigVul وتظهر أداءً متفوقًا على المشاريع غير المرئية.
يؤكد البحث على العوامل الحاسمة التي تؤثر على التعميم، بما في ذلك بنية النموذج، وحجم نافذة السياق، وجودة بيانات التدريب. يقدم المؤلفون خط أنابيب شامل لـ VulGate، والذي يُزعم أنه مجموعة البيانات الأكثر تقدمًا لاكتشاف الثغرات حتى الآن، والتي يمكن تطبيقها أيضًا على تصنيف الشيفرة، والتحديد، والترقيع. ستتركز الأعمال المستقبلية على تقييم التعميم عبر اللغات، واستخدام البيانات الوصفية لتعديل التعليمات، واستكشاف طرق التدريب الهجينة لتعزيز فعالية أنظمة اكتشاف الثغرات. بشكل عام، يساهم هذا البحث في تقديم رؤى وأدوات قيمة لتطوير حلول آلية قوية في اكتشاف الثغرات.
مقدمة
تسلط مقدمة الورقة الضوء على المشكلة المتزايدة لثغرات البرمجيات، كما يتضح من تسجيل 40,000 ثغرة شائعة (CVEs) تم الإبلاغ عنها في عام 2024، مما يمثل زيادة بنسبة 38% عن العام السابق. شهد نظام البرمجيات مفتوحة المصدر، الذي يعد حيويًا عبر مختلف الصناعات، زيادة مذهلة بنسبة 98% سنويًا في الثغرات المبلغ عنها. ومن الجدير بالذكر أن الثغرات الحرجة زادت بنسبة 37%، بينما زادت الثغرات المعروفة المستغلة بنسبة 96%. بشكل مقلق، امتد متوسط الوقت لإصلاح هذه الثغرات إلى ثمانية أشهر ونصف، مما يبرز الحاجة الملحة لحلول آلية فعالة لاكتشاف الثغرات.
تقترح الورقة استخدام نماذج اللغة الكبيرة (LLMs) كمسار واعد لمعالجة هذا التحدي. على الرغم من نجاحها الأولي في توليد الشيفرة وتحديد الأخطاء، فإن النماذج الحالية تكافح من أجل التعميم على قواعد الشيفرة غير المرئية، كما يتضح من الانخفاضات الكبيرة في الأداء على مجموعات البيانات الواقعية. يحدد المؤلفون ثلاثة عوامل رئيسية تسهم في هذه القيود: جودة وتنوع مجموعات بيانات التدريب، واختيار هياكل النماذج. لمعالجة هذه القضايا، تقدم الورقة VulGate، مجموعة بيانات شاملة مصممة لاكتشاف الثغرات، والتي تتضمن مجموعة متنوعة من عينات مستوى الوظيفة وتدرج عينات سلبية صعبة لتعزيز تدريب النموذج. كما يقدم المؤلفون نتائج قياسية تشير إلى تحسين الأداء وقدرات التعميم للهياكل الجديدة من المحولات، وخاصة تلك التي تحتوي على نوافذ سياق موسعة، مما يضع معيارًا جديدًا للتعميم عبر مجموعات البيانات في اكتشاف الثغرات.
طرق
في قسم الطرق من ورقة البحث، يوضح المؤلفون تقييمهم التجريبي للنماذج لاكتشاف الثغرات. يبدأون بمراجعة النماذج الحالية وأدائها على مجموعة بيانات BigVul في القسم 5.1. في القسم 5.2، يقدمون نماذج مشفرة متقدمة تم ضبطها خصيصًا لاكتشاف الثغرات، والتي تظهر تحسينات كبيرة في الأداء مقارنة بالنماذج السابقة.
تستكشف التجارب اللاحقة عوامل مختلفة تؤثر على أداء النموذج. في القسم 5.3، يفحص المؤلفون تأثير زيادة حجم نافذة السياق، ويجدون أن النوافذ الأكبر، عند دمجها مع الهياكل المعتمدة على الترميز فقط، تعزز قدرات الاكتشاف. يوضح القسم 5.4 تدريب هذه النماذج على مجموعة بيانات VulGate المطورة حديثًا، مما يؤدي إلى تحقيق مزيد من المكاسب في الأداء عبر مجموعة متنوعة من المشاريع. أخيرًا، يقيم القسم 5.5 قدرة التعميم للنماذج باستخدام مجموعة اختبار، VulGate+، التي تتضمن كل من مقتطفات الشيفرة الواقعية والصناعية. تؤكد النتائج على أهمية دمج العينات السلبية الصعبة والحفاظ على بيانات تدريب متوازنة. جميع مجموعات البيانات والبرامج النصية متاحة للجمهور في Gen-VulGate.
نتائج
تشير النتائج المقدمة في الجدول 3 إلى تحسين كبير في الأداء لكل من متغيرات UniXcoder عندما يتم زيادة طول الإدخال من 512 إلى 1024 رمزًا. على وجه التحديد، تحسن معدل F1 لـ UniXcoder-Base من 84.68% إلى 94.23%، بينما شهد UniXcoder-Base-Nine زيادة من 88.8% إلى 94.73%. تشير هذه النتائج إلى أن العديد من الثغرات الواقعية تتضمن سياقات تتجاوز 512 رمزًا، وأن توسيع نافذة الإدخال يمكّن النموذج من التقاط تدفق التحكم والبيانات الضرورية للتصنيف الدقيق.
في المقابل، يظهر CodeBERT، الذي يقتصر على حد أقصى لطول الإدخال يبلغ 512 رمزًا، أداءً تنافسيًا بمعدل F1 يبلغ 91%. ومع ذلك، فإن هذا القيد يعيق قدرته على تحليل الوظائف الأطول بشكل شامل. تؤكد النتائج على أهمية طول الإدخال في تعزيز أداء النموذج، لا سيما في سياق اكتشاف الثغرات في الشيفرة.
نقاش
ت outlines قسم النقاش في الورقة القيود والتقدم في طرق اكتشاف الثغرات التقليدية، بما في ذلك التحليل الثابت، والتحليل الديناميكي، والنهج الهجينة، والتنفيذ الرمزي. تعتبر أدوات التحليل الثابت فعالة في تحديد الثغرات المعروفة، لكنها غالبًا ما تعاني من معدلات إيجابية كاذبة عالية، حيث توصي المعايير الصناعية بمعدلات أقل من 20-30%. التحليل الديناميكي، على الرغم من كونه أكثر فعالية في التقييمات في وقت التشغيل، يتطلب موارد كثيفة ويعاني من قيود تغطية الشيفرة. تحاول الطرق الهجينة دمج نقاط القوة في كل من التحليلات الثابتة والديناميكية لكنها لا تزال تتطلب موارد حسابية كبيرة. تواجه التنفيذات الرمزية تحديات في قابلية التوسع بسبب انفجار المسار، مما يجعلها أقل عملية لقواعد الشيفرة الكبيرة. في المقابل، تظهر طرق التعلم الآلي (ML) والتعلم العميق (DL) كبدائل واعدة، قادرة على تعلم أنماط الثغرات وتحقيق دقة وكفاءة محسنتين. على سبيل المثال، أظهر حل التعلم الجماعي VELVET تحسينًا بمقدار 4.5 مرة مقارنة بالمحللات الثابتة الأساسية مع تقليل معدلات الإيجابيات الكاذبة.
كما يسلط القسم الضوء على تطور مجموعات البيانات لاكتشاف الثغرات، مشيرًا إلى الانتقال من مجموعات البيانات الصغيرة التي تم تنسيقها يدويًا إلى مجموعات أكبر تم استخراجها تلقائيًا. بينما قدمت مجموعات البيانات المبكرة مثل Devign وREVEAL تسميات عالية الجودة، إلا أنها كانت محدودة في النطاق وعانت من اختلالات في الفئات. وسعت مجموعات البيانات الأحدث، مثل BigVul وMegaVul، التغطية لكنها أدخلت مشكلات الضوضاء في التسمية والتكرار. تقدم الورقة VulGate، مجموعة بيانات جديدة مصممة لمعالجة هذه التحديات من خلال توفير بيانات منظمة مع تعليقات توضيحية عالية الجودة، بما في ذلك الشيفرة على مستوى الوظيفة قبل وبعد الترقيع، وبيانات وصفية غنية. تهدف VulGate إلى تعزيز موثوقية وقابلية تطبيق أبحاث اكتشاف الثغرات، مع إدراج عينات سلبية صعبة لتحسين تمييز النموذج والتعميم عبر قواعد الشيفرة المتنوعة.
DOI: https://doi.org/10.1007/s10207-026-01282-6
Publication Date: 2026-08-20
Author(s): Rijha Safdar et al.
Primary Topic: Software Engineering Research
Overview
In this research, the authors explore the limitations of AI-based solutions in vulnerability detection within software, particularly their inability to generalize across unseen codebases. They introduce VulGate, a high-quality dataset designed to address these shortcomings by eliminating mislabeled and duplicate samples, updating vulnerabilities, and incorporating additional metadata. Through extensive experiments, the authors demonstrate that enhanced dataset diversity and quality significantly improve vulnerability detection capabilities. Their findings indicate that encoder-based models, particularly UniX coder-Base-Nine, outperform other architectures like CodeBERT and CodeGPT-2, achieving a 6.8% improvement in recall on the BigVul benchmark and showing superior performance on unseen projects.
The study emphasizes the critical factors influencing generalization, including model architecture, context window size, and the quality of training data. The authors present a comprehensive pipeline for VulGate, which is claimed to be the most advanced dataset for vulnerability detection to date, also applicable to code classification, localization, and patching. Future work will focus on evaluating cross-language generalization, utilizing metadata for instruction fine-tuning, and exploring hybrid training methods to enhance the effectiveness of vulnerability detection systems. Overall, this research contributes valuable insights and tools for developing robust automated solutions in vulnerability detection.
Introduction
The introduction of the paper highlights the escalating issue of software vulnerabilities, evidenced by a record 40,000 Common Vulnerabilities and Exposures (CVEs) reported in 2024, marking a 38% increase from the previous year. The open-source software ecosystem, crucial across various industries, has seen a staggering 98% annual rise in reported vulnerabilities. Notably, critical vulnerabilities surged by 37%, while known exploited vulnerabilities increased by 96%. Alarmingly, the average time to remediate these vulnerabilities has extended to eight and a half months, underscoring the urgent need for effective automated solutions for vulnerability detection.
The paper proposes the use of large language models (LLMs) as a promising avenue for addressing this challenge. Despite their initial success in code generation and bug identification, existing models struggle with generalization to unseen codebases, as demonstrated by significant performance drops on realistic datasets. The authors identify three primary factors contributing to this limitation: the quality and diversity of training datasets, and the choice of model architectures. To address these issues, the paper introduces VulGate, a comprehensive dataset designed for vulnerability detection, which includes a diverse range of function-level samples and incorporates hard negative samples to enhance model training. The authors also present benchmarking results that indicate improved performance and generalization capabilities of newer transformer architectures, particularly those with extended context windows, thereby setting a new standard for cross-dataset generalization in vulnerability detection.
Methods
In the Methods section of the research paper, the authors outline their experimental evaluation of models for vulnerability detection. They begin by reviewing existing models and their performance on the BigVul dataset in Section 5.1. In Section 5.2, they introduce advanced encoder-decoder models specifically fine-tuned for vulnerability detection, which show significant performance improvements over previous models.
Subsequent experiments explore various factors affecting model performance. In Section 5.3, the authors examine the impact of increasing the context window size, finding that larger windows combined with encoder-only architectures enhance detection capabilities. Section 5.4 details the training of these models on the newly developed VulGate dataset, which yields further performance gains across a variety of projects. Finally, Section 5.5 assesses the generalization ability of the models using a test set, VulGate+, that includes both real-world and synthetic code snippets. The results underscore the importance of incorporating hard negatives and maintaining balanced training data. All datasets and scripts are made publicly available at Gen-VulGate.
Results
The results presented in Table 3 indicate a significant enhancement in performance for both variants of UniXcoder when the input length is increased from 512 to 1024 tokens. Specifically, UniXcoder-Base’s F1 score improved from 84.68% to 94.23%, while UniXcoder-Base-Nine saw an increase from 88.8% to 94.73%. These findings suggest that many real-world vulnerabilities involve contexts that exceed 512 tokens, and extending the input window enables the model to effectively capture the necessary control and data flow for accurate classification.
In contrast, CodeBERT, which is limited to a maximum input length of 512 tokens, demonstrates a competitive performance with an F1 score of 91%. However, this constraint hinders its ability to analyze longer functions comprehensively. The results underscore the importance of input length in enhancing model performance, particularly in the context of vulnerability detection in code.
Discussion
The discussion section of the paper outlines the limitations and advancements in traditional vulnerability detection methods, including static analysis, dynamic analysis, hybrid approaches, and symbolic execution. Static analysis tools, while effective at identifying known vulnerabilities, often suffer from high false positive rates, with industry standards recommending rates below 20-30%. Dynamic analysis, although more effective in runtime evaluations, is resource-intensive and limited by code coverage. Hybrid methods attempt to combine the strengths of both static and dynamic analyses but still require significant computational resources. Symbolic execution faces scalability challenges due to path explosion, making it less practical for large codebases. In contrast, machine learning (ML) and deep learning (DL) approaches are emerging as promising alternatives, capable of learning vulnerability patterns and achieving improved accuracy and efficiency. For instance, the ensemble learning solution VELVET has demonstrated a 4.5-fold improvement over baseline static analyzers with reduced false positive rates.
The section also highlights the evolution of datasets for vulnerability detection, noting the transition from small, manually curated datasets to larger, automatically mined collections. While early datasets like Devign and REVEAL provided high-quality labels, they were limited in scope and suffered from class imbalances. More recent datasets, such as BigVul and MegaVul, expanded coverage but introduced issues of label noise and duplication. The paper introduces VulGate, a new dataset designed to address these challenges by providing structured data with high-quality annotations, including function-level code before and after patching, and rich metadata. VulGate aims to enhance the reliability and applicability of vulnerability detection research, incorporating hard negative samples to improve model discrimination and generalization across diverse codebases.
