CVE-2021-21272: Zip slip directory exploit in github.com/deislabs/oras

github.com/deislabs/oras Updated 02 Oct 2025

Summary

14/04/2021
Yes i
High
7.7

CVE-2021-21272: Zip slip directory exploit in github.com/deislabs/oras. Affects github.com/deislabs/oras versions < 0.9.0. Fixed in 0.9.0. How to fix ↓

Also tracked for

The same CVE-2021-21272 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The package under scrutiny is github.com/deislabs/oras, which is written in Go. It is a content-addressable artifact registry for storing and retrieving artifacts. The package provides functionalities for working with OCI (Open Container Initiative) images and other artifact types. The vulnerability in this package allows for a directory traversal exploit during archive extraction, specifically when using the pkg/content.FileStore content store. This vulnerability enables a malicious archive to write paths to arbitrary locations that the process can write to.

Vulnerability Detail

The vulnerability arises due to improper path validation in the content.FileStore content store of github.com/deislabs/oras. This allows an attacker to craft a malicious archive that can traverse directories and write files to arbitrary paths that the process has write access to. The impact of this vulnerability can be severe, as it can lead to unauthorized modification or deletion of files, potential code execution, and privilege escalation if the process has elevated privileges. It is important to note that this vulnerability affects versions prior to 0.9.0 of the package.

How To Fix

Latest published version: v0.11.1 as of 23 Oct 2026

go get github.com/deislabs/oras@v0.11.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.9.0

This is the first release that contains the fix.

go get github.com/deislabs/oras@v0.9.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a workaround, if updating the package is not immediately feasible, it is recommended to exercise caution when extracting archives using the content.FileStore content store. Ensure that the extracted paths are properly validated and restricted to the intended directories. Implementing additional path validation checks can help mitigate the risk of directory traversal exploits.

Conclusion

In conclusion, the github.com/deislabs/oras package is vulnerable to a directory traversal exploit during archive extraction. This can lead to unauthorized modification or deletion of files, potential code execution, and privilege escalation. It is crucial to update to version 0.9.0 or later of the package to mitigate this vulnerability. If immediate update is not feasible, exercise caution when extracting archives and implement additional path validation checks. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for github.com/deislabs/oras →

Share this vulnerability

FAQ

The impact of this vulnerability can be severe, as it allows for unauthorized modification or deletion of files, potential code execution, and privilege escalation if the process has elevated privileges.

Versions prior to 0.9.0 of github.com/deislabs/oras are affected by this vulnerability.

To fix this vulnerability, update the github.com/deislabs/oras package to version 0.9.0 or later.

As a workaround, exercise caution when extracting archives using the content.FileStore content store and implement additional path validation checks.

Here is an example code snippet that demonstrates the vulnerability:

package main

import (
	"github.com/deislabs/oras/pkg/content"
	"os"
)

func main() {
	archivePath := "/path/to/malicious/archive.zip"
	extractPath := "/path/to/extract"

	fileStore := content.NewFileStore(extractPath)
	fileStore.Extract(archivePath)
}

References

How To Fix

Latest published version: v0.11.1 as of 23 Oct 2026

go get github.com/deislabs/oras@v0.11.1

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

0.9.0

This is the first release that contains the fix.

go get github.com/deislabs/oras@v0.9.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback