/

CVE-2026-55427

Severity:

HIGH RISK

(8.3)

SSH Config Injection (CWE-74) via Coder config-ssh

CVE-2026-55427

Analyzed

Vulnerability type

Category:

Injection

CWE:

CWE-74, CWE-78

Impact:

Arbitrary SSH configuration injection and potential remote compromise

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Coder's config-ssh command previously wrote server-controlled values directly into a user's ~/.ssh/config file without sanitizing newlines or restricting allowed directives.

Under a malicious or compromised Coder deployment, this could allow arbitrary SSH configuration injection, enabling traffic redirection, credential theft, or command execution when users connect to remote development environments.

Affected context

The vulnerability appears in workflows where developers use the Coder CLI to configure SSH access to remote development environments.

Specifically, coder config-ssh consumes server-supplied HostnameSuffix and SSHConfigOptions values and writes them to ~/.ssh/config.

Risk exists when these values can be influenced by a malicious or compromised Coder server, a man-in-the-middle attacker on the control channel, or an administrator with access to the relevant settings, and when users routinely apply CLI-generated SSH configuration without manual review.

Exploit preconditions

  • Attack surface: Developer workstations that run coder config-ssh and maintain a local ~/.ssh/config file.
  • Required access: Ability to control or tamper with HostnameSuffix and SSHConfigOptions on the Coder server (malicious deployment, compromised server, misused admin privileges, or successful MITM on configuration delivery).
  • Trigger point: Execution of coder config-ssh by a user, which ingests server-provided values and writes them into the local SSH configuration file.
  • Why exploitation is possible: The CLI trusted server-supplied strings as safe configuration, allowing embedded newlines and unrestricted directives that break out of expected entries and inject arbitrary SSH options into ~/.ssh/config.

Why this happens

The core issue is unsanitized injection of server-controlled data into a client-side configuration file.

Coder's CLI treated HostnameSuffix and SSHConfigOptions as benign text and directly interpolated them into ~/.ssh/config without validating characters or restricting which SSH directives could be emitted.

This pattern aligns with CWE-74: Injection in Configuration File, where untrusted input alters configuration semantics, and is closely related to CWE-78: OS Command Injection because SSH configuration can be used to pivot into command execution or credential hijacking.

By allowing newline characters and control sequences, the tool enabled attackers to escape the intended configuration block and define arbitrary host entries, ProxyCommand, Match, and similar directives influencing subsequent SSH connections.

Potential impact

  • Attackers may inject hostile SSH directives (e.g., ProxyCommand, ProxyJump) to transparently route connections through attacker-controlled hosts.
  • SSH traffic could be redirected or proxied, enabling session observation, manipulation, or credential theft.
  • Malicious configuration can cause users to execute unintended commands when initiating SSH sessions, potentially leading to remote code execution on development hosts.
  • Sensitive keys or agent-based authentication could be exposed by altering IdentityFile, ForwardAgent, or related options.
  • Users may lose trust in local SSH behavior, as host mappings and security-related options are silently modified by server-provided configuration.

General mitigation guidance

Mitigation generally focuses on reducing trust in server-supplied configuration data and constraining what can be written into client configuration files.

Defensive patterns include validating configuration parameters against strict, allow-listed character sets and known-safe directives; rejecting control characters such as newlines and tabs that enable structural injection; and segregating auto-generated SSH configuration into separate, clearly labeled include files rather than directly editing ~/.ssh/config.

Organizations can also adopt least-privilege principles for administrative access to configuration settings, require human review of CLI-generated SSH configuration (for example via a dry-run mode or diff tools), and standardize secure defaults that avoid powerful options like ProxyCommand unless explicitly approved.

How teams detect issues like this

Detection typically combines configuration file inspection with behavioral monitoring.

Teams can periodically scan ~/.ssh/config and included files for unexpected or risky directives (e.g., ProxyCommand, ProxyJump, overly broad Match blocks, or suspicious host patterns) originating from automated tools.

Static checks in local security agents or developer environment hardening scripts can flag multi-line or unvalidated content generated by CLIs that interact with configuration files.

Code review of CLI tooling should look for direct concatenation of server-supplied strings into configuration outputs, lack of character-set validation, and absence of directive allow-listing.

Organizations may also use policy enforcement in CI/CD or endpoint management solutions to detect and alert on changes to SSH configuration that deviate from established baselines.

Sources

SourceLink
github.comgithub.com/coder/coder/pull/26154
github.comgithub.com/coder/coder/releases/tag/v2.29.17
github.comgithub.com/coder/coder/releases/tag/v2.32.7
github.comgithub.com/coder/coder/releases/tag/v2.33.8
github.comgithub.com/coder/coder/releases/tag/v2.34.2
github.comgithub.com/coder/coder/security/advisories/GHSA-mcqq-fqgf-rxwm

Frequently asked

questions

Exploitation is scoped to environments where attackers can control or influence Coder server configuration. It does not allow arbitrary internet attackers to modify ~/.ssh/config without first compromising the Coder deployment or achieving a man-in-the-middle position on its control channel.

An attacker must be able to set or tamper with HostnameSuffix and SSHConfigOptions values, typically through administrative access to a Coder instance, compromise of that server, or successful interception and modification of configuration data sent to the CLI.

The safest approach is to treat server-supplied configuration as untrusted: validate inputs against strict character sets, allow-list only known-safe SSH directives, and avoid writing arbitrary strings directly into ~/.ssh/config. Keeping auto-generated configuration separate and easy to audit further reduces risk.

Future tools should enforce robust input validation and encoding before writing to configuration files, clearly define trust boundaries for configuration sources, and integrate security checks into development and review processes. Regularly scanning generated configuration for high-risk directives and educating users to inspect dry-run outputs before applying changes also helps prevent recurrence.

Find out what's already
exploitable in your codebase.