Vulnerability Analysiscvepatchanalysissecuritycodediff

PatchLeaks

PatchLeaks goes from a CVE number to the exact patched code and its vulnerability analysis. It compares two versions of a code-base, highlights lines changed by the vendor, and explains why they matter.

Description

PatchLeaks is a tool designed to analyze security patches for vulnerabilities identified by CVE numbers. Users feed the tool an old version and a patched version of a codebase, and it identifies the security fix, providing a detailed description to validate or weaponize the patch quickly.

The tool supports multiple programming languages such as PHP, JavaScript, and Python, allowing for targeted analysis based on the codebase in question. It runs as a server, binding to a specified host and port, and utilizes AI analysis with configurable thread counts for processing.

Ideal for security researchers, it spots changes made by vendors and explains their significance, making it easier to understand patch implications in real-world scenarios.

How It Works

PatchLeaks operates by comparing an old and patched version of a codebase to highlight vendor-changed lines. It identifies security fixes and generates detailed vulnerability analysis using AI, supporting specified languages like PHP, JavaScript, and Python. The tool runs a server on a bindable host and port, processing analysis with multiple threads.

Installation

bash
sudo apt install patchleaks

Flags

-hostHost address to bind to (default "127.0.0.1")
-languageComma-separated list of languages to test (php,javascript,python)
-pPort to run the server on (default: random free port)
-tNumber of threads for AI analysis (default: 1)
-test-real-worldTest with real-world data

Examples

Display usage help for PatchLeaks
PatchLeaks -h
Display usage help for patchleaks
patchleaks -h
Run PatchLeaks server on localhost port 8080
PatchLeaks -host 127.0.0.1 -p 8080
Run patchleaks testing PHP and JavaScript languages
patchleaks -language php,javascript
Run PatchLeaks with 4 threads for AI analysis
PatchLeaks -t 4
Run patchleaks with real-world test mode
patchleaks -test-real-world
Run PatchLeaks server accessible externally on port 3000 for Python
PatchLeaks -host 0.0.0.0 -p 3000 -language python
Updated 2026-04-16kali.org ↗