Runtime Verification of Crypto APIs: An Empirical Study
Runtime Verification of Crypto APIs: An Empirical Study
复制标题
DOI:
10.1109/tse.2023.3301660
复制
发表时间:
2023-10
影响因子:
7.4
通讯作者:
Adriano Torres;P. Costa;L. Amaral;Jonata T. Pastro;R. Bonifácio;Marcelo d’Amorim;Owolabi Legunsen;E. Bodden;Edna Dias Canedo
中科院分区:
文献类型:
--
作者:
Adriano Torres;P. Costa;L. Amaral;Jonata T. Pastro;R. Bonifácio;Marcelo d’Amorim;Owolabi Legunsen;E. Bodden;Edna Dias Canedo
Misuse of cryptographic (crypto) APIs is a noteworthy cause of security vulnerabilities. For this reason, static analyzers were recently proposed for detecting crypto API misuses. They differ in strengths and weaknesses, and they might miss bugs. Motivated by the inherent limitations of static analyzers, this article reports on a study of runtime verification (RV) as a dynamic-analysis-based alternative for crypto API misuse detection. RV monitors program runs against formal specifications; it was shown to be effective and efficient for amplifying the bug-finding ability of software tests. We focus on the popular JCA crypto API and write 22 RV specifications based on expert-validated rules in a static analyzer. We monitor these specifications while running tests in five benchmarks. Lastly, we compare the accuracy of our RV-based approach, RVSec, with those of three state-of-the-art crypto API misuses detectors: CogniCrypt, CryptoGuard, and CryLogger. Results show that RVSec has higher accuracy in four benchmarks and is on par with CryptoGuard in the fifth. Overall, RVSec achieves an average ${\boldsymbol{F}}_{1}$ F 1 measure of 95%, compared with 83%, 78%, and 86% for CogniCrypt, CryptoGuard, and CryLogger, respectively. We highlight the strengths and limitations of these tools and show that RV is effective for detecting crypto API misuses. We also discuss how static and dynamic analysis can complement each other for detecting crypto API misuses.