Secure-Miner: Improving Secure Code Generation for LLMs by Mining Secure Coding Practices
Abstract
Most existing research on secure code generation for Large Language Models (LLMs) heavily relies on disclosed vulnerability reports or synthetic datasets for fine-tuning. This approach frequently overlooks the diverse, secure coding practices that emerge naturally during real-world software development. This paper bridges this gap by proposing a novel framework to automatically extract and leverage secure practices observed in the wild to enhance secure code generation, with a particular focus on low-resource Common Weakness Enumerations (CWEs). Our methodology utilizes a multi-agent system consisting of: (1) a RegEx Agent that dynamically formulates security-related patterns based on CWE descriptions, optimized through an iterative feedback loop; (2) a Verification Agent that precisely identifies genuine secure functions from open-source repositories; and (3) a Refinement Agent that isolates core secure patterns by simplifying external dependencies to compile a high-quality dataset.
Create a lesson
Metadata
- Categories
- cs.CR, cs.SE
Related papers
From Binary to Source Code: Measuring LLMs Reverse Engineering Capabilities on Obfuscated Binaries
Shared title terminologycs.CRDavid Schmidt, Patrick Felbauer, Gabriel Gegenhuber et al.
Are DNSSEC Islands of Security a Practical Concern? Transport-Layer Fallbacks for Trust Recovery
Shared title terminologycs.CRAmogh R, Aditya Kulkarni, Tamal Das
A Secure, End-to-End Encrypted Protocol for Item Tracking via BLE Beacons
Shared title terminologycs.CRAvinatan Hassidim, David Lazarov, Yossi Matias et al.
Homogeneous control of security functions via cross-domain delegation
Shared title terminologycs.CRNicola Poidomani, Daniele Canavese, Daniele Bringhenti et al.
A General-Purpose Policy and Enforcement Layer for Secure Agent Tool Calls
Shared title terminologycs.CRShincheol Lee, Chansu Han, Takeshi Takahashi
CROSS-TRACE: Cost-Sensitive Linkage Auditing for Heterogeneous Security Alerts under Uncertain Evidence
Shared title terminologycs.CRHalil Dursunoglu, Kaan Sulkalar