CVE-2018-1000156

NameCVE-2018-1000156
DescriptionGNU Patch version 2.7.6 contains an input validation vulnerability when processing patch files, specifically the EDITOR_PROGRAM invocation (using ed) can result in code execution. This attack appear to be exploitable via a patch file processed via the patch utility. This is similar to FreeBSD's CVE-2015-1418 however although they share a common ancestry the code bases have diverged over time.
SourceCVE (at NVD; CERT, LWN, oss-sec, fulldisc, Red Hat, Ubuntu, Gentoo, SUSE bugzilla/CVE, GitHub advisories/code/issues, web search, more)
ReferencesDLA-1348-1
Debian Bugs894993

Vulnerable and fixed packages

The table below lists information on source packages.

Source PackageReleaseVersionStatus
patch (PTS)sid, trixie, bookworm, bullseye2.7.6-7fixed

The information below is based on the following data on fixed versions.

PackageTypeReleaseFixed VersionUrgencyOriginDebian Bugs
patchsourcewheezy2.6.1-3+deb7u1DLA-1348-1
patchsourcejessie2.7.5-1+deb8u1
patchsourcestretch2.7.5-1+deb9u1
patchsource(unstable)2.7.6-2894993

Notes

Upstream bug: https://savannah.gnu.org/bugs/?53566
https://rachelbythebay.com/w/2018/04/05/bangpatch/
https://twitter.com/kurtseifried/status/982028968877436928
This CVE is specifically for GNU patch and relates to CVE-2015-1418
http://git.savannah.gnu.org/cgit/patch.git/commit/?id=123eaff0d5d1aebe128295959435b9ca5909c26d
Respective patch in FreeBSD: https://www.freebsd.org/security/advisories/FreeBSD-SA-15:18.bsdpatch.asc
Respective patch in OpenBSD: https://ftp.openbsd.org/pub/OpenBSD/patches/5.7/common/013_patch.patch.sig
(Functional) regression/issue introduced with only the initial commit:
https://savannah.gnu.org/bugs/?53820
https://bugzilla.suse.com/show_bug.cgi?id=1092500
Followup fixes needed to address https://bugs.debian.org/933140
http://git.savannah.gnu.org/cgit/patch.git/commit/?id=19599883ffb6a450d2884f081f8ecf68edbed7ee
http://git.savannah.gnu.org/cgit/patch.git/commit/?id=369dcccdfa6336e5a873d6d63705cfbe04c55727

Search for package or bug name: Reporting problems