Bui, Quang CuongQuang CuongBuiIannone, EmanueleEmanueleIannoneScandariato, RiccardoRiccardoScandariato2026-07-302026-07-302026-0333rd IEEE International Conference on Software Analysis, Evolution, and Reengineering, SANER 2026https://hdl.handle.net/11420/64129Mainstream techniques for Automated Vulnerability Repair (AVR) lean heavily on Large Language Models (LLMs) and treat the vulnerability repair as a code translation task. Yet, their effectiveness is limited due to the complex nature of vulnerability fixes and, possibly, the lack of training datasets in the Java programming language. On the other hand, templatebased Automated Program Repair (APR) remains a popular way to fix general bugs. However, only a few approaches have ever employed vulnerability-specific fix templates. This paper introduces VulTerminator, a novel repair approach for Java vulnerabilities that leverages both heuristic-based and data-driven fix templates. The former are specialized for certain vulnerability types, such as XML External Entity (XXE) injection, which can be more easily patched with predefined heuristics. The latter aim to repair a broader class of vulnerabilities by generating common patch templates with masks, which are later filled by a fine-tuned Masked Language Model (MLM). In this paper, we introduce a total of eleven fix templates distilled from real-world Java patches and evaluate VulTerminator on 106 vulnerabilities with test cases from Vul4J+, as well as on 169 unseen vulnerabilities from a newly curated dataset called Vul4JL. VulTerminator achieves the best overall repair performance, outperforming the state-of-the-art approaches by 7 % on Vul4J+ and 27 % on Vul4JL, as confirmed by manual inspection. Vulterminator managed to fix 10 vulnerabilities in Vul4J+ and 16 in Vul4JL that no other approach could do, mainly due to the contribution of heuristicbased templates.enAutomated Program RepairAutomated Vulnerability RepairLarge Language ModelsComputer Science, Information and General Works::006: Special computer methods::006.3: Artificial IntelligenceComputer Science, Information and General Works::005: Computer Programming, Programs, Data and Security::005.8: Computer SecurityVULTERMINATOR: bringing back template-based automated repair for fixing Java vulnerabilitiesConference Paper10.1109/SANER67736.2026.00038