Skip to main navigation Skip to search Skip to main content

PATCHOULI: Fine-grained Security Patch Detection Engine

  • Binchang Li
  • , Qingyuan Li
  • , Cuiyun Gao*
  • , Qing Liao
  • *Corresponding author for this work
  • Harbin Institute of Technology Shenzhen
  • Nanjing University

Research output: Chapter in Book/Report/Conference proceedingConference contributionpeer-review

Abstract

Software vendors often distribute vulnerability fixes silently, putting the users under the threaten of N-day attacks. Therefore, security patch detection (SPD) is crucial for software security maintenance. Recent research has increasingly focused on learning-based SPD, achieving promising results. However, challenges still exist in this field: (1) the granularity of patch identification is coarse, typically at the file level, (2) limited support for multiple programming languages due to the requirements of project-level dependencies extracted by language-dependent tools. To tackle these challenges, we present PATCHOULI, a security patch detection tool featuring fine-grained detection, multi-language capability, and good interpretability supported by the addressed vulnerability classification. PATCHOULI provides a user-friendly interface and accepts code changes as the sole input. It leverages Qwen2.5-Coder-0.5B-Instruct to identify security-related code changes at both patch- and block-level granularities, and UniXcoder to recognize the repaired vulnerability types. PATCHOULI is trained on a multilingual dataset containing C/C++, Java, and Python, thereby enabling multi-language patch analysis capabilities. Moreover, the small size of the base models enables PATCHOULI to be deployed on CPU-only devices, further enhancing its usability. We compare PATCHOULI with six state-of-the-art foundation models on this task across multiple programming languages. Experiment results demonstrate that PATCHOULI achieves higher accuracy, F1 scores, and MCC compared to mainstream foundation models. We disclose a demo at https://huggingface.co/spaces/traveler514/patchouli, and a demonstration video at https://youtu.be/Spaa_k50slE.

Original languageEnglish
Title of host publicationProceedings - 2025 32nd Asia-Pacific Software Engineering Conference, APSEC 2025
EditorsTao Zhang, Xiapu Luo, Jacky Keung, Eunjong Choi
PublisherIEEE Computer Society
Pages1025-1028
Number of pages4
ISBN (Electronic)9798331566531
DOIs
StatePublished - 2025
Externally publishedYes
Event32nd Asia-Pacific Software Engineering Conference, APSEC 2025 - Macau, China
Duration: 2 Dec 20255 Dec 2025

Publication series

NameProceedings - Asia-Pacific Software Engineering Conference, APSEC
ISSN (Print)1530-1362

Conference

Conference32nd Asia-Pacific Software Engineering Conference, APSEC 2025
Country/TerritoryChina
CityMacau
Period2/12/255/12/25

Keywords

  • Foundation Model
  • Security Patch Detection
  • Software Vulnerability

Fingerprint

Dive into the research topics of 'PATCHOULI: Fine-grained Security Patch Detection Engine'. Together they form a unique fingerprint.

Cite this