Skip to content

TorchServe ZipSlip

Moderate severity GitHub Reviewed Published Nov 21, 2023 in pytorch/serve • Updated Nov 21, 2023

Package

pip torchserve (pip)

Affected versions

>= 0.1.0, < 0.9.0

Patched versions

0.9.0

Description

Impact

Using the model/workflow management API, there is a chance of uploading potentially harmful archives that contain files that are extracted to any location on the filesystem that is within the process permissions. Leveraging this issue could aid third-party actors in hiding harmful code in open-source/public models, which can be downloaded from the internet, and take advantage of machines running Torchserve.

Patches

The ZipSlip issue in TorchServe has been fixed by validating the paths of files contained within a zip archive before extracting them: pytorch/serve#2634

TorchServe release 0.9.0 includes fixes to address the ZipSlip vulnerability:
https://github.com/pytorch/serve/releases/tag/v0.9.0

References

pytorch/serve#2634
https://github.com/pytorch/serve/releases/tag/v0.9.0

Credit

We would like to thank Oligo Security for responsibly disclosing this issue.

If you have any questions or comments about this advisory, we ask that you contact AWS Security via our vulnerability reporting page or directly via email to aws-security@amazon.com. Please do not create a public GitHub issue.

References

@namannandan namannandan published to pytorch/serve Nov 21, 2023
Published to the GitHub Advisory Database Nov 21, 2023
Reviewed Nov 21, 2023
Published by the National Vulnerability Database Nov 21, 2023
Last updated Nov 21, 2023

Severity

Moderate

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
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
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:N/S:U/C:N/I:L/A:N

EPSS score

0.063%
(29th percentile)

Weaknesses

CVE ID

CVE-2023-48299

GHSA ID

GHSA-m2mj-pr4f-h9jp

Source code

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