Localizing Patch Points From One Exploit

Shiqi Shen, Aashish Kolluri, Zhen Dong, Prateek Saxena, Abhik Roychoudhury

Abstract

Automatic program repair is a critical component of modern software security, yet identifying the precise location for a fix—patch localization—remains a significant bottleneck. This paper introduces PATCHLOC, a tool designed to pinpoint patch locations using only a single exploit and the program's binary. By employing a novel directed fuzzing technique called CONCFUZZ, PATCHLOC generates a "concentrated" test suite that enables highly accurate statistical fault localization without the need for source code or pre-existing test suites. Evaluation across 43 real-world CVEs demonstrates that PATCHLOC identifies the correct patch location in the top-5 recommendations for 88% of cases.

Introduction

The window of exposure between the discovery of a vulnerability and its remediation is a major security risk. Automatic program repair aims to close this gap through two steps: patch localization and patch synthesis. While synthesis techniques have advanced, localization often relies on source code availability or massive "passing" test suites, which are frequently unavailable in real-world exploit scenarios. Furthermore, traditional localization often identifies the crash site rather than the root cause. PATCHLOC addresses these challenges by working directly on binaries and requiring only one working exploit to initiate the localization process.

Methods

The PATCHLOC system architecture consists of two primary components: the CONCFUZZ engine and the Ranker.

CONCFUZZ (Concentrated Fuzzing)

Unlike general-purpose fuzzers that aim for broad code coverage, CONCFUZZ is a directed fuzzer that explores the immediate execution neighborhood of the provided exploit. It first constructs a Sensitivity Map to identify which input bytes influence specific code branches. It then mutates these bytes to generate a diverse set of inputs that stay close to the original exploit path, creating a mix of crashing and non-crashing executions.

The PATCHLOC workflow: CONCFUZZ generates a concentrated test suite via input mutation and sensitivity map inference, which is then processed by the Ranker to identify patch locations.

The Ranker

Using the concentrated test suite, PATCHLOC calculates two statistical metrics for every branch: Necessity (the likelihood a branch is executed during an exploit) and Sufficiency (the likelihood an execution results in an exploit if the branch is hit). The tool ranks candidate locations using the L2-norm of these normalized scores, typically recommending the top 5 locations.

Experimental Evaluation

PATCHLOC was evaluated on 43 real-world CVEs across 11 popular open-source applications, including LibTIFF, FFmpeg, and Binutils. These applications ranged from 10K to 2M lines of code and included various bug types such as buffer overflows, divide-by-zero errors, and heap use-after-free vulnerabilities. The tool utilized runtime instrumentation via DynamoRIO, ensuring it remains applicable to binary-only environments.

Key Results

PATCHLOC demonstrated high accuracy and efficiency in real-world scenarios. It successfully placed a valid patch location in the Top-5 recommendations for 38 out of 43 CVEs (88%). Notably, in 25 of these cases, the correct location was the top-ranked recommendation.

Experimental results showing PATCHLOC's performance across various applications and CVEs, including bug types, crash location proximity, and final ranking.

The tool proved efficient, typically requiring only four hours of fuzzing per vulnerability. It significantly outperformed existing directed fuzzers like AFLGo and traditional fault localization tools, particularly in identifying root causes that are distant from the eventual crash site.

Conclusion

PATCHLOC represents a significant step forward in binary-level vulnerability remediation. By focusing on "concentrated" fuzzing around an exploit path, it avoids the biases of general test suites and provides actionable patch locations with minimal initial data. Future work includes extending the tool to support multi-line patches and integrating the observed program states into automatic patch synthesis engines.

Summary updated

BibTeX
@misc{shen2020localizing,
  author = {Shiqi Shen and Aashish Kolluri and Zhen Dong and Prateek Saxena and Abhik Roychoudhury},
  title = {{Localizing Patch Points From One Exploit}},
  year = {2020},
  eprint = {2008.04516},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.04516},
}
Figure