dmlc / gluon-cv

Gluon CV Toolkit
http://gluon-cv.mxnet.io
Apache License 2.0
5.79k stars 1.21k forks source link

CVE-2007-4559 Tar Vulnerability #1762

Closed hadikoub closed 1 year ago

hadikoub commented 1 year ago

Ref: https://github.com/advisories/GHSA-gw9q-c7gh-j9vm Scope: tar module used in GluonCV and the extraction method contain a vulnerability that enables remote code execution. https://github.com/dmlc/gluon-cv/blob/40a216547ec5322c851b1f8ce2a4dd7d4b7a6004/gluoncv/auto/data/data_zoo.py#L71

The scope and patch of this bug were discussed in an open-source project that uses GluonCV by Trellix Vulnerability Team. Link

The patch adds a sanity check before extracting the Tar file to ensure that all files belong to the tar itself.

Quote:

Patching https://github.com/advisories/GHSA-gw9q-c7gh-j9vm Hi, we are security researchers from the Advanced Research Center at Trellix. We have began a campaign to patch a widespread bug named https://github.com/advisories/GHSA-gw9q-c7gh-j9vm. https://github.com/advisories/GHSA-gw9q-c7gh-j9vm is a 15 year old bug in the Python tarfile package. By using extract() or extractall() on a tarfile object without sanitizing input, a maliciously crafted .tar file could perform a directory path traversal attack. We found at least one unsantized extractall() in your codebase and are providing a patch for you via pull request. The patch essentially checks to see if all tarfile members will be extracted safely and throws an exception otherwise. We encourage you to use this patch or your own solution to secure against https://github.com/advisories/GHSA-gw9q-c7gh-j9vm. Further technical information about the vulnerability can be found in this blog. If you have further questions you may contact us through this projects lead researcher Kasimir Schulz.

Patch code: https://github.com/BMW-InnovationLab/BMW-Semantic-Segmentation-Training-GUI/pull/1/commits/256bb8875e40f661ef8dcce82b86cf55e555b69f

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.