CVE-2018-20969 Command injection in n/a

High 7.8 Published Updated

GNU patch fails to block ed script commands starting with an exclamation mark, allowing attackers to execute arbitrary commands via crafted patches.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Local or same network only
Victim action needed
A user has to click or open something
Fix
Available

What is CVE-2018-20969?

CVE-2018-20969 is a high-severity command injection vulnerability in n/a, published on 16 Aug 2019. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.

Official description

do_ed_script in pch.c in GNU patch through 2.7.6 does not block strings beginning with a ! character. NOTE: this is the same commit as for CVE-2019-13638, but the ! syntax is specific to ed, and is unrelated to a shell metacharacter.

Weakness: CWE-78

Which versions are affected by CVE-2018-20969?

It affects 1 product.

Products include Gnu Patch.

How do I fix CVE-2018-20969?

Apply the vendor's patch.

Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.

Is CVE-2018-20969 being exploited?

There is no known exploitation of CVE-2018-20969 in the wild and no public exploit code.

Sources

Also known as ALPINE-CVE-2018-20969, AZL-35102, AZL-6786, CLEANSTART-2026-JU77269, DEBIAN-CVE-2018-20969, GHSA-g5pm-269j-95rr and 2 more.

Is CVE-2018-20969 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free