Summary
Kopia'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.
Analysis
internal/server/server_authz_checks.go lines 61–73:
when 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.
repo/blob/sftp/sftp_storage.go lines 448–468:
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.
OpenSSH 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.
Credits
This vulnerability was discovered and responsibly disclosed by Daniele Berardinelli.
Mitigation
https://github.com/kopia/kopia/pull/5354 disallows starting of a server without a password which also listens on a non-loopback interface.
Impact
No user interaction is required. No valid credentials are required. The exploit is a single HTTP request.
Untrusted input reaches a shell command, allowing arbitrary commands to run on the host. Typical impact: code execution in the application's environment.
CVE-2026-45695 has a CVSS score of 9.8 (Critical). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment. A fixed version is available (0.23.0); upgrading removes the vulnerable code path.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is CVE-2026-45695? CVE-2026-45695 is a critical-severity OS command injection vulnerability in github.com/kopia/kopia (go), affecting versions <= 0.22.3. It is fixed in 0.23.0. Untrusted input reaches a shell command, allowing arbitrary commands to run on the host.
- How severe is CVE-2026-45695? CVE-2026-45695 has a CVSS score of 9.8 (Critical). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
- Which versions of github.com/kopia/kopia are affected by CVE-2026-45695? github.com/kopia/kopia (go) versions <= 0.22.3 is affected.
- Is there a fix for CVE-2026-45695? Yes. CVE-2026-45695 is fixed in 0.23.0. Upgrade to this version or later.
- Is CVE-2026-45695 exploitable, and should I be worried? Whether CVE-2026-45695 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2026-45695 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2026-45695? Upgrade
github.com/kopia/kopiato 0.23.0 or later.