CVE-2019-1348 in Git
Summary
by MITRE
An issue was found in Git before v2.24.1, v2.23.1, v2.22.2, v2.21.1, v2.20.2, v2.19.3, v2.18.2, v2.17.3, v2.16.6, v2.15.4, and v2.14.6. The --export-marks option of git fast-import is exposed also via the in-stream command feature export-marks=... and it allows overwriting arbitrary paths.
If you want to get best quality of vulnerability data, you may have to visit VulDB.
Analysis
by VulDB Data Team • 04/17/2025
The vulnerability described in CVE-2019-1348 represents a critical security flaw in Git versions prior to specific patch releases, affecting multiple major version branches including 2.24.1, 2.23.1, and others. This issue specifically targets the git fast-import command functionality which is commonly used for importing data into Git repositories, particularly in automated build systems and continuous integration environments where large-scale repository operations occur. The vulnerability stems from improper handling of the --export-marks option which can be exploited through the in-stream command feature, creating a path traversal scenario that allows malicious actors to overwrite arbitrary files on the system.
The technical implementation of this vulnerability resides in how Git processes the export-marks parameter within fast-import operations. When the export-marks option is used in conjunction with the in-stream command feature, the system fails to properly validate or sanitize the file paths specified in the export-marks=... parameter. This oversight creates a condition where an attacker can manipulate the path specification to target files outside of the intended repository directory structure, effectively allowing arbitrary file overwrites on the host system. The flaw operates at the file system level, bypassing normal Git repository access controls and permissions mechanisms.
The operational impact of this vulnerability is significant for organizations relying on Git for version control, particularly those using automated systems that import large datasets or utilize fast-import functionality for repository maintenance. Attackers could exploit this vulnerability to overwrite critical system files, configuration files, or even inject malicious code into the repository or system. The vulnerability is particularly dangerous in environments where Git operations are performed with elevated privileges or where automated scripts routinely execute fast-import commands. This could lead to complete system compromise, data corruption, or unauthorized access to sensitive information stored within or accessible through the affected repository.
Mitigation strategies for CVE-2019-1348 primarily involve upgrading to the patched versions of Git mentioned in the advisory, specifically versions 2.24.1, 2.23.1, and subsequent releases. Organizations should also implement strict input validation for all fast-import operations and avoid using the export-marks functionality with untrusted input sources. System administrators should review and restrict permissions for Git operations, particularly those involving fast-import commands, and consider implementing additional security controls such as sandboxing or containerization of Git operations. The vulnerability aligns with CWE-22 Path Traversal and CWE-73 Path Traversal, and maps to ATT&CK technique T1059 Command and Scripting Interpreter for potential exploitation through automated Git operations. Regular security audits of Git configurations and automated processes should be conducted to ensure proper implementation of security controls and prevent exploitation of similar vulnerabilities in the future.