Critical Vulnerability in GNU Patch Package: CVE-2018-20969

patch Updated 02 Oct 2025

Summary

16/08/2019
N/A
Yes i
High
7.8

ALPINE-CVE-2018-20969: do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! Affects patch versions < 2.7.6-r6. Fixed in 2.7.6-r6. 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

GNU Patch is a widely used utility that allows users to apply changes to files and manage patches in software development. It is essential for maintaining code integrity and facilitating collaboration among developers. However, certain versions of GNU Patch are vulnerable to a specific issue that can lead to unintended command execution, making it crucial for users to be aware of this vulnerability.

Vulnerability Detail

The vulnerability identified as CVE-2018-20969 exists in the do_ed_script function within pch.c of GNU Patch versions up to 2.7.6. This flaw allows attackers to exploit strings that begin with a '!' character, which can lead to unexpected behavior and potential command execution. This issue is particularly concerning as it can compromise the integrity of the patching process, allowing malicious alterations to be applied to files, which may result in data loss or unauthorized access.

How To Fix

Minimum fixed version

2.7.6-r6

This is the first release that contains the fix.

sudo apk add --upgrade patch

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

Workaround

As a temporary measure, users can avoid using patch files that contain strings beginning with a '!' character until the package is updated. This can help prevent exploitation of the vulnerability while a permanent fix is being implemented.

Conclusion

CVE-2018-20969 represents a significant vulnerability in the GNU Patch package, which can lead to serious security risks if not addressed. Users are strongly encouraged to update to the patched version to ensure the integrity and security of their systems.

See every vulnerability recorded for patch →

Share this vulnerability

FAQ

CVE-2018-20969 is a vulnerability in GNU Patch that allows for exploitation through strings starting with a '!' character, potentially leading to command execution.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The CVSS score for CVE-2018-20969 is 7.8, indicating a high severity level.

If an immediate update is not possible, avoid using patch files with '!' characters as a temporary workaround.

More information about GNU Patch can be found on its official website or through its documentation.

Related vulnerabilities

Recent vulnerabilities recorded for patch.

How To Fix

Minimum fixed version

2.7.6-r6

This is the first release that contains the fix.

sudo apk add --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