{"id":"CVE-2022-39345","aliases":["EUVD-2022-7047","GHSA-7gc4-r5jr-9hxv"],"status":"published","title":"Gin-vue-admin arbitrary file upload vulnerability caused by path traversal","description":"Gin-vue-admin is a backstage management system based on vue and gin, which separates the front and rear of the full stack. Gin-vue-admin prior to 2.5.4 is vulnerable to path traversal, which leads to file upload vulnerabilities. Version 2.5.4 contains a patch for this issue. There are no workarounds aside from upgrading to a patched version.","severity":{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-09","score":0.0173,"percentile":0.77763,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22","CWE-23"],"published":"2022-10-25T00:00:00Z","modified":"2026-10-28T02:31:14Z","fixes":[{"ecosystem":"Go","package":"github.com/flipped-aurora/gin-vue-admin/server","fixed_in":["2.5.4"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/flipped-aurora/gin-vue-admin/server","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"2.5.4"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/flipped-aurora/gin-vue-admin/server","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"2.5.4"}]}]}],"products":[{"vendor":"flipped-aurora","product":"gin-vue-admin"},{"vendor":"gin-vue-admin_project","product":"gin-vue-admin"}],"references":[{"url":"https://github.com/flipped-aurora/gin-vue-admin/security/advisories/GHSA-7gc4-r5jr-9hxv","tags":["x_transferred","Exploit","Third Party Advisory","advisory","web"]},{"url":"https://github.com/flipped-aurora/gin-vue-admin/issues/1263","tags":["x_transferred","Issue Tracking","Third Party Advisory","report","web"]},{"url":"https://github.com/flipped-aurora/gin-vue-admin/pull/1264","tags":["x_transferred","Issue Tracking","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/flipped-aurora/gin-vue-admin/blob/main/server/service/system/sys_auto_code.go","tags":["x_transferred","Exploit","Third Party Advisory","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2022-39345","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-7gc4-r5jr-9hxv"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/39xxx/CVE-2022-39345.json","tags":["advisory"]},{"url":"https://github.com/flipped-aurora/gin-vue-admin","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2022-39345","title":"Gin-vue-admin arbitrary file upload vulnerability caused by path traversal","description":"Gin-vue-admin is a backstage management system based on vue and gin, which separates the front and rear of the full stack. Gin-vue-admin prior to 2.5.4 is vulnerable to path traversal, which leads to file upload vulnerabilities. Version 2.5.4 contains a patch for this issue. There are no workarounds aside from upgrading to a patched version.","status":"published","published":"2022-10-25T00:00:00Z","modified":"2025-04-22T17:17:16.782Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"cna"}],"cwes":["CWE-22","CWE-23"],"updated_at":"2026-11-02T14:34:39.559326Z"}],"euvd":[{"id":"EUVD-2022-7047","description":"Gin-vue-admin is a backstage management system based on vue and gin, which separates the front and rear of the full stack. Gin-vue-admin prior to 2.5.4 is vulnerable to path traversal, which leads to file upload vulnerabilities. Version 2.5.4 contains a patch for this issue. There are no workarounds aside from upgrading to a patched version.","status":"published","published":"2022-10-25T00:00:00Z","modified":"2025-04-22T17:17:16Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"updated_at":"2026-11-02T20:52:16.055056Z"}],"ghsa":[{"id":"GHSA-7gc4-r5jr-9hxv","title":"Gin-vue-admin subject to Remote Code Execution via file upload vulnerability","description":"### Impact\nGin-vue-admin \u003c 2.5.4 has File upload vulnerabilities。\nFile upload vulnerabilities are when a web server allows users to upload files to its filesystem without sufficiently validating things like their name, type, contents, or size. Failing to properly enforce restrictions on these could mean that even a basic image upload function can be used to upload arbitrary and potentially dangerous files instead. This could even include server-side script files that enable remote code execution.\n\n### Patches\n\nhttps://github.com/flipped-aurora/gin-vue-admin/pull/1264\n\n### Workarounds\n\nhttps://github.com/flipped-aurora/gin-vue-admin/pull/1264\n### References\n\n#1263 \n\n### For more information\nThe plugin installation function of Gin-Vue-Admin allows users to download zip packages from the plugin market and upload them for installation. This function has an arbitrary file upload vulnerability. A malicious attacker can upload a constructed zip package to traverse the directory and upload or overwrite arbitrary files on the server side.\n\nThe affected code https://github.com/flipped-aurora/gin-vue-admin/blob/main/server/service/system/sys_auto_code.go line 880 called the `utils.Unzip` method\n\n```\npaths, err := utils.Unzip(GVAPLUGPINATH+file.Filename, GVAPLUGPINATH)\n\tpaths = filterFile(paths)\n\tvar webIndex = -1\n\tvar serverIndex = -1\n\tfor i := range paths {\n\t\tpaths[i] = filepath.ToSlash(paths[i])\n\t\tpathArr := strings.Split(paths[i], \"/\")\n\t\tln := len(pathArr)\n\t\tif ln \u003c 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif pathArr[ln-2] == \"server\" \u0026\u0026 pathArr[ln-1] == \"plugin\" {\n\t\t\tserverIndex = i\n\t\t}\n\t\tif pathArr[ln-2] == \"web\" \u0026\u0026 pathArr[ln-1] == \"plugin\" {\n\t\t\twebIndex = i\n\t\t}\n\t}\n\tif webIndex == -1 \u0026\u0026 serverIndex == -1 {\n\t\tzap.L().Error(\"非标准插件，请按照文档自动迁移使用\")\n\t\treturn webIndex, serverIndex, errors.New(\"非标准插件，请按照文档自动迁移使用\")\n\t}\n...\n```\nThe https://github.com/flipped-aurora/gin-vue-admin/blob/main/server/utils/zip.go code defines the `utils.Unzip` method\n```\n//解压\nfunc Unzip(zipFile string, destDir string) ([]string, error) {\n\tzipReader, err := zip.OpenReader(zipFile)\n\tvar paths []string\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer zipReader.Close()\n\n\tfor _, f := range zipReader.File {\n\t\tfpath := filepath.Join(destDir, f.Name)\n\t\tpaths = append(paths, fpath)\n\t\tif f.FileInfo().IsDir() {\n\t\t\tos.MkdirAll(fpath, os.ModePerm)\n...\n```\nIt can be analyzed that after uploading a zip compressed file, the `Unzip` method will be called to decompress the compressed file, and then judge whether the compressed file contains the fixed directory structure of server, web, and plugin.\n\nWhether the zip file is correct or not, it will be decompressed first. If the directory does not exist, it will be created automatically. Therefore, malicious zip packages can be constructed, and directory traversal can be performed during automatic decompression to upload or overwrite any file.\n\nUse the Zip Slip vulnerability to construct a malicious zip package with `../../../../` filenames, and upload the malicious zip package to trigger the vulnerability.\n\n![1](https://user-images.githubusercontent.com/113822259/197387942-e40c188d-cff0-4da3-84ba-7ca670d9bf72.png)\n![2](https://user-images.githubusercontent.com/113822259/197387956-cef8fd0d-978a-47ae-a65e-e28367f6a0b8.png)\n","status":"published","published":"2022-10-25T21:02:23Z","modified":"2023-01-30T05:02:47Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:36:27.500048Z"}],"nvd":[{"id":"CVE-2022-39345","description":"Gin-vue-admin is a backstage management system based on vue and gin, which separates the front and rear of the full stack. Gin-vue-admin prior to 2.5.4 is vulnerable to path traversal, which leads to file upload vulnerabilities. Version 2.5.4 contains a patch for this issue. There are no workarounds aside from upgrading to a patched version.","status":"published","published":"2022-10-25T17:15:56.407Z","modified":"2026-06-17T04:58:11.013Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical","assessor":"secondary"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N","level":"high","assessor":"primary"}],"cwes":["CWE-22","CWE-23"],"updated_at":"2026-11-02T14:07:31.127985Z"}],"osv":[{"id":"CVE-2022-39345","title":"Gin-vue-admin arbitrary file upload vulnerability caused by path traversal","description":"Gin-vue-admin is a backstage management system based on vue and gin, which separates the front and rear of the full stack. Gin-vue-admin prior to 2.5.4 is vulnerable to path traversal, which leads to file upload vulnerabilities. Version 2.5.4 contains a patch for this issue. There are no workarounds aside from upgrading to a patched version.","status":"published","published":"2022-10-25T00:00:00Z","modified":"2026-10-28T02:31:14.630102968Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-22","CWE-23"],"updated_at":"2026-11-02T15:44:26.860704Z"},{"id":"GHSA-7gc4-r5jr-9hxv","title":"Gin-vue-admin subject to Remote Code Execution via file upload vulnerability","description":"### Impact\nGin-vue-admin \u003c 2.5.4 has File upload vulnerabilities。\nFile upload vulnerabilities are when a web server allows users to upload files to its filesystem without sufficiently validating things like their name, type, contents, or size. Failing to properly enforce restrictions on these could mean that even a basic image upload function can be used to upload arbitrary and potentially dangerous files instead. This could even include server-side script files that enable remote code execution.\n\n### Patches\n\nhttps://github.com/flipped-aurora/gin-vue-admin/pull/1264\n\n### Workarounds\n\nhttps://github.com/flipped-aurora/gin-vue-admin/pull/1264\n### References\n\n#1263 \n\n### For more information\nThe plugin installation function of Gin-Vue-Admin allows users to download zip packages from the plugin market and upload them for installation. This function has an arbitrary file upload vulnerability. A malicious attacker can upload a constructed zip package to traverse the directory and upload or overwrite arbitrary files on the server side.\n\nThe affected code https://github.com/flipped-aurora/gin-vue-admin/blob/main/server/service/system/sys_auto_code.go line 880 called the `utils.Unzip` method\n\n```\npaths, err := utils.Unzip(GVAPLUGPINATH+file.Filename, GVAPLUGPINATH)\n\tpaths = filterFile(paths)\n\tvar webIndex = -1\n\tvar serverIndex = -1\n\tfor i := range paths {\n\t\tpaths[i] = filepath.ToSlash(paths[i])\n\t\tpathArr := strings.Split(paths[i], \"/\")\n\t\tln := len(pathArr)\n\t\tif ln \u003c 2 {\n\t\t\tcontinue\n\t\t}\n\t\tif pathArr[ln-2] == \"server\" \u0026\u0026 pathArr[ln-1] == \"plugin\" {\n\t\t\tserverIndex = i\n\t\t}\n\t\tif pathArr[ln-2] == \"web\" \u0026\u0026 pathArr[ln-1] == \"plugin\" {\n\t\t\twebIndex = i\n\t\t}\n\t}\n\tif webIndex == -1 \u0026\u0026 serverIndex == -1 {\n\t\tzap.L().Error(\"非标准插件，请按照文档自动迁移使用\")\n\t\treturn webIndex, serverIndex, errors.New(\"非标准插件，请按照文档自动迁移使用\")\n\t}\n...\n```\nThe https://github.com/flipped-aurora/gin-vue-admin/blob/main/server/utils/zip.go code defines the `utils.Unzip` method\n```\n//解压\nfunc Unzip(zipFile string, destDir string) ([]string, error) {\n\tzipReader, err := zip.OpenReader(zipFile)\n\tvar paths []string\n\tif err != nil {\n\t\treturn []string{}, err\n\t}\n\tdefer zipReader.Close()\n\n\tfor _, f := range zipReader.File {\n\t\tfpath := filepath.Join(destDir, f.Name)\n\t\tpaths = append(paths, fpath)\n\t\tif f.FileInfo().IsDir() {\n\t\t\tos.MkdirAll(fpath, os.ModePerm)\n...\n```\nIt can be analyzed that after uploading a zip compressed file, the `Unzip` method will be called to decompress the compressed file, and then judge whether the compressed file contains the fixed directory structure of server, web, and plugin.\n\nWhether the zip file is correct or not, it will be decompressed first. If the directory does not exist, it will be created automatically. Therefore, malicious zip packages can be constructed, and directory traversal can be performed during automatic decompression to upload or overwrite any file.\n\nUse the Zip Slip vulnerability to construct a malicious zip package with `../../../../` filenames, and upload the malicious zip package to trigger the vulnerability.\n\n![1](https://user-images.githubusercontent.com/113822259/197387942-e40c188d-cff0-4da3-84ba-7ca670d9bf72.png)\n![2](https://user-images.githubusercontent.com/113822259/197387956-cef8fd0d-978a-47ae-a65e-e28367f6a0b8.png)\n","status":"published","published":"2022-10-25T21:02:23Z","modified":"2023-11-08T04:10:19.434789Z","cvss":[{"version":"3.1","score":9.8,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","level":"critical"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:41.002603Z"}]}}
