[{"uuid":"GSA_kwCzR0hTQS0ycTRjLTNtcnctNjNjM84ABXHW","url":"https://github.com/advisories/GHSA-2q4c-3mrw-63c3","title":"Kopia: RCE via SSH ProxyCommand Injection","description":"## 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=\u003ccmd\u003e` token in `sshArguments` causes OpenSSH to invoke `\u003ccmd\u003e` 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=\u003cvalue\u003e` as a directive to execute `\u003cvalue\u003e` via the user's shell (`$SHELL -c \u003cvalue\u003e`) 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.","origin":"UNSPECIFIED","severity":"CRITICAL","published_at":"2026-05-19T19:18:32.000Z","withdrawn_at":null,"classification":"GENERAL","cvss_score":9.8,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","references":["https://github.com/kopia/kopia/security/advisories/GHSA-2q4c-3mrw-63c3","https://github.com/kopia/kopia/pull/5354","https://github.com/advisories/GHSA-2q4c-3mrw-63c3"],"source_kind":"github","identifiers":["GHSA-2q4c-3mrw-63c3","CVE-2026-45695"],"repository_url":null,"blast_radius":0.0,"created_at":"2026-05-19T20:00:18.812Z","updated_at":"2026-10-17T05:06:39.069Z","epss_percentage":0.0161,"epss_percentile":0.75518,"api_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0ycTRjLTNtcnctNjNjM84ABXHW","html_url":"https://advisories.ecosyste.ms/advisories/GSA_kwCzR0hTQS0ycTRjLTNtcnctNjNjM84ABXHW","packages":[{"ecosystem":"go","package_name":"github.com/kopia/kopia","versions":[{"first_patched_version":"0.23.0","vulnerable_version_range":"\u003c= 0.22.3"}],"purl":"pkg:go/github.com%2Fkopia%2Fkopia"}],"related_packages_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0ycTRjLTNtcnctNjNjM84ABXHW/related_packages","related_advisories":[]},{"uuid":"GSA_kwCzR0hTQS1qNXZtLTdxY2MtMnd3Z84AA63w","url":"https://github.com/advisories/GHSA-j5vm-7qcc-2wwg","title":"Kopia: Storage connection credentials written to console on \"repository status\" CLI command with JSON output","description":"### Impact\n\n_What kind of vulnerability is it? Who is impacted?_\n\nStorage credentials are written to the console.\n\n### Patches\n\n_Has the problem been patched?_ Yes, see #3589\n_What versions should users upgrade to?_\n- Any version after or including commit 1d6f852cd6534f4bea978cbdc85c583803d79f77\n- No release has been created yet.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_\n\n- Be aware that `kopia repo status --json` will write the credentials to the output without scrubbing them.\n- Avoid executing `kopia repo status` with the `--json` flag in an insecure environment where.\n- Avoid logging the output of the `kopia repo status --json` command.","origin":"UNSPECIFIED","severity":"LOW","published_at":"2024-04-10T17:15:26.000Z","withdrawn_at":null,"classification":"GENERAL","cvss_score":2.0,"cvss_vector":"CVSS:3.1/AV:L/AC:L/PR:H/UI:R/S:U/C:L/I:N/A:N","references":["https://github.com/kopia/kopia/security/advisories/GHSA-j5vm-7qcc-2wwg","https://github.com/kopia/kopia/pull/3589","https://github.com/kopia/kopia/commit/1d6f852cd6534f4bea978cbdc85c583803d79f77","https://github.com/advisories/GHSA-j5vm-7qcc-2wwg"],"source_kind":"github","identifiers":["GHSA-j5vm-7qcc-2wwg"],"repository_url":"https://github.com/kopia/kopia","blast_radius":0.0,"created_at":"2024-04-10T18:04:55.155Z","updated_at":"2026-06-17T17:06:53.982Z","epss_percentage":null,"epss_percentile":null,"api_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qNXZtLTdxY2MtMnd3Z84AA63w","html_url":"https://advisories.ecosyste.ms/advisories/GSA_kwCzR0hTQS1qNXZtLTdxY2MtMnd3Z84AA63w","packages":[{"ecosystem":"go","package_name":"github.com/kopia/kopia","versions":[{"first_patched_version":"0.16.0","vulnerable_version_range":"\u003c 0.16.0"}],"purl":"pkg:go/github.com%2Fkopia%2Fkopia"}],"related_packages_url":"https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1qNXZtLTdxY2MtMnd3Z84AA63w/related_packages","related_advisories":[]}]