The proliferation of online code repositories, such as GitHub and GitLab, has increased security risks related to the spread of malware through source code, including compromised libraries and obfuscated code. Traditional detection methods, such as static and dynamic analysis, have shown limitations when faced with advanced threats. To address this issue, we propose an approach based on Graph Neural Networks (GNN) to enhance malware detection in code repositories. Graphs provide an effective way to model the complex relationships within a program, such as interactions between functions, classes, modules, and external dependencies. This is particularly useful for identifying specific patterns of complex malicious behavior. Our model detects anomalies by analyzing the program internal interactions in addition to the exact code content. Our method extracts call graphs and metadata (such as descriptions and README files) from code repositories. The metadata is converted into vectors using a natural language embedding model, then merged with the embeddings of call graphs generated by GNNs. This combined representation is used by a supervised classifier to detect malicious repositories. The results show strong performance in precision, recall, and F1-score, validating the effectiveness of our approach.

错误:搜索内容不能为空,请输入英文关键词
错误:关键词超出字数限制,请精简
高级检索

Advanced Malware Detection in Code Repositories Using Graph Neural Networks

  • Malak Gouasmia,
  • Abd Errahmane Kiouche,
  • Hamida Seba

摘要

The proliferation of online code repositories, such as GitHub and GitLab, has increased security risks related to the spread of malware through source code, including compromised libraries and obfuscated code. Traditional detection methods, such as static and dynamic analysis, have shown limitations when faced with advanced threats. To address this issue, we propose an approach based on Graph Neural Networks (GNN) to enhance malware detection in code repositories. Graphs provide an effective way to model the complex relationships within a program, such as interactions between functions, classes, modules, and external dependencies. This is particularly useful for identifying specific patterns of complex malicious behavior. Our model detects anomalies by analyzing the program internal interactions in addition to the exact code content. Our method extracts call graphs and metadata (such as descriptions and README files) from code repositories. The metadata is converted into vectors using a natural language embedding model, then merged with the embeddings of call graphs generated by GNNs. This combined representation is used by a supervised classifier to detect malicious repositories. The results show strong performance in precision, recall, and F1-score, validating the effectiveness of our approach.