Skip to content

Zip slip directory exploit in github.com/deislabs/oras

High severity GitHub Reviewed Published Jan 22, 2021 in oras-project/oras • Updated Feb 14, 2023

Package

gomod github.com/deislabs/oras (Go)

Affected versions

< 0.9.0

Patched versions

0.9.0

Description

Impact

The directory support (#55) 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.

Precisely, the following users of the affected versions are impacted

  • oras CLI users who runs oras pull.
  • Go programs, which invokes github.com/deislabs/oras/pkg/content.FileStore.

Patches

The problem has been patched by the PR linked with this advisory. Users should upgrade their oras CLI and packages to 0.9.0.

Workarounds

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.

References

For more information

If you have any questions or comments about this advisory:

References

@jdolitsky jdolitsky published to oras-project/oras Jan 22, 2021
Published by the National Vulnerability Database Jan 25, 2021
Reviewed May 21, 2021
Published to the GitHub Advisory Database Feb 15, 2022
Last updated Feb 14, 2023

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
Low
User interaction
None
Scope
Changed
Confidentiality
None
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:L/UI:N/S:C/C:N/I:H/A:N

EPSS score

0.073%
(34th percentile)

CVE ID

CVE-2021-21272

GHSA ID

GHSA-g5v4-5x39-vwhx

Source code

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.