FuncVul: Function-Level Vulnerability Detection with LLMs and Code Chunks

This repository profile is provided by osrepos.com, an open source repository discovery platform.

FuncVul: Function-Level Vulnerability Detection with LLMs and Code Chunks

Summary

FuncVul is an innovative model designed to detect vulnerabilities at the function level in C/C++ and Python code, addressing a critical gap in software supply chain security. By leveraging large language models (LLMs) and a code chunk-based approach, FuncVul significantly improves the precision of vulnerability identification. The model demonstrates superior performance compared to existing state-of-the-art methods, achieving high accuracy and F1 scores across various datasets.

Repository Information

Analyzed by OSRepos on November 10, 2025

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

FuncVul is an advanced model for detecting vulnerabilities at the function level within C/C++ and Python codebases. Traditional vulnerability detection often focuses on entire packages or libraries, overlooking the specific functions responsible for weaknesses. FuncVul addresses this by employing an innovative code chunk-based approach combined with large language models (LLMs) to pinpoint precise vulnerable segments. This method significantly enhances the accuracy and granularity of vulnerability detection, making it a crucial tool for securing open-source software and mitigating supply chain risks. The project's research highlights its effectiveness, outperforming existing models and demonstrating substantial improvements by focusing on smaller, critical code segments.

Installation

To get started with FuncVul and its baseline models, you can clone the repository and run the main script. Detailed instructions for setting up the environment and dependencies are typically found within the repository.

git clone https://github.com/sajalhalder/FuncVul.git
cd FuncVul
python FuncVul+Baselines.py

For specific environment setup or dependency installation, please refer to the project's documentation within the GitHub repository.

Examples

FuncVul's research utilizes six distinct datasets to evaluate its performance, each structured to test different aspects of function-level vulnerability detection. These datasets are built using two primary approaches for labeling vulnerable samples: integrating patch information with LLMs, and leveraging LLMs alone.

The datasets include variations such as:

  • Code + Description Code Chunk: Vulnerable samples defined by LLM + Patch Information.
  • Code Code Chunk: Vulnerable samples defined by LLM + Patch Information.
  • Code + Description Generic Code Chunk: Vulnerable samples defined by LLM + Patch Information.
  • Code Generic Code Chunk: Vulnerable samples defined by LLM + Patch Information.
  • Code + Description Code Chunk: Vulnerable samples defined by LLM only.
  • Code Code Chunk: Vulnerable samples defined by LLM only.

Each dataset typically contains columns like cve (CVE number), code_chunks or generic_code_chunks (3-line based code chunks), vul_category (type of vulnerability, not used in experiment analysis), and label (vulnerable (1) or non-vulnerable (0)). The project also explores the impact of varying code chunk sizes (1, 3, 5, 7, 9, 10, 15, 20, 25 lines) for analysis.

Why Use FuncVul

FuncVul offers several compelling advantages for developers and security researchers:

  • Function-Level Precision: It identifies vulnerabilities at the specific function level, providing more granular and actionable insights than package-level detection.
  • LLM-Powered Detection: Leverages the power of Large Language Models and fine-tuned GraphCodeBERT to capture both syntactic and semantic aspects of code for robust analysis.
  • Code Chunk Approach: Its innovative code chunk-based methodology significantly improves detection accuracy and F1-score compared to analyzing full functions, making it more efficient and effective.
  • High Performance: Achieves impressive accuracy (87-92%) and F1 scores (86-92%) across diverse datasets, outperforming existing state-of-the-art models.
  • Multi-Language Support: Designed to detect vulnerabilities in both C/C++ and Python, covering a wide range of software projects.
  • Research-Backed: Supported by rigorous research, including an accepted paper at ESORICS 2025, demonstrating its scientific validity and practical utility.

Links

Related repositories

Similar repositories that may be relevant next.

Agent Sandbox: Secure Local Development for AI Coding Agents

Agent Sandbox: Secure Local Development for AI Coding Agents

August 17, 2026

Agent Sandbox provides a robust and secure local development environment specifically designed for collaborating with AI coding agents. It ensures minimal filesystem access, configurable network egress policies, and secure secret injection, protecting your local machine from potentially risky agent operations. This project supports various AI agents and integrates seamlessly with both CLI and popular IDE devcontainer setups.

agent-harnessagent-sandboxagents
AMD Skills: Empowering AI Agents with AMD's Optimized Software Stack

AMD Skills: Empowering AI Agents with AMD's Optimized Software Stack

August 16, 2026

AMD Skills is the official catalog of AI agent skills from AMD, designed to empower AI agents with optimized software for AMD hardware. This repository provides knowledge, scripts, and conventions for working with AMD's stack, enabling seamless integration with major coding agents like Cursor, Claude Code, OpenAI Codex, and Gemini CLI.

PythonAI AgentsMachine Learning
agent-tackle-box: A Terminal Debugger for LangGraph & LangChain Agents

agent-tackle-box: A Terminal Debugger for LangGraph & LangChain Agents

August 15, 2026

agent-tackle-box is a comprehensive toolkit for developing AI agents, featuring the powerful `agent-debugger`. This terminal debugger provides deep insights into LangGraph and LangChain agents. It allows developers to inspect state, monitor tool calls, and step through Python code, all within a unified Textual UI.

agent-debuggerai-agentslangchain
ADR: Uber's Enterprise Security System for AI Agents

ADR: Uber's Enterprise Security System for AI Agents

August 14, 2026

ADR (Agentic AI Detection and Response) is an enterprise security system developed by Uber to secure AI agents. It offers critical capabilities like observability, security benchmarking, and threat detection, ensuring the safe operation of both employee and customer-facing AI applications. This open-source project is deployed in production at Uber and was accepted to MLSys 2026.

PythonAI SecurityAgent Security

Source repository

Open the original repository on GitHub.

10 counted GitHub visits

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️