CVE-2018-6952
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
CVE-2018-6952 is a high vulnerability (CVSS 7.5) in Gnu Patch, published February 13, 2018. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 8.19%, the 94th percentile. Fixed in patch 2.7.6-r4.
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- High
Exploit likelihood
What each source reports
NVD Score used
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Weakness
- CWE-415
- Updated
- 2026-11-02
CVE List No score
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
CVE-2018-6952- Updated
- 2026-11-02
EUVDEUVD-2018-18696 No score
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
EUVD-2018-18696- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-ffqc-f68h-qq8w
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
GHSA-ffqc-f68h-qq8w- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-415
- Updated
- 2026-11-02
OSVALPINE-CVE-2018-6952
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
ALPINE-CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVAZL-35104
7.5
CVE-2018-6952 affecting package patch for versions less than 2.7.6-9
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
AZL-35104- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
Show 13 moreShow less
OSVAZL-6788
7.5
CVE-2018-6952 affecting package patch for versions less than 2.7.6-7
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
AZL-6788- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVBELL-CVE-2018-6952
7.5
CVE-2018-6952 does not affect BellSoft software
- Record
BELL-CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSV
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVDEBIAN-CVE-2018-6952
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
DEBIAN-CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVJLSEC-2026-15
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
JLSEC-2026-15- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - CVSS 2.0
- 5.0 Medium
AV:N/AC:L/Au:N/C:N/I:N/A:P - Updated
- 2026-11-02
OSVRHSA-2019:2033
3.3
Red Hat Security Advisory: patch security and bug fix update
- Record
RHSA-2019:2033- CVSS 3.0
- 3.3 Low
CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L - Updated
- 2026-11-02
OSVUBUNTU-CVE-2018-6952
7.5
A double free exists in the another_hunk function in pch.c in GNU patch through 2.7.6.
- Record
UBUNTU-CVE-2018-6952- CVSS 3.0
- 7.5 High
CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-02
OSVMGASA-2018-0448 No score
Updated patch packages fix security vulnerabilities
A NULL pointer dereference flaw was found in the way patch processed patch files. An attacker could potentially use this flaw to crash patch by tricking it into processing crafted patches (CVE-2018-6951).
A double-free flaw was found in the way the patch utility processed patch files. An attacker could potentially use this flaw to crash the patch utility by tricking it into processing crafted patches (CVE-2018-6952).
- Record
MGASA-2018-0448- Updated
- 2026-11-02
OSVopenSUSE-SU-2024:12060-1 No score
patch-2.7.6-5.1 on GA media
These are all security issues fixed in the patch-2.7.6-5.1 package on the GA media of openSUSE Tumbleweed.
- Record
openSUSE-SU-2024:12060-1- Updated
- 2026-11-02
OSVROOT-OS-DEBIAN-12-CVE-2018-6952 No score
CVE-2018-6952 in patch - Patched by Root
Root has patched CVE-2018-6952 in the patch package for Root:Debian:12. Multiple fixed versions available.
- Record
ROOT-OS-DEBIAN-12-CVE-2018-6952- Updated
- 2026-11-02
OSVROOT-OS-UBUNTU-2204-CVE-2018-6952 No score
CVE-2018-6952 in rootio-patch - Patched by Root
Root has patched CVE-2018-6952 in the rootio-patch package for Root:Ubuntu:22.04. Multiple fixed versions available.
- Record
ROOT-OS-UBUNTU-2204-CVE-2018-6952- Updated
- 2026-11-02
OSVSUSE-SU-2022:1925-1 No score
Security update for patch
This update for patch fixes the following issues:
Security issues fixed:
- CVE-2019-13636: Fixed follow symlinks unless --follow-symlinks is given. This increases the security against malicious patches (bsc#1142041).
- CVE-2018-6952: Fixed swapping fakelines in pch_swap. This bug was causing a double free leading to a crash (bsc#1080985).
Bugfixes:
- Abort when cleaning up fails. This bug could cause an infinite loop when a patch wouldn't apply, leading to a segmentation fault (bsc#1111572).
- Pass the correct stat to backup files. This bug would occasionally cause backup files to be missing when all hunks failed to apply (bsc#1198106).
- Record
SUSE-SU-2022:1925-1- Updated
- 2026-11-02
OSVSUSE-SU-2022:1932-1 No score
Security update for patch
This update for patch fixes the following issues:
Security fixes:
- CVE-2019-13636: Fixed mishandled following of symlinks in certain cases other than input files (bsc#1142041).
- CVE-2018-6952: Fixed double free of memory in pch.c:another_hunk() (bsc#1080985).
Bugfixes:
- Pass the correct stat to backup files (bsc#1198106).
- Fix temporary file leak when applying ed-style patches (bsc#1092500).
- Record
SUSE-SU-2022:1932-1- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
patchAlpine:v3.10 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.11 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.12 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.13 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.14 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.15 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.16 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.17 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.18 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.19 |
before 2.7.6-r4 | 2.7.6-r4 |
Show 42 moreShow less
| Package | Affected | Fixed |
|---|---|---|
patchAlpine:v3.20 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.21 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.22 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.23 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.24 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.7 |
before 2.7.6-r0 | 2.7.6-r0 |
patchAlpine:v3.8 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAlpine:v3.9 |
before 2.7.6-r4 | 2.7.6-r4 |
patchAzure Linux:3 |
before 2.7.6-9 | 2.7.6-9 |
patchAzure Linux:2 |
before 2.7.6-7 | 2.7.6-7 |
patchDebian:12 |
All versions, plus listed versions 2.7.6-72.8-12.8-2 |
None known |
patchDebian:13 |
All versions, plus listed versions 2.8-2 |
None known |
patchDebian:14 |
All versions, plus listed versions 2.8-2 |
None known |
patch_jllJulia |
before 2.8.0+0 | 2.8.0+0 |
patchMageia:6 |
before 2.7.6-1.1.mga6 | 2.7.6-1.1.mga6 |
patchRed Hat:enterprise_linux:7::client |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patch-debuginfoRed Hat:enterprise_linux:7::client |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patchRed Hat:enterprise_linux:7::computenode |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patch-debuginfoRed Hat:enterprise_linux:7::computenode |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patchRed Hat:enterprise_linux:7::server |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patch-debuginfoRed Hat:enterprise_linux:7::server |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patchRed Hat:enterprise_linux:7::workstation |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patch-debuginfoRed Hat:enterprise_linux:7::workstation |
before 0:2.7.1-11.el7 | 0:2.7.1-11.el7 |
patchRoot:Debian:12 |
before 2.7.6-7.aikido.7 | 2.7.6-7.aikido.72.7.6-7.root.io.52.7.6-7.root.io.22.7.6-7.root.io.42.7.6-7.root.io.12.7.6-7.root.io.62.7.6-7.root.io.3 |
rootio-patchRoot:Debian:12 |
before 2.7.6-7.aikido.7 | 2.7.6-7.aikido.72.7.6-7.root.io.52.7.6-7.root.io.22.7.6-7.root.io.42.7.6-7.root.io.12.7.6-7.root.io.62.7.6-7.root.io.3 |
rootio-patchRoot:Ubuntu:22.04 |
before 2.7.6-7build2.aikido.3 | 2.7.6-7build2.aikido.32.7.6-7build2.root.io.12.7.6-7build2.root.io.2 |
patchSUSE:Linux Enterprise Module for Basesystem 15 SP3 |
before 2.7.6-150000.5.3.1 | 2.7.6-150000.5.3.1 |
patchSUSE:Linux Enterprise Module for Basesystem 15 SP4 |
before 2.7.6-150000.5.3.1 | 2.7.6-150000.5.3.1 |
patchopenSUSE:Leap 15.3 |
before 2.7.6-150000.5.3.1 | 2.7.6-150000.5.3.1 |
patchopenSUSE:Leap 15.4 |
before 2.7.6-150000.5.3.1 | 2.7.6-150000.5.3.1 |
patchSUSE:Linux Enterprise Server 12 SP5 |
before 2.7.5-8.8.1 | 2.7.5-8.8.1 |
patchSUSE:Linux Enterprise Server for SAP Applications 12 SP5 |
before 2.7.5-8.8.1 | 2.7.5-8.8.1 |
patchUbuntu:Pro:14.04:LTS |
All versions, plus listed versions 2.7.1-32.7.1-42.7.1-4ubuntu12.7.1-4ubuntu22.7.1-4ubuntu2.32.7.1-4ubuntu2.42.7.1-4ubuntu2.4+esm1 |
None known |
patchUbuntu:16.04:LTS |
All versions, plus listed versions 2.7.5-12.7.5-1ubuntu0.16.04.12.7.5-1ubuntu0.16.04.2 |
None known |
patchUbuntu:18.04:LTS |
All versions, plus listed versions 2.7.5-1build12.7.6-12.7.6-2ubuntu12.7.6-2ubuntu1.1 |
None known |
patchUbuntu:20.04:LTS |
All versions, plus listed versions 2.7.6-6 |
None known |
patchUbuntu:22.04:LTS |
All versions, plus listed versions 2.7.6-72.7.6-7build12.7.6-7build2 |
None known |
patchUbuntu:24.04:LTS |
All versions, plus listed versions 2.7.6-7build22.7.6-7build3 |
None known |
patchUbuntu:25.10 |
All versions, plus listed versions 2.7.6-7build32.8-12.8-2 |
None known |
patchUbuntu:26.10 |
All versions, plus listed versions 2.8-2build1 |
None known |
patchUbuntu:26.04:LTS |
All versions, plus listed versions 2.8-22.8-2build1 |
None known |
patchopenSUSE:Tumbleweed |
before 2.7.6-5.1 | 2.7.6-5.1 |
History
| When | Changed | Sources |
|---|---|---|
| 2026-11-03 | aliases | EUVD |
| 2026-11-02 | created | CVE List, GitHub Advisories, NVD, OSV |
References
savannah.gnu.org/bugs/index.php?53133
securityfocus.com/bid/103047
security.gentoo.org/glsa/201904-17
access.redhat.com/errata/RHSA-2019:2033
nvd.nist.gov/vuln/detail/CVE-2018-6952
github.com/advisories/GHSA-ffqc-f68h-qq8w
Show 29 moreShow less
security.alpinelinux.org/vuln/CVE-2018-6952
docs.bell-sw.com/security/cves/CVE-2018-6952
security-tracker.debian.org/tracker/CVE-2018-6952
advisories.mageia.org/MGASA-2018-0448.html
bugs.mageia.org/show_bug.cgi?id=23704
lists.fedoraproject.org/archives/list/[email protected]/thread/DTAZPKCAJTAOK6CYQP7SPWNXDIAG4A37
access.redhat.com/security/updates/classification
access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/7.7_release_notes/index
bugzilla.redhat.com/show_bug.cgi?id=1545053
bugzilla.redhat.com/show_bug.cgi?id=1545405
bugzilla.redhat.com/show_bug.cgi?id=1626473
bugzilla.redhat.com/show_bug.cgi?id=1653294
security.access.redhat.com/data/csaf/v2/advisories/2019/rhsa-2019_2033.json
access.redhat.com/security/cve/CVE-2016-10713
cve.org/CVERecord?id=CVE-2016-10713
nvd.nist.gov/vuln/detail/CVE-2016-10713
savannah.gnu.org/bugs/index.php?45990
access.redhat.com/security/cve/CVE-2018-6952
cve.org/CVERecord?id=CVE-2018-6952
suse.com/support/update/announcement/2022/suse-su-20221925-1
bugzilla.suse.com/1080985
bugzilla.suse.com/1111572
bugzilla.suse.com/1142041
bugzilla.suse.com/1198106
suse.com/security/cve/CVE-2018-6952
suse.com/security/cve/CVE-2019-13636
suse.com/support/update/announcement/2022/suse-su-20221932-1
bugzilla.suse.com/1092500
ubuntu.com/security/CVE-2018-6952