SecCodePLT: コードGenAIのセキュリティ評価のための統合プラットフォーム
SecCodePLT: A Unified Platform for Evaluating the Security of Code GenAI
October 14, 2024
著者: Yu Yang, Yuzhou Nie, Zhun Wang, Yuheng Tang, Wenbo Guo, Bo Li, Dawn Song
cs.AI
要旨
既存の研究では、Code GenAIに関連するセキュリティリスクを強調するために複数のベンチマークが確立されています。これらのリスクは主に、安全でないコードを生成する可能性(安全でないコーディング)とサイバー攻撃(サイバー攻撃の有用性)に反映されます。これらのベンチマークは大きな進展を遂げていますが、さらなる改善の機会が残されています。例えば、現在の多くのベンチマークは、攻撃提案を行う能力よりも実行可能な攻撃を生成する能力に焦点を当てている傾向があります。さらに、ほとんどのベンチマークは静的評価メトリクスに大きく依存しており、パッシングテストケースなどの動的メトリクスほど正確でない可能性があります。一方、専門家によって検証されたベンチマークは、高品質のデータを提供する一方で、しばしば規模が小さいという特徴があります。これらのギャップに対処するために、私たちはCode GenAIのリスクのための統一された包括的な評価プラットフォームであるSecCodePLTを開発しました。安全でないコードについては、専門家と自動生成を組み合わせたデータ作成の新しい方法論を導入しています。この方法論により、データの品質を確保しつつ大規模な生成が可能となります。また、サンプルをテストケースに関連付けてコードに関連する動的評価を実施しています。サイバー攻撃の有用性については、実環境を設定し、モデルに実際の攻撃を生成させるためのサンプルを構築し、環境内で動的メトリクスを使用しています。私たちは広範囲な実験を行い、SecCodePLTがセキュリティの関連性において最先端のベンチマークであるCyberSecEvalを上回ることを示しています。さらに、SecCodePLTは、安全でないコーディングとサイバー攻撃の有用性における最先端モデルのセキュリティリスクをよりよく特定します。最後に、SecCodePLTを最先端のコードエージェントであるCursorに適用し、この高度なコーディングエージェントにおいて非自明なセキュリティリスクを初めて特定します。
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