CVE-2022-1271: Tukaani XZ Utils xzgrep Argument Injection Remote Code Execution Vulnerability

Published Apr 7, 2022
·
Updated

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.

Other sources

GNU gzip could allow a remote authenticated attacker to bypass security restrictions, caused by improper validation of file name by the zgrep utility. By using a specially-crafted file name, an attacker could exploit this vulnerability to write arbitrary files or execute arbitrary code on the system.

IBM

The following vulnerability was published for xz-utils and gzip The bug would result in arbitrary-file-write vulnerability

CVE-2022-1271[0]: | zgrep, xzgrep: arbitrary-file-write vulnerability

For further information see:

[0] https://security-tracker.debian.org/tracker/CVE-2022-1271 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-1271 [1] https://www.openwall.com/lists/oss-security/2022/04/07/8 [2] https://git.tukaani.org/?p=xz.git;a=commit;h=69d1b3fc29677af8ade8dc15dba83f0589cb63d6 [3] https://lists.gnu.org/r/bug-gzip/2022-04/msg00011.html

Red Hat

Affected Software

23 affected componentsFixes available
redhat/gzip<0:1.5-11.el7_9
0:1.5-11.el7_9
redhat/xz<0:5.2.2-2.el7_9
0:5.2.2-2.el7_9
redhat/gzip<0:1.9-13.el8_5
0:1.9-13.el8_5
redhat/xz<0:5.2.4-4.el8_6
0:5.2.4-4.el8_6
redhat/gzip<0:1.9-10.el8_1
0:1.9-10.el8_1
redhat/xz<0:5.2.4-4.el8_1
0:5.2.4-4.el8_1
redhat/gzip<0:1.9-10.el8_2
0:1.9-10.el8_2
redhat/xz<0:5.2.4-4.el8_2
0:5.2.4-4.el8_2
redhat/gzip<0:1.9-13.el8_4
0:1.9-13.el8_4
redhat/xz<0:5.2.4-4.el8_4
0:5.2.4-4.el8_4
redhat/xz<0:5.2.5-8.el9_0
0:5.2.5-8.el9_0
redhat/gzip<0:1.10-9.el9_0
0:1.10-9.el9_0
redhat/redhat-virtualization-host<0:4.3.23-20220622.0.el7_9
0:4.3.23-20220622.0.el7_9
IBM Security Guardium<=11.3
IBM Security Guardium<=11.4
IBM Security Guardium<=11.5
GNU gzip<1.12
redhat Jboss Data Grid=7.0.0
Debian Debian Linux=10.0
Tukaani XZ<5.2.5
redhat/gzip<1.12
1.12
debian/gzip
1.10-4+deb11u11.12-11.13-1
debian/xz-utils
5.2.5-2.1~deb11u15.4.1-15.8.1-15.8.3-1

Remediation

Information

Red Hat has investigated whether possible mitigation exists for this issue, and has not been able to identify a practical example. Please update the affected package as soon as possible.

Event History

Apr 7, 2022
CVE Published
12:00 AM
Apr 8, 2022
Data Sourced
via Red Hat·08:04 AM
DescriptionSeverityAffected Software
Aug 31, 2022
CVE Published
via MITRE·03:33 PM
Data Sourced
via MITRE·03:33 PM
DescriptionWeakness
Mar 9, 2026
Advisory Published
via ZDI·08:00 PM
Data Sourced
via ZDI·08:00 PM
DescriptionAffected Software
Apr 9, 2026
Data Sourced
via Debian·08:33 PM
DescriptionAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is CVE-2022-1271?

CVE-2022-1271 is a vulnerability in Tukaani XZ Utils that allows for remote code execution through argument injection in the xzgrep utility.

2

How does CVE-2022-1271 affect me?

If you are using Tukaani XZ Utils and running the xzgrep utility on an attacker-controlled file, this vulnerability could allow the attacker to overwrite content to an arbitrary file.

3

What is the severity of CVE-2022-1271?

CVE-2022-1271 has a severity rating of 8.8, which is classified as high.

4

How can I fix CVE-2022-1271?

To fix CVE-2022-1271, you should update Tukaani XZ Utils to the latest version available and apply any patches provided by the vendor.

5

Where can I find more information about CVE-2022-1271?

You can find more information about CVE-2022-1271 on the official CVE website or the vendor's security advisory page.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203