{"id":"CVE-2022-1271","details":"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.","modified":"2026-08-12T03:30:14.942234516Z","published":"2022-08-31T15:33:00Z","related":["ALSA-2022:1537","ALSA-2022:4940","ALSA-2022:4991","SUSE-SU-2022:1158-1","SUSE-SU-2022:1160-1","SUSE-SU-2022:1250-1","SUSE-SU-2022:1272-1","SUSE-SU-2022:1275-1","SUSE-SU-2022:14938-1","SUSE-SU-2022:1617-1","SUSE-SU-2022:1650-1","SUSE-SU-2022:1673-1","SUSE-SU-2022:1674-1","openSUSE-SU-2024:11987-1","openSUSE-SU-2024:11992-1","openSUSE-SU-2024:12271-1"],"database_specific":{"unresolved_ranges":[{"source":"AFFECTED_FIELD","extracted_events":[{"introduced":"Fixed in gzip 1.12"},{"last_affected":"Fixed in gzip 1.12"}]}],"cna_assigner":"redhat","cwe_ids":["CWE-179"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/1xxx/CVE-2022-1271.json"},"references":[{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2022-1271"},{"type":"WEB","url":"https://git.tukaani.org/?p=xz.git%3Ba=commit%3Bh=69d1b3fc29677af8ade8dc15dba83f0589cb63d6"},{"type":"WEB","url":"https://lists.gnu.org/r/bug-gzip/2022-04/msg00011.html"},{"type":"WEB","url":"https://security-tracker.debian.org/tracker/CVE-2022-1271"},{"type":"WEB","url":"https://tukaani.org/xz/xzgrep-ZDI-CAN-16587.patch"},{"type":"WEB","url":"https://www.openwall.com/lists/oss-security/2022/04/07/8"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/1xxx/CVE-2022-1271.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2022-1271"},{"type":"ADVISORY","url":"https://security.gentoo.org/glsa/202209-01"},{"type":"ADVISORY","url":"https://security.netapp.com/advisory/ntap-20220930-0006/"},{"type":"REPORT","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2073310"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/tukaani-project/xz","events":[{"introduced":"0"},{"fixed":"2327a461e1afce862c22269b80d3517801103c1b"}],"database_specific":{"cpe":"cpe:2.3:a:tukaani:xz:*:*:*:*:*:*:*:*","extracted_events":[{"introduced":"0"},{"fixed":"5.2.5"}],"source":"CPE_RANGE"}}],"versions":["v5.2.4","v5.2.3","v5.2.2","v5.2.1","v5.2.0","v5.1.4beta","v5.1.3alpha","v5.1.2alpha","v5.1.1alpha","v5.0.0","v5.1.0alpha","v4.999.9beta","v4.999.8beta","v4.999.7beta","v4.999.5alpha","v4.999.3alpha","v4.42.2alpha"],"database_specific":{"source":"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2022-1271.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"}]}