CVE-2026-45695: Kopia Remote Code Execution Vulnerability
CRITICALCVE-2026-45695 is a CRITICAL (CVSS 9.8) remote code execution vulnerability (CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')) affecting Kopia libraries in the Go ecosystem. The issue involves rce via ssh proxycommand injection. Remediation is available by upgrading affected packages to version 0.23.0.
CVE-2026-45695 at a Glance
Security Impact
CVSS: 9.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:N/S:U/C:H/I:H/A:H).
How to Fix CVE-2026-45695
To remediate this vulnerability, upgrade all affected Kopia dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/kopia/kopia to 0.23.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/kopia/kopia
How to Check if You Are Affected
To determine whether your application is affected by CVE-2026-45695, inspect your project dependencies for Kopia:
inspect dependencies for github.com/kopia/kopia
Analyze the terminal output to locate any version of Kopia in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.23.0), 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-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where the product constructs all or part of an os command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended os command when it is sent to a downstream component. In Kopia, 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
CVE-2026-45695 Affected Kopia Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/kopia/kopia
|
Go |
< 0.23.0
|
0.23.0
|
References
Frequently Asked Questions
What is CVE-2026-45695?
Which Kopia versions are affected?
What version fixes CVE-2026-45695?
Is github.com/kopia/kopia affected?
What is the CVSS score of CVE-2026-45695?
What CWE is associated with CVE-2026-45695?
How can I check Go dependencies for CVE-2026-45695?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-2q4c-3mrw-63c3",
"modified" : "2026-05-19T19:18:32Z",
"published" : "2026-05-19T19:18:32Z",
"aliases" : [ "CVE-2026-45695" ],
"summary" : "Kopia: RCE via SSH ProxyCommand Injection",
"details" : "## 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.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/kopia/kopia"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "0.23.0"
} ]
} ],
"database_specific" : {
"last_known_affected_version_range" : "<= 0.22.3"
}
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/kopia/kopia/security/advisories/GHSA-2q4c-3mrw-63c3"
}, {
"type" : "WEB",
"url" : "https://github.com/kopia/kopia/pull/5354"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/kopia/kopia"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-306", "CWE-78" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-05-19T19:18:32Z",
"nvd_published_at" : null
}
}