Input Validation Vulnerability in patch(1) Utility

patch Updated 02 Oct 2025

Summary

16/04/2018
N/A
Yes i
Unrated
Not published

DLA-1348-1: patch - security update. Affects patch versions < 2.6.1-3+deb7u1. Fixed in 2.6.1-3+deb7u1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The patch(1) utility is a command-line tool used for applying patches to files. It is commonly used in software development to update source code files with changes or fixes. The utility reads a patch file and applies the changes specified in the file to the target file. This vulnerability affects the patch utility in Debian 7 Wheezy.

Vulnerability Detail

An input validation vulnerability was discovered in the patch(1) utility. The vulnerability allows an attacker to embed an ed(1) script in a regular input file, which can result in arbitrary code execution. This means that an attacker could potentially execute malicious code on a system by tricking the patch utility into executing the embedded script. The vulnerability was reported by Rachel Kroll and others.

How To Fix

Minimum fixed version

2.6.1-3+deb7u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade patch

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to apply the patch as soon as possible to mitigate the risk of exploitation.

Conclusion

The input validation vulnerability in the patch(1) utility can allow an attacker to execute arbitrary code on a system. It is important to upgrade the patch package to the fixed version to mitigate the risk of exploitation. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for patch →

Share this vulnerability

FAQ

The patch(1) utility is a command-line tool used for applying patches to files. It is commonly used in software development to update source code files with changes or fixes.

An ed(1) script is a script written in the ed text editor language. It is used for editing files in a non-interactive manner.

An attacker can exploit this vulnerability by crafting a regular input file that contains an embedded ed(1) script. When the patch utility processes this file, it will execute the embedded script, allowing the attacker to execute arbitrary code on the system.

Yes, this vulnerability has been fixed in patch version 2.6.1-3+deb7u1.

To upgrade the patch package, you can use the package manager to update the package to the latest version available in the official Debian repository. Alternatively, you can manually download and install the updated package from the official Debian website.

Related vulnerabilities

Recent vulnerabilities recorded for patch.

How To Fix

Minimum fixed version

2.6.1-3+deb7u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade patch

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback