Input Validation Vulnerability in patch(1) Utility
Summary
DLA-1348-1: patch - security update. Affects patch versions < 2.6.1-3+deb7u1. Fixed in 2.6.1-3+deb7u1. How to fix ↓
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.
No signup required · Results in about 60 seconds
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 →
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.