Skip to main content

CVE-2026-45695 — Vulnerability in github.com/kopia/kopia — CVE Details

CRITICAL

Kopia: RCE via SSH ProxyCommand Injection

Published May 19, 2026Updated June 2, 2026Source: OSV

What Should I Do?

Address in Next Maintenance Window

Low exploitation probability (1.61%). Schedule for your next planned update.

Does your project use an affected github.com/kopia/kopia version?

Paste your go.sum to check it for CVE-2026-45695 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.

Check my go.sum

Summary

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.

Impact

No user interaction is required. No valid credentials are required. The exploit is a single HTTP request.

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.

Advisory Timeline

  • First published May 19, 2026 (191 days ago).
  • Last revised June 2, 2026 — 13 days after initial publication.

Remediation

Upgrade to the fixed version using your package manager.

Go
Update github.com/kopia/kopia to 0.23.0 or later
go get github.com/kopia/kopia@v0.23.0

After upgrading, scan your dependencies again to confirm the vulnerability is resolved.

Affected Packages (1)

Affects 1 ecosystem: Go (1).

PackageFixed In
github.com/kopia/kopia Go · Affected: All versions0.23.0

Vulnerability Classification

Common Weakness Enumeration (CWE) identifiers for this vulnerability type.

CVSS Score Breakdown

What the CVSS (Common Vulnerability Scoring System) 9.8 score means for each attack dimension.

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Frequently Asked Questions

What is CVE-2026-45695?
Kopia: RCE via SSH ProxyCommand Injection. This vulnerability has been assigned a severity rating of CRITICAL (CVSS score: 9.8/10).
How do I check if my project is affected by CVE-2026-45695?
CVE-2026-45695 affects github.com/kopia/kopia. It has a 1.6% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2026-45695 and 200,000+ other known vulnerabilities.

Severity & Exploitability

CVSS Score
9.8

Maximum impact if exploited, often with little effort or access required.

EPSS Score (30-day exploit probability)
1.61%
EPSS percentile: 76.3

This places it in the top quartile of EPSS-scored vulnerabilities — 76.3% of tracked vulnerabilities score at or below it, so it is more likely to be exploited than most of the tracked corpus.

Also Known As

GHSA-2q4c-3mrw-63c3
GO-2026-5009

Related CVEs

Check your own dependencies

Free, with no signup for up to 10 packages.

Check my go.sum