{"id":"CVE-2026-45695","aliases":["CVE-2026-45695","GHSA-2q4c-3mrw-63c3","GO-2026-5009"],"related":[],"kind":"vulnerability","state":"published","title":"Kopia: Unauthenticated RCE via SSH ProxyCommand Injection when --insecure --without-password is used","summary":"Kopia is a cross-platform backup tool for Windows, macOS, and Linux with fast incremental backups, client-side end-to-end encryption, compression, and data deduplication. Prior to 0.23.0, Kopia's HTTP server started with --without-password accepts unauthenticated requests to /api/v1/repo/exists and forwards attacker-supplied SFTP storage configuration to blob.NewStorage, where externalSSH: true and sshArguments containing -oProxyCommand=<cmd> can cause exec.CommandContext(\"ssh\") to invoke the command through OpenSSH. This issue is fixed in version 0.23.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Kopia is a cross-platform backup tool for Windows, macOS, and Linux with fast incremental backups, client-side end-to-end encryption, compression, and data deduplication. Prior to 0.23.0, Kopia's HTTP server started with --without-password accepts unauthenticated requests to /api/v1/repo/exists and forwards attacker-supplied SFTP storage configuration to blob.NewStorage, where externalSSH: true and sshArguments containing -oProxyCommand=<cmd> can cause exec.CommandContext(\"ssh\") to invoke the command through OpenSSH. This issue is fixed in version 0.23.0.","source":"cvelist"},{"lang":"en","text":"## Summary\n\nKopia's HTTP server, when started with `--without-password `, accepts unauthenticated requests to `/api/v1/repo/exists`. The handler forwards an attacker-supplied storage configuration to `blob.NewStorage`. For SFTP backends with `externalSSH: true`, that path constructs a process command line by splitting `sshArguments` on spaces and passes the result directly to `exec.CommandContext(\"ssh\")`. An `-oProxyCommand=<cmd>` token in `sshArguments` causes OpenSSH to invoke `<cmd>` via `$SHELL -c` before any TCP connection is attempted, giving the requester arbitrary command execution as the Kopia process user.\n\n## Analysis\n\n[`internal/server/server_authz_checks.go` lines 61–73](https://github.com/kopia/kopia/blob/v0.22.3/internal/server/server_authz_checks.go#L61-L73):\n\nwhen the server is started without `--server-username` or `--server-password`, `getAuthenticator()` returns `nil` and `requireUIUser` unconditionally authorizes the request. Every endpoint registered through `handleUIPossiblyNotConnected` becomes accessible without credentials.\n\n[`repo/blob/sftp/sftp_storage.go` lines 448–468](https://github.com/kopia/kopia/blob/v0.22.3/repo/blob/sftp/sftp_storage.go#L448-L468):\n\n`opt.SSHArguments` is populated from the JSON request body (`storage.config.sshArguments`). The string is split only on the literal ASCII space character, there is no shell style tokenizer, no quote handling, and no allowlist. Whatever tokens the caller supplies are appended to the `ssh` argv. \n\nOpenSSH treats `-oProxyCommand=<value>` as a directive to execute `<value>` via the user's shell (`$SHELL -c <value>`) and pipe the SSH transport over its stdio. The shell invocation happens before SSH attempts a TCP connection, so the command runs even when the target host is unreachable.\n\n## Impact\n\nNo user interaction is required. No valid credentials are required. The exploit is a single HTTP request.\n\n## Credits \n\nThis vulnerability was discovered and responsibly disclosed by Daniele Berardinelli.\n\n## Mitigation\nhttps://github.com/kopia/kopia/pull/5354 disallows starting of a server without a password which also listens on a non-loopback interface.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Kopia: RCE via SSH ProxyCommand Injection in github.com/kopia/kopia","format":"markdown","source":"go"}],"published":"2026-05-19T19:18:32.000Z","modified":"2026-07-16T19:16:45.527Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"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:H/I:H/A:H","score":9.8,"rating":"CRITICAL"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","score":9.8,"rating":"CRITICAL"}],"cwes":["CWE-78","CWE-306"],"affected":[{"ranges":[{"version":"< 0.23.0","status":"affected"}],"vendor":"kopia","product":"kopia","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.23.0"}],"ecosystem":"Go","package":"github.com/kopia/kopia","purl":"pkg:golang/github.com/kopia/kopia","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.23.0"}],"ecosystem":"Go","package":"github.com/kopia/kopia","purl":"pkg:golang/github.com/kopia/kopia","source":"go"}],"references":[{"url":"https://github.com/kopia/kopia/security/advisories/GHSA-2q4c-3mrw-63c3","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/kopia/kopia/pull/5354","tags":["fix","web","x-refsource-misc"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/kopia/kopia/commit/c26c6a1b9734c5089217986ffa5cd19f8a6b8900","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/kopia/kopia/releases/tag/v0.23.0","tags":["x-refsource-misc"],"sources":["cvelist","nvd"]},{"url":"https://github.com/kopia/kopia","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"total","date":"2026-07-16T18:06:25.174Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-45695","url":"https://www.cve.org/CVERecord?id=CVE-2026-45695","licence":"CVE Terms of Use","modified":"2026-07-16T18:08:13.371Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2q4c-3mrw-63c3","url":"https://github.com/advisories/GHSA-2q4c-3mrw-63c3","licence":"CC-BY-4.0","modified":"2026-06-02T05:15:10.039Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5009","url":"https://pkg.go.dev/vuln/GO-2026-5009","licence":"CC-BY-4.0","modified":"2026-05-20T19:30:14.330Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-45695","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-45695","licence":"Public domain","modified":"2026-07-16T19:16:45.527Z"}],"updatedAt":"2026-11-25T22:59:28.391Z","epss":{"score":0.01407,"percentile":0.73401,"date":"2026-12-01T12:00:22.000Z"}}