Skip to main content
QUICK REVIEW

[论文解读] You Really Shouldn't Roll Your Own Crypto: An Empirical Study of Vulnerabilities in Cryptographic Libraries

Jenny Blessing, Michael A. Specter|arXiv (Cornell University)|Jul 11, 2021
Advanced Malware Detection Techniques参考文献 19被引用 6
一句话总结

这项实证研究分析了八大主流密码学库中的300多个漏洞,发现37.2%的漏洞源于内存安全问题,而非密码学缺陷,且代码复杂性——尤其是C/C++中的复杂性——是漏洞的主要驱动因素。研究显示,密码学软件的漏洞率显著高于非密码学系统,其漏洞平均可利用寿命为4.18年,且在OpenSSL中每1000行代码至少存在一个漏洞,进一步凸显了‘自行实现密码学’的危险性。

ABSTRACT

The security of the Internet rests on a small number of open-source cryptographic libraries: a vulnerability in any one of them threatens to compromise a significant percentage of web traffic. Despite this potential for security impact, the characteristics and causes of vulnerabilities in cryptographic software are not well understood. In this work, we conduct the first comprehensive analysis of cryptographic libraries and the vulnerabilities affecting them. We collect data from the National Vulnerability Database, individual project repositories and mailing lists, and other relevant sources for eight widely used cryptographic libraries. Among our most interesting findings is that only 27.2% of vulnerabilities in cryptographic libraries are cryptographic issues while 37.2% of vulnerabilities are memory safety issues, indicating that systems-level bugs are a greater security concern than the actual cryptographic procedures. In our investigation of the causes of these vulnerabilities, we find evidence of a strong correlation between the complexity of these libraries and their (in)security, empirically demonstrating the potential risks of bloated cryptographic codebases. We further compare our findings with non-cryptographic systems, observing that these systems are, indeed, more complex than similar counterparts, and that this excess complexity appears to produce significantly more vulnerabilities in cryptographic libraries than in non-cryptographic software.

研究动机与目标

  • 对广泛使用的密码学库中的漏洞根本原因进行实证评估。
  • 研究密码学软件中代码复杂性与漏洞频率之间的关系。
  • 比较密码学系统与非密码学系统在漏洞率和特征方面的差异。
  • 评估执法机构提出的加密‘例外访问’机制的安全影响。
  • 为长期坚持的安全部原则‘你不应自行实现密码学’提供数据支持。

提出的方法

  • 从国家漏洞数据库(NVD)、GitHub代码库、邮件列表和漏洞追踪系统中收集了八大主流密码学库的漏洞数据。
  • 基于NVD定义并结合人工标注,对漏洞类型(如密码学、内存安全、资源管理等)进行分类。
  • 通过测量代码库规模和圈复杂度来评估软件复杂性,并将其与漏洞频率相关联。
  • 通过分析首次公开披露时间到补丁发布之间的时间间隔,追踪漏洞的生命周期。
  • 将密码学库(如OpenSSL、GnuTLS等)的漏洞率与非密码学系统(如网络浏览器、操作系统组件等)进行比较,以评估相对风险。
  • 对LibreSSL和BoringSSL的分支进行了案例研究,以分析源代码精简对漏洞减少的影响。

实验结果

研究问题

  • RQ1密码学库中,有多少比例的漏洞源于密码学缺陷,又有多少比例源于系统级实现问题?
  • RQ2代码复杂性(以代码规模和圈复杂度衡量)与密码学软件中漏洞频率之间的相关性如何?
  • RQ3密码学库中的漏洞率和生命周期与非密码学系统相比如何?
  • RQ4在OpenSSL等主要密码学库中,每千行代码引入漏洞的速率是多少?
  • RQ5通过分叉(如LibreSSL、BoringSSL)减少代码库规模,在多大程度上能带来可衡量的漏洞减少?

主要发现

  • 在密码学库中,仅有27.2%的漏洞属于密码学问题,而37.2%为内存安全或资源管理错误。
  • 密码学库中漏洞的中位可利用寿命为4.18年,表明攻击者有较长的暴露窗口期。
  • 在OpenSSL中,每新增1000行代码,至少引入一个漏洞,其漏洞率最高可达非密码学软件的三倍。
  • 密码学软件的代码复杂度显著高于非密码学系统,且这种复杂性与漏洞频率的增加密切相关。
  • LibreSSL和BoringSSL等分支显示出源代码减少与漏洞减少之间存在线性关系,支持了‘更简洁的代码库更安全’的假设。
  • 本研究提供了实证证据,表明在密码学软件中,复杂性比密码学设计缺陷对安全构成更大的威胁,进一步强化了‘不应自行实现密码学’的原则。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。