Vulnerability · Published Aug 31, 2022 · Assigned by redhat
CVE-2022-1271
High 8.8
In plain English
A high-severity security flaw in gzip, xz-utils. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 5.5% (higher than 93% of all known vulnerabilities). Fixed versions are available - upgrade the affected package.
Official description
An arbitrary file write vulnerability was found in GNU gzip's zgrep utility. When zgrep is applied on the attacker's chosen file name (for example, a crafted file name), this can overwrite an attacker's content to an arbitrary attacker-selected file. This flaw occurs due to insufficient validation when processing filenames with two or more newlines where selected content and the target file names are embedded in crafted multi-line file names. This flaw allows a remote, low privileged attacker to force zgrep to write arbitrary files on the system.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:8 | gzip | 1.9-13.el8_5 | ALSA-2022:1537 |
| AlmaLinux:8 | xz | 5.2.4-4.el8_6 | ALSA-2022:4991 |
| AlmaLinux:9 | xz | 5.2.5-8.el9_0 | ALSA-2022:4940 |
| AlmaLinux:8 | xz-devel | 5.2.4-4.el8_6 | ALSA-2022:4991 |
| AlmaLinux:9 | xz-devel | 5.2.5-8.el9_0 | ALSA-2022:4940 |
| AlmaLinux:8 | xz-libs | 5.2.4-4.el8_6 | ALSA-2022:4991 |
| AlmaLinux:9 | xz-libs | 5.2.5-8.el9_0 | ALSA-2022:4940 |
| AlmaLinux:8 | xz-lzma-compat | 5.2.4-4.el8_6 | ALSA-2022:4991 |
| AlmaLinux:9 | xz-lzma-compat | 5.2.5-8.el9_0 | ALSA-2022:4940 |
| Alpine:v3.20 | gzip | 1.12-r0 | ALPINE-CVE-2022-1271 |
| Alpine:v3.21 | gzip | 1.12-r0 | ALPINE-CVE-2022-1271 |
| Alpine:v3.22 | gzip | 1.12-r0 | ALPINE-CVE-2022-1271 |
| Alpine:v3.23 | gzip | 1.12-r0 | ALPINE-CVE-2022-1271 |
| Alpine:v3.24 | gzip | 1.12-r0 | ALPINE-CVE-2022-1271 |
| Alpine:v3.20 | xz | 5.2.5-r1 | ALPINE-CVE-2022-1271 |
| Alpine:v3.21 | xz | 5.2.5-r1 | ALPINE-CVE-2022-1271 |
| Alpine:v3.22 | xz | 5.2.5-r1 | ALPINE-CVE-2022-1271 |
| Alpine:v3.23 | xz | 5.2.5-r1 | ALPINE-CVE-2022-1271 |
| Alpine:v3.24 | xz | 5.2.5-r1 | ALPINE-CVE-2022-1271 |
| Debian:12 | gzip | 1.12-1 | DEBIAN-CVE-2022-1271 |
| Debian:13 | gzip | 1.12-1 | DEBIAN-CVE-2022-1271 |
| Debian:14 | gzip | 1.12-1 | DEBIAN-CVE-2022-1271 |
| Debian:12 | xz-utils | 5.2.5-2.1 | DEBIAN-CVE-2022-1271 |
| Debian:13 | xz-utils | 5.2.5-2.1 | DEBIAN-CVE-2022-1271 |
| Debian:14 | xz-utils | 5.2.5-2.1 | DEBIAN-CVE-2022-1271 |
| Rocky Linux:8 | gzip | 0:1.9-13.el8_5 | RLSA-2022:1537 |
| Rocky Linux:9 | gzip | 0:1.10-9.el9_0 | RLSA-2022:4582 |
| Rocky Linux:8 | xz | 0:5.2.4-4.el8_6 | RLSA-2022:4991 |
| Rocky Linux:9 | xz | 0:5.2.5-8.el9_0 | RLSA-2022:4940 |
| Ubuntu:22.04:LTS | gzip | 1.10-4ubuntu4 | UBUNTU-CVE-2022-1271 |
| Ubuntu:22.04:LTS | xz-utils | 5.2.5-2ubuntu1 | UBUNTU-CVE-2022-1271 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| n/a | gzip, xz-utils | Fixed in gzip 1.12 |
Weakness: CWE-179 · Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- https://bugzilla.redhat.com/show_bug.cgi?id=2073310 x_refsource_MISC
- https://www.openwall.com/lists/oss-security/2022/04/07/8 x_refsource_MISC
- https://lists.gnu.org/r/bug-gzip/2022-04/msg00011.html x_refsource_MISC
- https://tukaani.org/xz/xzgrep-ZDI-CAN-16587.patch x_refsource_MISC
- https://git.tukaani.org/?p=xz.git%3Ba=commit%3Bh=69d1b3fc29677af8ade8dc15dba83f0589cb63d6 x_refsource_MISC
- https://security-tracker.debian.org/tracker/CVE-2022-1271 x_refsource_MISC
- https://access.redhat.com/security/cve/CVE-2022-1271 x_refsource_MISC
- GLSA-202209-01 vendor-advisory, x_refsource_GENTOO
- https://security.netapp.com/advisory/ntap-20220930-0006/ x_refsource_CONFIRM
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-455250.html