中文

利用源代码分布式表示检测 C 语言安全漏洞的研究

密码学与安全 2021-06-04 v1 人工智能 机器学习 编程语言 软件工程

摘要

本文评估了代码表示模型 Code2vec 在训练用于检测 C 源代码中安全漏洞任务时的表现。我们利用开源库 astminer 从带标签的 C 函数语料库的抽象语法树中提取路径上下文(path-contexts)。Code2vec 在所得路径上下文上进行训练,任务是将函数分类为存在漏洞或无漏洞。使用 CodeXGLUE 基准,我们表明 Code2vec 在此任务上的准确率可与基于简单 transformer 的方法(如预训练 RoBERTa)相媲美,并且优于更朴素的基于 NLP 的方法。我们在保持相对于大型模型较低计算需求的同时,达到了 61.43% 的准确率。

关键词

引用

@article{arxiv.2106.01367,
  title  = {On using distributed representations of source code for the detection of C security vulnerabilities},
  author = {David Coimbra and Sofia Reis and Rui Abreu and Corina Păsăreanu and Hakan Erdogmus},
  journal= {arXiv preprint arXiv:2106.01367},
  year   = {2021}
}

备注

Submitted to DX 2021