SecCodePLT: Una piattaforma unificata per valutare la sicurezza del codice GenAI.
SecCodePLT: A Unified Platform for Evaluating the Security of Code GenAI
October 14, 2024
Autori: Yu Yang, Yuzhou Nie, Zhun Wang, Yuheng Tang, Wenbo Guo, Bo Li, Dawn Song
cs.AI
Abstract
L'esistenza di lavori precedenti ha stabilito diversi benchmark per evidenziare i rischi di sicurezza associati a Code GenAI. Questi rischi si riflettono principalmente in due ambiti: il potenziale di un modello di generare codice non sicuro (codifica non sicura) e la sua utilità negli attacchi informatici (utilità per gli attacchi informatici). Sebbene questi benchmark abbiano compiuto progressi significativi, rimangono opportunità per ulteriori miglioramenti. Ad esempio, molti benchmark attuali tendono a concentrarsi maggiormente sulla capacità di un modello di fornire suggerimenti per gli attacchi piuttosto che sulla sua capacità di generare attacchi eseguibili. Inoltre, la maggior parte dei benchmark si basa pesantemente su metriche di valutazione statiche, che potrebbero non essere così precise come le metriche dinamiche come i casi di test superati. Al contrario, i benchmark verificati dagli esperti, pur offrendo dati di alta qualità, operano spesso su una scala più ridotta. Per colmare queste lacune, sviluppiamo SecCodePLT, una piattaforma di valutazione unificata e completa per i rischi dei Code GenAI. Per il codice non sicuro, introduciamo una nuova metodologia per la creazione di dati che combina esperti con la generazione automatica. La nostra metodologia garantisce la qualità dei dati consentendo al contempo una generazione su larga scala. Associamo inoltre campioni con casi di test per condurre una valutazione dinamica relativa al codice. Per l'utilità per gli attacchi informatici, creiamo un ambiente reale e costruiamo campioni per sollecitare un modello a generare attacchi effettivi, insieme a metriche dinamiche nel nostro ambiente. Conduci...
English
Existing works have established multiple benchmarks to highlight the security
risks associated with Code GenAI. These risks are primarily reflected in two
areas: a model potential to generate insecure code (insecure coding) and its
utility in cyberattacks (cyberattack helpfulness). While these benchmarks have
made significant strides, there remain opportunities for further improvement.
For instance, many current benchmarks tend to focus more on a model ability to
provide attack suggestions rather than its capacity to generate executable
attacks. Additionally, most benchmarks rely heavily on static evaluation
metrics, which may not be as precise as dynamic metrics such as passing test
cases. Conversely, expert-verified benchmarks, while offering high-quality
data, often operate at a smaller scale. To address these gaps, we develop
SecCodePLT, a unified and comprehensive evaluation platform for code GenAIs'
risks. For insecure code, we introduce a new methodology for data creation that
combines experts with automatic generation. Our methodology ensures the data
quality while enabling large-scale generation. We also associate samples with
test cases to conduct code-related dynamic evaluation. For cyberattack
helpfulness, we set up a real environment and construct samples to prompt a
model to generate actual attacks, along with dynamic metrics in our
environment. We conduct extensive experiments and show that SecCodePLT
outperforms the state-of-the-art (SOTA) benchmark CyberSecEval in security
relevance. Furthermore, it better identifies the security risks of SOTA models
in insecure coding and cyberattack helpfulness. Finally, we apply SecCodePLT to
the SOTA code agent, Cursor, and, for the first time, identify non-trivial
security risks in this advanced coding agent.Summary
AI-Generated Summary