Lightweight Yet Secure: Secure Scripting Language Generation via Lightweight LLMs
Keyang Zhang, Zeyu Chen, Xuan Feng, Dongliang Fang, Yaowen Zheng, Zhi Li, Limin Sun

TL;DR
This paper introduces PSSec, a framework that enhances lightweight LLMs to generate secure PowerShell scripts by combining data synthesis, fine-tuning, and self-debugging, addressing security gaps in code generation.
Contribution
The paper presents PSSec, a novel approach that improves security-aware code generation in lightweight LLMs through data synthesis, fine-tuning, and a self-debugging agent, outperforming general models.
Findings
Lightweight LLMs can be trained to generate more secure scripts.
PSSec-trained models match or surpass larger models in security tasks.
Security-aware models reduce inference costs significantly.
Abstract
The security of scripting languages such as PowerShell is critical given their powerful automation and administration capabilities, often exercised with elevated privileges. Today, securing these languages still demands substantial human effort to craft and enforce rules, imposing heavy burdens on typical administrators and creating critical production risks (e.g., misoperations that shut down servers).Large language models (LLMs) have demonstrated strong capabilities in code generation, vulnerability detection, and automated repair for languages like Python and JavaScript. However, their ability to assist with generating secure scripting-language code remains largely underexplored. In this paper, we present SecGenEval-PS, a benchmark designed to systematically evaluate LLMs on secure scripting generation, security analysis, and automated repair. Our results show that both proprietary…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Malware Detection Techniques · Security and Verification in Computing · Software Engineering Research
