Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attacks
Cotroneo, Domenico, Improta, Cristina, Liguori, Pietro, Natella, Roberto
–arXiv.org Artificial Intelligence
AI-based code generators have become pivotal in assisting developers in writing software starting from natural language (NL). However, they are trained on large amounts of data, often collected from unsanitized online sources (e.g., GitHub, HuggingFace). As a consequence, AI models become an easy target for data poisoning, i.e., an attack that injects malicious samples into the training data to generate vulnerable code. To address this threat, we investigate the security of AI code generators by devising a targeted data poisoning strategy. We poison the training data by injecting increasing amounts of code containing security vulnerabilities and assess the attack's success on different state-of-the-art models for code generation. Our study shows that AI code generators are vulnerable to even a small amount of poison. Notably, the attack success strongly depends on the model architecture and poisoning rate, whereas it is not influenced by the type of vulnerabilities. Moreover, since the attack does not impact the correctness of code generated by pre-trained models, it is hard to detect. Lastly, our work offers practical insights into understanding and potentially mitigating this threat.
arXiv.org Artificial Intelligence
Nov-6-2023
- Country:
- Asia
- Middle East > Jordan (0.04)
- Singapore > Central Region
- Singapore (0.04)
- Europe
- Finland > Central Finland
- Jyväskylä (0.04)
- Greece (0.04)
- Ireland > Leinster
- County Dublin > Dublin (0.04)
- Italy > Campania
- Naples (0.04)
- Slovenia > Central Slovenia
- Municipality of Ljubljana > Ljubljana (0.04)
- Finland > Central Finland
- North America
- Canada
- United States
- California > San Diego County
- San Diego (0.04)
- District of Columbia > Washington (0.05)
- Massachusetts > Suffolk County
- Boston (0.04)
- New York > New York County
- New York City (0.04)
- California > San Diego County
- South America > Colombia
- Meta Department > Villavicencio (0.04)
- Asia
- Genre:
- Research Report > Experimental Study (0.68)
- Industry:
- Information Technology > Security & Privacy (1.00)
- Technology: