AUTOMATED DETECTION AND PATCHING OF CODE DEPLOYMENT VULNERABILITIES USING GENERATIVE AI IN A CLOUD-NATIVE ENVIRONMENT

Cloud-native teams ship code to production within hours, and security checks in the delivery pipeline must keep pace. Static analysis tools used in these pipelines detect weaknesses by matching rules, produce warnings that developers learn to ignore, and none of the widely used open-source tools proposes a corrected version of the vulnerable code. This paper presents a framework that uses a fine-tuned generative AI model to detect, explain, classify and patch JavaScript vulnerabilities inside a cloud-native workflow. The DeepSeek-R1-Distill-Qwen-7B reasoning model is fine-tuned with low-rank adapters (LoRA) on a JavaScript subset of the CrossVul dataset that covers seven CWE classes. A distillation pipeline converts pairs of vulnerable and fixed code from CVE-fixing commits into four-part conversations, so that one inference returns the vulnerable code, an explanation, a patch and a CWE label. The model is exported in GGUF Q4_K_M format and published on Hugging Face. A Next.js dashboard scans repositories on demand, and a GitHub Actions workflow scans pull requests, comments on them and fails the check. The training set-up was validated with a ten-step run and the integration was tested on a small repository. The model described the SQL injection in one test file correctly, produced a questionable finding for another, and did not show a patch in either scan, so the paper makes no claim about detection accuracy or patch quality. A feature comparison with ESLint, Semgrep, SonarQube and CodeQL shows that the framework is the only one designed to give case-specific explanations and patches. A full training run and a benchmark evaluation are identified as the next steps.

Authors

Institutions

Publication Details

Journal
Zenodo (CERN European Organization for Nuclear Research)
Published
2026-11-03
DOI
https://doi.org/10.5281/zenodo.23912009
Primary Topic
Web Application Security Vulnerabilities
Type
preprint
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
preprint

AUTOMATED DETECTION AND PATCHING OF CODE DEPLOYMENT VULNERABILITIES USING GENERATIVE AI IN A CLOUD-NATIVE ENVIRONMENT

Dhanushka Weerasinghe
Zenodo (CERN European Organization for Nuclear Research)
Web Application Security Vulnerabilities
preprint

AUTOMATED DETECTION AND PATCHING OF CODE DEPLOYMENT VULNERABILITIES USING GENERATIVE AI IN A CLOUD-NATIVE ENVIRONMENT

Dhanushka Weerasinghe
preprint en

Abstract

Cloud-native teams ship code to production within hours, and security checks in the delivery pipeline must keep pace. Static analysis tools used in these pipelines detect weaknesses by matching rules, produce warnings that developers learn to ignore, and none of the widely used open-source tools proposes a corrected version of the vulnerable code. This paper presents a framework that uses a fine-tuned generative AI model to detect, explain, classify and patch JavaScript vulnerabilities inside a cloud-native workflow. The DeepSeek-R1-Distill-Qwen-7B reasoning model is fine-tuned with low-rank adapters (LoRA) on a JavaScript subset of the CrossVul dataset that covers seven CWE classes. A distillation pipeline converts pairs of vulnerable and fixed code from CVE-fixing commits into four-part conversations, so that one inference returns the vulnerable code, an explanation, a patch and a CWE label. The model is exported in GGUF Q4_K_M format and published on Hugging Face. A Next.js dashboard scans repositories on demand, and a GitHub Actions workflow scans pull requests, comments on them and fails the check. The training set-up was validated with a ten-step run and the integration was tested on a small repository. The model described the SQL injection in one test file correctly, produced a questionable finding for another, and did not show a patch in either scan, so the paper makes no claim about detection accuracy or patch quality. A feature comparison with ESLint, Semgrep, SonarQube and CodeQL shows that the framework is the only one designed to give case-specific explanations and patches. A full training run and a benchmark evaluation are identified as the next steps.

Zenodo (CERN European Organization for Nuclear Research)
Sri Lanka Institute of Information Technology (LK)
Web Application Security Vulnerabilities
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

Laika access coming soon
AUTOMATED DETECTION AND PATCHING OF CODE DEPLOYMENT VULNERABILITIES USING GENERATIVE AI IN A CLOUD-NATIVE ENVIRONMENT — Dhanushka Weerasinghe · Zenodo (CERN European Organization for Nuclear Research) (2026) | TGRS Research Map | TGRS