DOI: https://doi.org/10.1145/3859369
تاريخ النشر: 2026-10-26
المؤلف: Hang Yuan وآخرون
الموضوع الرئيسي: تطبيقات تكنولوجيا البلوكشين والأمان
نظرة عامة
تقدم ورقة البحث MOS، وهو إطار عمل جديد لاكتشاف الثغرات في العقود الذكية، مستفيدًا من ضبط مزيج الخبراء (MOE-Tuning) لنماذج اللغة الكبيرة (LLMs). يعالج الإطار القيود الكبيرة لطرق الكشف الحالية، بما في ذلك صلابة أساليب تحليل البرامج، وافتقارها إلى القابلية للتفسير في أساليب التعلم العميق، ومعدلات الإيجابيات الكاذبة العالية المرتبطة بنماذج اللغة الكبيرة. يعزز MOS اكتشاف الثغرات من خلال إجراء تدريب مسبق مستمر على مجموعة بيانات شاملة من العقود الذكية، مما يوفر بداية قوية لعملية MOE-Tuning.
تتمثل ميزة رئيسية في MOS في آلية التوجيه المدركة للثغرات، التي تنشط الشبكات الخبيرة الأكثر صلة بناءً على تحليل ميزات الكود وتوافقها مع ثغرات معينة. تتيح هذه الطريقة التخصص بين الشبكات الخبيرة، مما يحسن دقة الكشف. يستخدم الإطار دالة خسارة ذات هدفين لتحسين كل من أداء الكشف والتفسير مع ضمان توزيع متوازن لأنواع الثغرات المختلفة بين الخبراء. تؤكد التجارب الواسعة فعالية MOS، مما يظهر تحسينات في الدقة والكمال والإيجاز مقارنة بالطرق الحالية. ستهدف الأبحاث المستقبلية إلى توسيع نطاق الثغرات التي يعالجها الإطار.
مقدمة
تناقش مقدمة الورقة الاعتماد السريع لتكنولوجيا البلوكشين، مع التأكيد على هيكلها اللامركزي ودور العقود الذكية في أتمتة إدارة الأصول الرقمية. بينما تضمن البلوكشين سلامة المعاملات من خلال طرق التشفير، فإن تعقيد وثبات العقود الذكية يمثلان تحديات أمنية كبيرة، كما يتضح من حادثة DAO، التي أدت إلى خسارة مالية كبيرة. تواجه أدوات اكتشاف الثغرات الحالية، التي تعتمد أساسًا على تحليل البرامج، قيودًا بسبب اعتمادها على قواعد محددة من قبل الخبراء، مما يؤدي إلى معدلات إيجابيات كاذبة عالية وتغطية غير كافية للثغرات المعقدة.
لمعالجة هذه التحديات، يقترح المؤلفون إطار عمل جديد يسمى MOS، الذي يستخدم ضبط مزيج الخبراء (MoE) لنماذج اللغة الكبيرة (LLMs) لاكتشاف ثغرات العقود الذكية. يهدف MOS إلى تعزيز كل من دقة الكشف وجودة تفسيرات الثغرات. يتضمن الإطار آلية توجيه مدركة للثغرات وشبكة مخصصة من الخبراء، مما يسمح بالتعامل التكيفي مع الثغرات الناشئة وتحسين الأداء عبر أنواع مختلفة. تشير النتائج التجريبية الأولية إلى أن MOS يتفوق بشكل كبير على الطرق الحالية من حيث دقة الكشف وجودة التفسيرات الناتجة، مما يمثل تقدمًا كبيرًا في مجال أمان العقود الذكية.
طرق
في تقييم طرق اكتشاف الثغرات، أظهرت طريقتنا تحسينات كبيرة مقارنة بالأسس الحالية. بالنسبة لثغرات تجاوز/تحت تدفق الأعداد الصحيحة، حققنا دقة تبلغ 91.53%، متجاوزين أفضل أساس، DMT، بنسبة 6.88%. بالإضافة إلى ذلك، تجاوزت درجة F1 لدينا 82.35% DMT بنسبة 3.60%. في حالة اكتشاف ثغرة Delegatecall، وصلت طريقتنا إلى دقة تبلغ 93.96% ودرجة F1 تبلغ 89.52%، متفوقة على أفضل أساس، PSCVFinder، بنسبة 4.91% و9.75% على التوالي.
علاوة على ذلك، تفوقت طريقتنا، المعروفة باسم MOS، باستمرار على تقنيات أخرى راسخة، بما في ذلك Smartian وOyente وSecurify وSlither، عبر جميع أنواع الثغرات المختبرة. ومن الجدير بالذكر أن MOS أظهرت أيضًا تحسينات كبيرة مقارنة بالأساليب الحديثة المعتمدة على نماذج اللغة الكبيرة (LLM) مثل GPTScan وGPTLens وiAudit في معظم مقاييس التقييم، مما يدل على قوتها وفعاليتها في اكتشاف الثغرات.
نقاش
في هذا القسم، يركز النقاش على أهمية وتنفيذ العقود الذكية، لا سيما ضمن إطار عمل بلوكشين إيثريوم. تُعرف العقود الذكية بأنها اتفاقيات ذاتية التنفيذ تفرض الشروط تلقائيًا، وقد أحدثت ثورة في المعاملات الرقمية. تشمل دورة حياة العقد الذكي الإنشاء والنشر والتنفيذ والانتهاء، مع تركيز حاسم على الحاجة إلى اكتشاف شامل للثغرات قبل النشر بسبب الطبيعة الثابتة لتكنولوجيا البلوكشين. تسلط الورقة الضوء على أربع ثغرات رئيسية—إعادة الدخول، اعتماد الطوابع الزمنية، تجاوز/تحت تدفق الأعداد الصحيحة، وثغرة Delegatecall—كل منها مسؤول عن خسائر مالية كبيرة في حوادث أمان إيثريوم. يؤكد المؤلفون على أهمية معالجة هذه الثغرات، حيث تشكل حوالي 70% من الأضرار المالية في الانتهاكات ذات الصلة.
تقترح الأبحاث نظامًا آليًا لاكتشاف الثغرات يستخدم التصنيف الثنائي لتحديد العقود الذكية المعرضة للخطر. لا يكتشف هذا النظام الثغرات فحسب، بل يحلل أيضًا أنواعها ومواقعها والآثار الأمنية المحتملة. يقدم المؤلفون أدلة تجريبية توضح قيود أدوات الكشف الحالية ونماذج اللغة الكبيرة (LLMs) في تحديد هذه الثغرات بدقة. على سبيل المثال، بينما تتفوق بعض نماذج LLM في اكتشاف ثغرات معينة، فإنها تواجه صعوبة مع أخرى، وغالبًا ما تنتج إيجابيات كاذبة. يدعو المؤلفون إلى تطوير نموذج مخصص لمزيج الخبراء (MoE) مصمم لتعزيز دقة الكشف عن أنواع الثغرات المحددة، مما يعالج أوجه القصور في المنهجيات الحالية ويحسن أمان العقود الذكية بشكل عام.
القيود
في القسم الذي يتناول القيود، يقيم المؤلفون القيود العملية لنظام اكتشاف الثغرات MOS، لا سيما فيما يتعلق بمتطلباته الحاسوبية وتعقيدات هندسة المطالبات. أظهر التقييم التجريبي لقيود الكشف أنه بينما يعمل MOS بشكل جيد، فإنه يواجه صعوبة في الدقة في تحديد الثغرات عبر أربع فئات حرجة: إعادة الدخول، اعتماد الطوابع الزمنية، تجاوز/تحت تدفق الأعداد الصحيحة، وثغرة Delegatecall. على وجه التحديد، أظهر النظام ميلًا لتوليد إيجابيات كاذبة في الأنماط الآمنة وسلبيات كاذبة في السيناريوهات المعقدة، مما يدل على الحاجة إلى تحسين قدراته في الكشف.
علاوة على ذلك، فإن المتطلبات الحاسوبية لتدريب MOS كبيرة، مما يتطلب على الأقل وحدتين من NVIDIA GeForce RTX H800 GPUs بسبب العدد الكبير من المعلمات في النموذج البالغ 18 مليار، على الرغم من تنشيط جزء صغير فقط أثناء الاستدلال. قد يحد هذا الطلب العالي على الموارد من إمكانية الوصول لتطبيقات أوسع. بالإضافة إلى ذلك، يعترف المؤلفون بالتحديات المرتبطة بهندسة المطالبات، مشيرين إلى أن نهجهم الحالي قد لا يكون الأمثل. يقترحون أن استكشاف صيغ بديلة للمطالبات يمكن أن يعزز أداء النموذج، مؤكدين على أهمية تصميم المطالبات الفعالة في التأثير على سلوك نماذج اللغة الكبيرة. ستركز الأبحاث المستقبلية على تطوير منهجيات مطالبة أكثر تطورًا لمعالجة هذه القيود.
DOI: https://doi.org/10.1145/3859369
Publication Date: 2026-10-26
Author(s): Hang Yuan et al.
Primary Topic: Blockchain Technology Applications and Security
Overview
The research paper presents MOS, a novel framework for detecting vulnerabilities in smart contracts, leveraging Mixture-of-Experts Tuning (MOE-Tuning) of large language models (LLMs). The framework addresses significant limitations of existing detection methods, including the rigidity of program analysis approaches, the lack of interpretability in deep learning methods, and the high false positive rates associated with large language models. MOS enhances vulnerability detection by conducting continual pre-training on a comprehensive smart contract dataset, which provides a robust initialization for the MOE-Tuning process.
A key feature of MOS is its vulnerability-aware routing mechanism, which activates the most relevant expert networks based on an analysis of code features and their compatibility with specific vulnerabilities. This approach allows for specialization among expert networks, improving detection accuracy. The framework employs a dual-objective loss function to optimize both detection and explanation performance while ensuring a balanced distribution of different vulnerability types among experts. Extensive experiments validate the effectiveness of MOS, demonstrating improvements in correctness, completeness, and conciseness compared to existing methods. Future research will aim to broaden the range of vulnerabilities addressed by the framework.
Introduction
The introduction of the paper discusses the rapid adoption of blockchain technology, emphasizing its decentralized architecture and the role of smart contracts in automating digital asset management. While blockchain ensures transaction integrity through cryptographic methods, the complexity and immutability of smart contracts present significant security challenges, as exemplified by the DAO incident, which resulted in a substantial financial loss. Current vulnerability detection tools, primarily based on program analysis, face limitations due to their reliance on expert-defined rules, leading to high false-positive rates and inadequate coverage of complex vulnerabilities.
To address these challenges, the authors propose a novel framework called MOS, which utilizes Mixture-of-Experts (MoE) tuning of large language models (LLMs) for smart contract vulnerability detection. MOS aims to enhance both detection accuracy and the quality of vulnerability explanations. The framework incorporates a Vulnerability-aware Routing mechanism and a Specialized Mixture of Experts Network, allowing for adaptive handling of emerging vulnerabilities and improved performance across various types. Initial experimental results indicate that MOS significantly outperforms existing methods in terms of detection accuracy and the quality of generated explanations, marking a substantial advancement in the field of smart contract security.
Methods
In the evaluation of vulnerability detection methods, our approach demonstrated significant improvements over existing baselines. For Integer Overflow/Underflow vulnerabilities, we achieved an accuracy of 91.53%, exceeding the best baseline, DMT, by 6.88%. Additionally, our F1 score of 82.35% surpassed DMT by 3.60%. In the case of Delegatecall vulnerability detection, our method reached an accuracy of 93.96% and an F1 score of 89.52%, outperforming the best baseline, PSCVFinder, by 4.91% and 9.75%, respectively.
Furthermore, our method, referred to as MOS, consistently outperformed other established techniques, including Smartian, Oyente, Securify, and Slither, across all tested vulnerability types. Notably, MOS also showed significant enhancements over recent large language model (LLM)-based approaches such as GPTScan, GPTLens, and iAudit in most evaluation metrics, indicating its robustness and effectiveness in vulnerability detection.
Discussion
In this section, the discussion centers on the significance and implementation of smart contracts, particularly within the Ethereum blockchain framework. Smart contracts, defined as self-executing agreements that enforce terms automatically, have revolutionized digital transactions. The lifecycle of a smart contract includes creation, deployment, execution, and completion, with a critical emphasis on the need for thorough vulnerability detection prior to deployment due to the immutable nature of blockchain technology. The paper highlights four primary vulnerabilities—Reentrancy, Timestamp Dependency, Integer Overflow/Underflow, and Delegatecall Vulnerability—each responsible for significant financial losses in Ethereum security incidents. The authors underscore the importance of addressing these vulnerabilities, as they constitute approximately 70% of financial damages in related breaches.
The research proposes an automated vulnerability detection system that employs binary classification to identify vulnerable smart contracts. This system not only detects vulnerabilities but also analyzes their types, locations, and potential security implications. The authors present empirical evidence demonstrating the limitations of existing detection tools and large language models (LLMs) in accurately identifying these vulnerabilities. For instance, while some LLMs excel at detecting certain vulnerabilities, they struggle with others, often producing false positives. The authors advocate for the development of a specialized Mixture of Experts (MoE) model tailored to enhance detection accuracy for specific vulnerability types, thereby addressing the shortcomings of current methodologies and improving overall smart contract security.
Limitations
In the section addressing limitations, the authors evaluate the practical constraints of the MOS vulnerability detection system, particularly in relation to its computational demands and the intricacies of prompt engineering. The empirical assessment of detection limitations revealed that while MOS performs well, it struggles with accuracy in identifying vulnerabilities across four critical categories: Reentrancy, Timestamp Dependency, Integer Over/Underflow, and Delegatecall. Specifically, the system exhibited a tendency to generate false positives in secure patterns and false negatives in complex scenarios, indicating a need for refinement in its detection capabilities.
Moreover, the computational requirements for training MOS are significant, necessitating at least two NVIDIA GeForce RTX H800 GPUs due to the model’s extensive parameter count of 18 billion, despite only a fraction being activated during inference. This high resource demand could limit accessibility for broader applications. Additionally, the authors acknowledge the challenges associated with prompt engineering, noting that their current approach may not be optimal. They suggest that exploring alternative prompt formulations could enhance model performance, emphasizing the importance of effective prompt design in influencing the behavior of large language models. Future research will focus on developing more sophisticated prompting methodologies to address these limitations.
