CVE-2022-1271
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.
Severity
HIGH
CVSS v3
8.8
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H · source nvd
Exploit chance (EPSS)
5.868%
chance of exploitation in the next 30 days
higher than 93.3% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
None public
Exploit references (NVD and CNA): 0
Metasploit modules: 0
Nuclei templates: 0
Weakness
- CWE-179: Incorrect Behavior Order: Early Validation
CISA SSVC decision points
| Exploitation | none |
|---|---|
| Automatable | no |
| Technical impact | total |
| Scored | 2025-06-09 |
Timeline
- 2022-08-31Published by the CNA15:33 UTC
- 2025-06-09CISA SSVC decision recorded1013 days after publication
Affected products
Products listed as vulnerable. Upgrade to the version under "Fixed in", or a later one.
| Product | Vulnerable versions | Fixed in |
|---|---|---|
| gnu gzip | before 1.12fixed in 1.12 | 1.12 |
| debian debian_linux | 10.0no fix listed | not listed |
| redhat jboss_data_grid | 7.0.0no fix listed | not listed |
| tukaani xz | before 5.2.5fixed in 5.2.5 | 5.2.5 |
References
- https://lists.gnu.org/r/bug-gzip/2022-04/msg00011.html
- https://tukaani.org/xz/xzgrep-ZDI-CAN-16587.patch
- https://www.openwall.com/lists/oss-security/2022/04/07/8
- https://security.gentoo.org/glsa/202209-01
- https://access.redhat.com/security/cve/CVE-2022-1271
- https://bugzilla.redhat.com/show_bug.cgi?id=2073310
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html
- https://cert-portal.siemens.com/productcert/html/ssa-455250.html
- https://git.tukaani.org/?p=xz.git%3Ba=commit%3Bh=69d1b3fc29677af8ade8dc15dba83f0589cb63d6
- https://security-tracker.debian.org/tracker/CVE-2022-1271
- https://security.netapp.com/advisory/ntap-20220930-0006/
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2022-1271'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2022-1271'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2022-1271'curl 'https://api.contrastcyber.com/cve_products/CVE-2022-1271'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- OWASP Top 10 categories by the OWASP Foundation (CC BY 3.0).
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).