The misuse of Java security APIs is a serious security problem in software development. Large language models can generate compilable code, while still misusing cryptographic and secure-communication APIs. We investigate whether external security evidence can reduce this risk and how retriever choice and evidence source shape the resulting programs. Our study evaluates the GPT-5.5 model and Llama-3.3-70B-Instruct model on 12 Java Cryptography Architecture (JCA) and Java Secure Socket Extension (JSSE) security functionalities under 11 prompt and evidence conditions, yielding 23,760 generated programs. We measure program validity, detected Java security API misuse, and the top-5 evidence selected by four full-corpus retrievers. Under task-only prompting, 58.5% of valid Llama-3.3-70B-Instruct-generated programs and 36.6% of valid GPT-5.5-generated programs contain detected security API misuse. Dense full-corpus retrieval reduces conditional misuse among valid programs by 29.0--32.7 and 22.4--31.0 percentage points, respectively. The retrievers show preferences for substantially different evidence types. BM25 and the OpenAI embedding retrievers favor official guidance, the Qwen embedding retriever favors code examples, and the Jina embedding retriever selects a more heterogeneous mixture. Under source-restricted retrieval, code examples yield the lowest observed conditional misuse for the Llama-3.3-70B-Instruct model, while explicit misuse patterns produce zero detected misuse cases for known benchmark patterns among 1,016 valid programs generated by the GPT-5.5 model, with validity reduced to 94.1%. External evidence can substantially reduce detected misuse in the evaluated settings, and the results motivate actionable evidence selection and post-generation validation.


翻译:暂无翻译

0
下载
关闭预览

相关内容

Java 是一门编程语言,拥有跨平台、面向对象、泛型编程等特性。
综述:面向移动端大语言模型的隐私与安全
专知会员服务
19+阅读 · 2025年9月7日
158页!天大等最新《大型语言模型安全:全面综述》
专知会员服务
51+阅读 · 2024年12月24日
大语言模型安全开发者手册:构建安全的 AI 应用程序
专知会员服务
36+阅读 · 2024年9月29日
【2024新书】大型语言模型安全开发者手册,250页pdf
专知会员服务
77+阅读 · 2024年2月12日
大语言模型安全现状与挑战
专知会员服务
89+阅读 · 2024年1月14日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
大数据安全技术浅析
计算机与网络安全
15+阅读 · 2019年4月24日
【推荐】用TensorFlow实现LSTM社交对话股市情感分析
机器学习研究会
11+阅读 · 2018年1月14日
网络安全态势感知浅析
计算机与网络安全
18+阅读 · 2017年10月13日
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
VIP会员
最新内容
软件定义无人机蜂群给防空带来全新压力
专知会员服务
5+阅读 · 10月13日
《半自主无人地面战车的互操作性》66页
专知会员服务
5+阅读 · 10月13日
迈向更智慧的军事情报
专知会员服务
5+阅读 · 10月12日
《美国陆军2026年野战手册 2-0 情报》
专知会员服务
5+阅读 · 10月12日
《基于启发式算法求解武器-目标分配问题》
专知会员服务
7+阅读 · 10月12日
《美陆军最新条令出版物 2-0 情报》
专知会员服务
8+阅读 · 10月10日
电子战测试与训练靶场:战前验证战备状态
专知会员服务
3+阅读 · 10月10日
《美国陆军如何作战》46页最新报告
专知会员服务
9+阅读 · 10月10日
相关基金
国家自然科学基金
0+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
20+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员