CVE-2021-21272 zip slip in ORAS

High 7.7 Published Updated

A zip-slip vulnerability in ORAS allows malicious tarballs to overwrite files outside the target directory, potentially leading to code execution or data modification.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2021-21272?

CVE-2021-21272 is a high-severity path traversal vulnerability in deislabs oras, published on 25 Jan 2021. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

ORAS is open source software which enables a way to push OCI Artifacts to OCI Conformant registries. ORAS is both a CLI for initial testing and a Go Module. In ORAS from version 0.4.0 and before version 0.9.0, there is a "zip-slip" vulnerability. The directory support feature allows the downloaded gzipped tarballs to be automatically extracted to the user-specified directory where the tarball can have symbolic links and hard links. A well-crafted tarball or tarballs allow malicious artifact providers linking, writing, or overwriting specific files on the host filesystem outside of the user-specified directory unexpectedly with the same permissions as the user who runs `oras pull`. Users of the affected versions are impacted if they are `oras` CLI users who runs `oras pull`, or if they are Go programs, which invoke `github.com/deislabs/oras/pkg/content.FileStore`. The problem has been fixed in version 0.9.0. For `oras` CLI users, there is no workarounds other than pulling from a trusted artifact provider. For `oras` package users, the workaround is to not use `github.com/deislabs/oras/pkg/content.FileStore`, and use other content stores instead, or pull from a trusted artifact provider.

Weakness: CWE-59, CWE-22

Which versions are affected by CVE-2021-21272?

4 open source packages ship an affected version, including github.com/deislabs/oras and oras. It affects 1 product.

PackageAffectedFixed in
github.com/deislabs/oras GoAll versions0.9.0
github.com/deislabs/oras GoAll versions0.9.0
github.com/deislabs/oras GoAll versions0.9.0
oras BitnamiFrom 0.4.00.9.0
Linux distribution packages (1)
helm openSUSE:TumbleweedAll versions3.9.4-3.1

Products include Deislabs Oras.

How do I fix CVE-2021-21272?

Upgrade github.com/deislabs/oras to 0.9.0 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2021-21272 being exploited?

There is no known exploitation of CVE-2021-21272 in the wild and no public exploit code.

Sources

Also known as BIT-oras-2021-21272, GHSA-g5v4-5x39-vwhx, GO-2021-0099, openSUSE-SU-2024:12345-1.

Is CVE-2021-21272 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free