Skip to content

Path traversal via crafted cpio archives in Engrampa archivers

High
lukefromdc published GHSA-c98h-v39w-3r7v Feb 4, 2024

Package

No package listed

Affected versions

<= latest

Patched versions

None

Description

Summary

Engrampa Archiver found to be vulnerable to Path Traversal vulnerability that can be leveraged to achieve full Remote Command Execution on the target.

Details

While handling CPIO archives, the Engrampa Archive manager follows symlink, cpio by default will follow stored symlinks while extracting and the Archiver will not check the symlink location, which leads to arbitrary file writes to unintended locations. When the victim extracts the archive, the attacker can craft a malicious cpio or ISO archive to achieve RCE on the target system.

PoC

Complete instructions to craft a cpio archive to demonstrate the vulnerability.

mkdir test_cpio
 ln -sf /tmp/ test_cpio/tmp
 echo "TEST Traversal" > test_cpio/tmpYtrav.txt
 cd test_cpio/
 ls | cpio -ov > ../trav.cpio
 cd ../
 sed -i s/"tmpY"/"tmp\/"/g trav.cpio 
 

Impact

An attacker can craft malicious cpio archives that exploits the vulnerability to write files on locations such as ~/.ssh, ~/.bashrc, ~/.config/autostart/ etc., to achieve full remote command execution on the target/victim system.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
None
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
High
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:H/A:N

CVE ID

CVE-2023-52138

Credits