cve.bz

CVE-2022-1271 Improper Input Validation

8.8 highEPSS 5.5%Fix available

High (8.8). EPSS 5.5% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

8.8 high
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS
5.5% (unchanged from 5.5% a week ago; 5.2% 30 days ago) estimated probability of exploitation activity in the next 30 days; 93rd percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2025-06-09. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-20 Improper Input Validation
CWE-179 Incorrect Behavior Order: Early Validation
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-1271 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-1271?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-1271?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2022-1271 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Badge for a README or a site

CVE-2022-1271

An image that stays current: it is drawn from the data each time it is fetched (a host that proxies images, as GitHub does, may show its copy for a while). Markdown:

[![CVE-2022-1271](https://cve.bz/cve/badge/CVE-2022-1271.svg)](https://cve.bz/cve/CVE-2022-1271)

HTML:

<a href="https://cve.bz/cve/CVE-2022-1271"><img src="https://cve.bz/cve/badge/CVE-2022-1271.svg" alt="CVE-2022-1271"></a>

Affected

Versions

From the NVD's CPE matches.

ProductAffected
gnu:gzipbefore 1.12
redhat:jboss_data_grid7.0.0
debian:debian_linux10.0
tukaani:xzbefore 5.2.5

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian9gzip1.6-5+deb9u1DLA-2976-1
Debian9xz-utils5.2.2-1.2+deb9u1DLA-2977-1
Debian10gzip1.9-3+deb10u1DSA-5122-1
Debian10xz-utils5.2.4-1+deb10u1DSA-5123-1
Debian11gzip1.10-4+deb11u1DSA-5122-1
Debian11xz-utils5.2.5-2.1~deb11u1DSA-5123-1
Debian12, 13, 14gzip1.12-1DEBIAN-CVE-2022-1271
Debian12, 13, 14xz-utils5.2.5-2.1DEBIAN-CVE-2022-1271
Ubuntu18.04:LTSgzip1.6-5ubuntu1.2UBUNTU-CVE-2022-1271 USN-5378-1
Ubuntu18.04:LTSxz-utils5.2.2-1.3ubuntu0.1UBUNTU-CVE-2022-1271 USN-5378-2
Ubuntu20.04:LTSgzip1.10-0ubuntu4.1UBUNTU-CVE-2022-1271 USN-5378-1
Ubuntu20.04:LTSxz-utils5.2.4-1ubuntu1.1UBUNTU-CVE-2022-1271 USN-5378-2
Ubuntu22.04:LTSgzip1.10-4ubuntu4UBUNTU-CVE-2022-1271
Ubuntu22.04:LTSxz-utils5.2.5-2ubuntu1UBUNTU-CVE-2022-1271
UbuntuPro:14.04:LTSgzip1.6-3ubuntu1+esm1UBUNTU-CVE-2022-1271 USN-5378-4
UbuntuPro:14.04:LTSxz-utils5.1.1alpha+20120614-2ubuntu2.14.04.1+esm1UBUNTU-CVE-2022-1271 USN-5378-3
UbuntuPro:16.04:LTSgzip1.6-4ubuntu1+esm1UBUNTU-CVE-2022-1271 USN-5378-4
UbuntuPro:16.04:LTSxz-utils5.1.1alpha+20120614-2ubuntu2.16.04.1+esm1UBUNTU-CVE-2022-1271 USN-5378-3
Red Hatenterprise_linux:7::client, enterprise_linux:7::server, enterprise_linux:7::workstationgzip, gzip-debuginfo0:1.5-11.el7_9RHSA-2022:2191
Red Hatenterprise_linux:7::client, enterprise_linux:7::server, enterprise_linux:7::workstationxz, xz-libs, xz-devel and 3 more0:5.2.2-2.el7_9RHSA-2022:5052
Red Hatenterprise_linux:7::computenodexz-devel, xz-debuginfo, xz-compat-libs and 1 more0:5.2.2-2.el7_9RHSA-2022:5052
Red Hatenterprise_linux:7::hypervisorredhat-virtualization-host, redhat-virtualization-host-image-update0:4.3.23-20220622.0.el7_9RHSA-2022:5439
Red Hatenterprise_linux:8::baseosgzip, gzip-debuginfo, gzip-debugsource0:1.9-13.el8_5RHSA-2022:1537
Red Hatenterprise_linux:8::baseosxz, xz-libs, xz-devel and 4 more0:5.2.4-4.el8_6RHSA-2022:4991
Red Hatenterprise_linux:8::crbxz-debuginfo, xz-debugsource, xz-lzma-compat and 2 more0:5.2.4-4.el8_6RHSA-2022:4991
Red Hatenterprise_linux:9::appstreamxz-devel, xz-debuginfo, xz-debugsource and 3 more0:5.2.5-8.el9_0RHSA-2022:4940
Red Hatenterprise_linux:9::baseosgzip, gzip-debuginfo, gzip-debugsource0:1.10-9.el9_0RHSA-2022:4582
Red Hatenterprise_linux:9::baseosxz, xz-libs, xz-debuginfo and 3 more0:5.2.5-8.el9_0RHSA-2022:4940
Red Hatrhel_e4s:8.1::baseosgzip, gzip-debuginfo, gzip-debugsource0:1.9-10.el8_1RHSA-2022:1592
Red Hatrhel_e4s:8.1::baseosxz, xz-libs, xz-devel and 4 more0:5.2.4-4.el8_1RHSA-2022:4994
7 more for Red Hat in the JSON and on Red Hat's page.
SUSEEnterprise Storage 6, Enterprise Storage 7, Linux Enterprise High Performance Computing 15 SP1-ESPOS and 21 morexz5.2.3-150000.4.7.1SUSE-SU-2022:1158-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 moregzip1.10-150000.4.12.1SUSE-SU-2022:1250-1
SUSEEnterprise Storage 6, Linux Enterprise High Performance Computing 15 SP1-ESPOS, Linux Enterprise High Performance Computing 15 SP1-LTSS and 7 moregzip1.10-150000.4.15.1SUSE-SU-2022:1674-1
SUSEEnterprise Storage 7, Linux Enterprise High Performance Computing 15 SP2-ESPOS, Linux Enterprise High Performance Computing 15 SP2-LTSS and 12 moregzip1.10-150200.10.1SUSE-SU-2022:1617-1
SUSEHPE Helion OpenStack 8, Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL and 11 morexz5.0.5-6.7.1SUSE-SU-2022:1160-1
SUSEHPE Helion OpenStack 8, Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL and 8 moregzip1.6-9.6.2SUSE-SU-2022:1275-1
SUSEHPE Helion OpenStack 8, Linux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL and 8 moregzip1.6-9.9.1SUSE-SU-2022:1673-1
SUSELinux Enterprise Point of Sale 11 SP3, Linux Enterprise Server 11 SP4-LTSSxz5.0.3-0.12.7.1SUSE-SU-2022:14938-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5gzip1.10-4.11.3SUSE-SU-2022:1272-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5gzip1.10-4.14.1SUSE-SU-2022:1650-1
openSUSELeap 15.3xz5.2.3-150000.4.7.1SUSE-SU-2022:1158-1
openSUSELeap 15.3, Leap 15.4gzip1.10-150200.10.1SUSE-SU-2022:1617-1
openSUSETumbleweedapparmor3.0.4-4.1openSUSE-SU-2024:11987-1
openSUSETumbleweedgzip1.12-1.1openSUSE-SU-2024:11992-1
openSUSETumbleweedxz5.2.6-1.1openSUSE-SU-2024:12271-1
AlmaLinux8gzip1.9-13.el8_5ALSA-2022:1537
AlmaLinux8xz, xz-libs, xz-devel and 1 more5.2.4-4.el8_6ALSA-2022:4991
AlmaLinux9xz, xz-libs, xz-devel and 1 more5.2.5-8.el9_0ALSA-2022:4940
Rocky Linux8gzip0:1.9-13.el8_5RLSA-2022:1537
Rocky Linux8xz0:5.2.4-4.el8_6RLSA-2022:4991
Rocky Linux9gzip0:1.10-9.el9_0RLSA-2022:4582
Rocky Linux9xz0:5.2.5-8.el9_0RLSA-2022:4940
Alpinev3.12, v3.13, v3.14 and 10 moregzip1.12-r0ALPINE-CVE-2022-1271
Alpinev3.12, v3.13, v3.14 and 10 morexz5.2.5-r1ALPINE-CVE-2022-1271
Azure Linux2gzip1.12-1AZL-10819

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; the Alpine secdb, CC BY-SA 4.0; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE · Alpine.

Red Hat

Red Hat rates this Important.

Red Hat's statement

This bug was introduced in gzip-1.3.10 and is relatively hard to exploit.

Red Hat Enterprise Linux 6 was affected but Out of Support Cycle because gzip was not listed in Red Hat Enterprise Linux 6 ELS Inclusion List.

https://access.redhat.com/articles/4997301

Red Hat's mitigation

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.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 7gzip-0:1.5-11.el7_9Fixed 2022-05-11RHSA-2022:2191
Red Hat Enterprise Linux 7xz-0:5.2.2-2.el7_9Fixed 2022-06-15RHSA-2022:5052
Red Hat Enterprise Linux 8gzip-0:1.9-13.el8_5Fixed 2022-04-26RHSA-2022:1537
Red Hat Enterprise Linux 8xz-0:5.2.4-4.el8_6Fixed 2022-06-13RHSA-2022:4991
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionsgzip-0:1.9-10.el8_1Fixed 2022-04-26RHSA-2022:1592
Red Hat Enterprise Linux 8.1 Update Services for SAP Solutionsxz-0:5.2.4-4.el8_1Fixed 2022-06-13RHSA-2022:4994
Red Hat Enterprise Linux 8.2 Extended Update Supportgzip-0:1.9-10.el8_2Fixed 2022-05-02RHSA-2022:1665
Red Hat Enterprise Linux 8.2 Extended Update Supportxz-0:5.2.4-4.el8_2Fixed 2022-06-13RHSA-2022:4992
Red Hat Enterprise Linux 8.4 Extended Update Supportgzip-0:1.9-13.el8_4Fixed 2022-05-03RHSA-2022:1676
Red Hat Enterprise Linux 8.4 Extended Update Supportxz-0:5.2.4-4.el8_4Fixed 2022-06-13RHSA-2022:4993
Red Hat Enterprise Linux 9xz-0:5.2.5-8.el9_0Fixed 2022-06-08RHSA-2022:4940
Red Hat Enterprise Linux 9gzip-0:1.10-9.el9_0Fixed 2022-05-17RHSA-2022:4582
Red Hat Virtualization 4 for Red Hat Enterprise Linux 7redhat-virtualization-host-0:4.3.23-20220622.0.el7_9Fixed 2022-07-01RHSA-2022:5439
Red Hat Virtualization 4 for Red Hat Enterprise Linux 8redhat-virtualization-host-0:4.5.0-202205291010_8.6Fixed 2022-06-03RHSA-2022:4896
Red Hat Enterprise Linux 6gzipOut of support scope
Red Hat Enterprise Linux 6xzOut of support scope
Red Hat JBoss Data Grid 7gzipAffected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2022-1271.

ICS advisories (CISA)

AdvisoryTitlePublishedSectorsAffectedFixed
ICSA-24-102-04Siemens RUGGEDCOM APE18082024-04-09Critical Manufacturing, Transportation Systems, Energy, Healthcare and Public Health, Financial Services, Government Services and FacilitiesRUGGEDCOM APE1808none listed
ICSA-23-348-10Siemens SIMATIC S7-15002023-12-12Critical Manufacturing, Transportation Systems, Energy, Healthcare and Public Health, Financial Services, Government Services and FacilitiesSIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AB0), SIMATIC S7-1500 CPU 1518-4 PN/DP MFP (6ES7518-4AX00-1AC0), SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP (6ES7518-4FX00-1AB0) and 2 morenone listed

From CISA's ICS advisories (CSAF), provided under CISA's notification. Only the facts are shown; each advisory is on CISA's page. Credits.

Attack patterns (CAPEC)

  • CAPEC-3 Using Leading 'Ghost' Character Sequences to Bypass Input Filters Likelihood: Medium · Severity: Medium
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-71 Using Unicode Encoding to Bypass Validation Logic Likelihood: Medium · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-20 (51).

References

Check your stackJSON