arrow
返回

Methods and Benchmark for Detecting Cryptographic API Misuses in Python

检测Python中加密API误用的方法和基准

delete2024-05-01
delete1
PRE
AI
M
Miles Frantz *
Y
Ya Xiao
T
Tanmoy Sarkar Pias
N
Na Meng
D
Danfeng Yao
DOI:10.1109/TSE.2024.3377182delete
delete原文链接
delete分享
delete收藏
摘要

摘要

En 中文
Extensive research has been conducted to explore cryptographic API misuse in Java. However, despite the tremendous popularity of the Python language, uncovering similar issues has not been fully explored. The current static code analysis tools for Python are unable to scan the increasing complexity of the source code. This limitation decreases the analysis depth, resulting in more undetected cryptographic misuses. In this research, we propose Cryptolation, a Static Code Analysis (SCA) tool that provides security guarantees for complex Python cryptographic code. Most existing analysis tools for Python solely focus on specific Frameworks such as Django or Flask. However, using a SCA approach, Cryptolation focuses on the language and not any framework. Cryptolation performs an inter-procedural data-flow analysis to handle many Python language features through variable inference (statically predicting what the variable value is) and SCA. Cryptolation covers 59 Python cryptographic modules and can identify 18 potential cryptographic misuses that involve complex language features. In this paper, we also provide a comprehensive analysis and a state-of-the-art benchmark for understanding the Python cryptographic Application Program Interface (API) misuses and their detection. Our state-of-the-art benchmark PyCryptoBench includes 1,836 Python cryptographic test cases that covers both 18 cryptographic rules and five language features. PyCryptoBench also provides a framework for evaluating and comparing different cryptographic scanners for Python. To evaluate the performance of our proposed cryptographic Python scanner, we evaluated Cryptolation against three other state-of-the-art tools: Bandit, Semgrep, and Dlint. We evaluated these four tools using our benchmark PyCryptoBench and manual evaluation of (four Top-Ranked and 939 Un-Ranked) real-world projects. Our results reveal that, overall, Cryptolation achieved the highest precision throughout our testing; and the highest accuracy on our benchmark. Cryptolation had 100% precision on PyCryptoBench, and the highest precision on the real-world projects.
Keyword:
Cryptography
Python
Benchmark testing
Codes
Ciphers
Libraries
Encryption
Static code analysis
cryptographic API misuses
benchmark
A Systematic Evaluation of Static API-Misuse Detectors静态API误用检测器的系统评估
err2019-12-01
err73
errOAAI
errAmann, Sven; Hoan Anh Nguyen; Nadi, Sarah; Nguyen, Tien N.; Mezini, Mira
err分享
err收藏
Revisiting, Benchmarking and Exploring API Recommendation: How Far Are We?
err2023-04-01
err17
errOAAI
errPeng, Yun; Li, Shuqing; Gu, Wenwei; Li, Yichen; Wang, Wenxuan; Gao, Cuiyun; Lyu, Michael R.
err分享
err收藏
CrySL: An Extensible Approach to Validating the Correct Usage of Cryptographic APIs
err2021-11-01
err21
errOAAI
errKrueger, Stefan; Spath, Johannes; Ali, Karim; Bodden, Eric; Mezini, Mira
err分享
err收藏
Identifying and Mitigating API Misuse in Large Language Models识别和缓解大型语言模型中的API滥用
err2026-03-01
err0
PREAI
errZhuo, Terry Yue; He, Junda; Sun, Jiamou; Xing, Zhenchang; Lo, David; Grundy, John; Du, Xiaoning
err分享
err收藏
err分享
err收藏

期刊

IEEE Transactions on Software Engineering 封面图
IEEE Transactions on Software Engineering
IF:
5.6
论文数:
3.0K
被引数:
1.3W

机构

暂无机构信息
引用论文

引用论文

Effect of Disuse and Restoration of Function on Vesical Capacity
err1969-05-01
err0
PREAI
errJohn F. Schmaelzle; Alexander S. Cass; Frank Hinman
err分享
err收藏
Complexes of Early Transition Metal Alkoxides: Molecular Structure of Ti(OiPr)4[OPb4(tBuN)3]
err2006-01-25
err0
PREAI
errRenée Papiernik; Liliane G. Hubert‐Pfalzgrl; Michael Veith; Volker Huch
err分享
err收藏
Prevalence and Prognosis of Updated Phenotypes of Chronic Lung Allograft Dysfunction
err2020-04-01
err0
PREAI
errM.P. Combs; D.S. Wheeler; E.A. Belloli; S. Jia; D.M. Lyu; K.M. Chan; V.N. Lama
err分享
err收藏
Numerical Study of Nonadiabatic Wall Effects on Aerodynamic Characteristics of CHN-T1 Standard Model
err2023-04-14
err0
errOAAI
errXiaobing Wang; Junqiang Wu; Jianzhong Chen; Yuping Li; Zhongliang Zhao; Guangyuan Liu; Yang Tao; Neng Xiong
err分享
err收藏
学者 查看更多内容