Segmentation Fault Vulnerability in GNU Patch Package - CVE-2018-6951

patch Updated 02 Oct 2025

Summary

13/02/2018
N/A
Yes i
High
7.5

ALPINE-CVE-2018-6951: An issue was discovered in GNU patch through 2.7.6. Affects patch versions < 2.7.6-r2. Fixed in 2.7.6-r2. 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 Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

GNU Patch is a widely used utility that allows users to apply changes to files and manage patches. It is essential for software development and maintenance, enabling developers to update source code efficiently. However, certain versions of GNU Patch are vulnerable to a segmentation fault due to a NULL pointer dereference, which can lead to denial of service.

Vulnerability Detail

An issue was discovered in GNU Patch through version 2.7.6. The vulnerability arises from a segmentation fault in the intuit_diff_type function located in pch.c, which is triggered by a NULL pointer dereference. This flaw can cause the application to crash, leading to a denial of service. The vulnerability is classified under CVE-2018-6951, with a CVSS score of 7.5, indicating a high severity level.

How To Fix

Minimum fixed version

2.7.6-r2

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

If you cannot update the package immediately, consider avoiding the use of the affected function or limiting the input to prevent triggering the vulnerability. However, the best course of action is to apply the patch as soon as possible.

Conclusion

The CVE-2018-6951 vulnerability in GNU Patch poses a significant risk due to its potential to cause denial of service through a segmentation fault. It is crucial for users to update to the patched version to mitigate this risk effectively.

See every vulnerability recorded for patch →

Share this vulnerability

FAQ

CVE-2018-6951 is a vulnerability in GNU Patch that can cause a segmentation fault due to a NULL pointer dereference, leading to denial of service.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any signup.

The CVSS score of CVE-2018-6951 is 7.5, indicating a high severity level.

If you cannot update the package immediately, avoid using the affected function or limit the input to prevent triggering the vulnerability.

You can find more information about GNU Patch and its functionalities on the official GNU website or its documentation.

Related vulnerabilities

Recent vulnerabilities recorded for patch.

How To Fix

Minimum fixed version

2.7.6-r2

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