Journal of Computer Applications ›› 2026, Vol. 46 ›› Issue (2): 518-527.DOI: 10.11772/j.issn.1001-9081.2025020217

• Computer software technology • Previous Articles    

Software vulnerability detection method based on edge weight

Qiao YU1, Zirui HUANG1(), Shengyi CHENG1(), Yi ZHU1, Shutao ZHANG2   

  1. 1.School of Computer Science and Technology,Jiangsu Normal University,Xuzhou Jiangsu 221116,China
    2.Jiangsu Xuzhou Mining Energy Company Limited,Xuzhou Jiangsu 220009,China
  • Received:2025-03-06 Revised:2025-05-11 Accepted:2025-05-13 Online:2025-05-16 Published:2026-02-10
  • Contact: Zirui HUANG
  • About author:YU Qiao, born in 1989, Ph. D., associate professor. Her research interests include machine learning, software defect prediction, vulnerability detection.
    HUANG Zirui, born in 1999, M. S. candidate. His research interests include vulnerability detection.
    CHENG Shengyi, born in 1999, M. S. candidate. His research interests include vulnerability detection, software defect prediction. Email:hanzir13@163.com
    ZHU Yi, born in 1976, Ph. D., professor. His research interests include software engineering, formal methods, software defect prediction.
    ZHANG Shutao, born in 1979, M. S., senior engineer. His research interests include information management system and operations.
  • Supported by:
    National Natural Science Foundation of China(61902161);Postgraduate Research and Practice Innovation Program of Jiangsu Normal University(2024XKT2616)

基于边权重的软件漏洞检测方法

于巧1, 黄子睿1(), 程圣懿1(), 祝义1, 张淑涛2   

  1. 1.江苏师范大学 计算机科学与技术学院,江苏 徐州 221116
    2.江苏徐矿能源股份有限公司,江苏 徐州 220009
  • 通讯作者: 黄子睿
  • 作者简介:于巧(1989—),女,山东莱阳人,副教授,博士,CCF会员,主要研究方向:机器学习、软件缺陷预测、漏洞检测
    黄子睿(1999—),男,江苏淮安人,硕士研究生,CCF会员,主要研究方向:漏洞检测 Email:hanzir13@163.com
    程圣懿(1999—),男,江苏徐州人,硕士研究生,CCF会员,主要研究方向:漏洞检测、软件缺陷预测
    祝义(1976—),男,江西九江人,教授,博士,CCF高级会员,主要研究方向:软件工程、形式化方法、软件缺陷预测
    张淑涛(1979—),男,江苏徐州人,高级工程师,硕士,主要研究方向:信息管理系统与运维。
  • 基金资助:
    国家自然科学基金资助项目(61902161);江苏师范大学研究生科研与实践创新计划项目(2024XKT2616)

Abstract:

With the widespread application of software across various domains, software vulnerabilities have shown a continuous upward trend, so that deep learning-based methods for vulnerability detection have gained wide application. However, the existing graph representation learning methods often neglect the influence of edges in the graph on vulnerability detection, and have the representation of edge weights too coarse. To address this issue, a software vulnerability detection method based on edge weight — EWVD (Edge Weight for Vulnerability Detection) was proposed. Firstly, comments, custom variable names, and function names in the source code were cleaned and represented abstractly. Secondly, Sent2Vec was selected to perform embedding representation after comparative analysis. Thirdly, edge weights were calculated comprehensively using three metrics: connection structure, the importance of neighboring nodes, and Jaccard similarity, so as to identify the information transmission capability between nodes. Finally, by leveraging edge weights, perception capability of the model was enhanced for potential relationships between vulnerable statements, thereby determining the importance of edges in the graph. Compared with the best-performing baseline method VulCNN among seven vulnerability detection baseline methods, EWVD achieves an increase of 1.06 percentage points in Accuracy and a decrease of 1.11 percentage points in False Positive Rate (FPR). It can be seen that EWVD refines the representation of edge weights and improves the overall performance of vulnerability detection.

Key words: vulnerability detection, edge weight, graph representation learning, program dependency graph

摘要:

随着软件在各个领域的广泛应用,软件漏洞呈不断增长的趋势,基于深度学习的软件漏洞检测方法得到广泛应用;然而,现有的图表示学习方法通常忽略了图中边对软件漏洞检测的影响,并且对边权重的表示过于粗糙。针对该问题,提出一种基于边权重的软件漏洞检测方法EWVD(Edge Weight for Vulnerability Detection)。首先,对源代码中的注释、自定义变量名和函数名进行清理和抽象表示;其次,经过对比分析后选择使用Sent2Vec进行嵌入表示;再次,利用连接结构、邻居节点的重要性和Jaccard相似性这3种度量方式,综合计算边权重,从而识别节点间的信息传递能力;最后,利用边权重提升模型对漏洞语句潜在关系的感知能力,从而判断图中边的重要性。实验结果表明,与7种漏洞检测基线方法中的最优基线VulCNN相比,EWVD的准确率提高了1.06个百分点,而假阳性率(FPR)降低了1.11个百分点。可见,EWVD细化了边权重的表示,并且提升了漏洞检测的综合性能。

关键词: 漏洞检测, 边权重, 图表示学习, 程序依赖图

CLC Number: