/

CVE-2026-44454

Severity:

HIGH RISK

(8.1)

Command Injection (CWE-78) in Coder Dotfiles Module

CVE-2026-44454

Analyzed

Vulnerability type

Category:

Command Injection

CWE:

CWE-78

Impact:

Arbitrary Command Execution in Remote Workspaces

Severity:

HIGH RISK

(8.1)

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 Terraform-based dotfiles registry module previously passed unsanitized user-supplied values directly into shell commands, enabling command injection inside provisioned workspaces.

By crafting a malicious dotfiles_uri and abusing auto-provisioning deep links, an attacker could cause arbitrary commands to run during workspace creation whenever a victim visited a single URL.

Affected context

The vulnerability occurs in Coder deployments that use the dotfiles registry module to bootstrap remote development workspaces via Terraform.

It is relevant when user-controlled parameters such as dotfiles_uri or related fields are interpolated into shell scripts that run as part of workspace provisioning.

Risk increases in environments that expose mode=auto deep links or similar one-click flows where parameterized URLs can silently drive workspace creation without explicit user review.

Exploit preconditions

  • Attack surface: Web-based workspace creation flows that accept dotfiles_uri or similar parameters, including deep-linked Create Workspace pages using mode=auto.
  • Required access: Ability to craft and deliver URLs or requests that set param.dotfiles_uri (typically any authenticated user, or anyone who can trick a user into clicking a Coder deep link).
  • Trigger point: The provisioning phase of workspace creation, when the Terraform-driven dotfiles module executes shell commands using the supplied values.
  • Why exploitation is possible: The module embedded unsanitized user input into shell commands using constructs like eval/sh -c, allowing shell metacharacters and command substitution ($(...)) to be interpreted and executed.

Why this happens

The underlying bug class is command injection: user-provided strings were directly incorporated into shell commands without validation or escaping, so the shell treated parts of the input as executable syntax rather than data.

In this case, the dotfiles module used generic mechanisms such as eval and sh -c to process values like dotfiles_uri, implicitly trusting them as safe command fragments.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where an application assembles OS commands from untrusted input and relies on the shell to interpret them, enabling attackers to inject arbitrary commands during workspace provisioning.

Potential impact

  • An attacker may execute arbitrary commands inside their own or a victim's newly created workspace.
  • Workspace initialization scripts could be modified to install malware, backdoors, or data exfiltration tooling.
  • Attackers could poison development environments, altering tooling or configuration to influence future code or builds.
  • Compromise of secrets or credentials stored or loaded into the workspace environment could occur.
  • In some deployments, privilege escalation or lateral movement to other infrastructure components may be possible, depending on workspace permissions and connectivity.

General mitigation guidance

Effective mitigation focuses on treating all user-controlled parameters as untrusted data and avoiding direct interpolation into shell commands.

Common defensive patterns include:

  • Replacing dynamic shell invocations (eval, sh -c) with explicit, parameterized APIs that do not invoke a shell, or with strongly typed configuration parsing.
  • Validating and constraining inputs such as URIs and usernames against strict allowlists, rejecting special characters, shell metacharacters, and unexpected schemes.
  • Separating configuration data from execution logic, ensuring that provisioning scripts consume values as data (e.g., environment variables, structured configuration) rather than constructing command strings.
  • Running provisioning steps with least-privilege accounts and minimal access to host resources, limiting the blast radius of any injected commands.
  • Designing auto-provisioning or deep-link flows so any prefilled parameters are visibly surfaced and require explicit user confirmation before execution.

How teams detect issues like this

Organizations can detect similar issues by combining code-centric and operational checks:

  • Static analysis rules that flag uses of eval, sh -c, backticks, command substitution ($(...)), or other shell features in conjunction with user input.
  • Secure code review practices that pay attention to provisioning routines, Terraform modules, and bootstrap scripts, specifically looking for command assembly from parameters like URIs, paths, or usernames.
  • Policy-based checks in CI/CD pipelines that disallow certain shell patterns or mandate validation functions for user-supplied configuration fields.
  • Runtime logging and monitoring of workspace provisioning commands, alerting on anomalous arguments or unexpected shell syntax originating from user parameters.
  • Periodic security assessments of template modules and registry components that are reused across many workspaces, since a single unsafe pattern there can propagate widely.

Sources

SourceLink
github.comgithub.com/coder/coder/commit/60e3ab7632f42415d283b9fd5622ee53a4639ceb
github.comgithub.com/coder/coder/pull/22011
github.comgithub.com/coder/coder/releases/tag/v2.29.7
github.comgithub.com/coder/coder/releases/tag/v2.30.2
github.comgithub.com/coder/coder/security/advisories/GHSA-m3cr-vc2j-pm27
github.comgithub.com/coder/registry/commit/8e68c96633f65a1babd76a93b6923e3deead4a82
github.comgithub.com/coder/registry/pull/703

Frequently asked

questions

Exploitability depends on how widely the dotfiles module and auto-provisioning links are used. In deployments where users frequently create workspaces via deep links and do not inspect prefilled parameters, a crafted URL can reliably trigger command execution during workspace setup.

Typically, the attacker needs the ability to supply or influence the dotfiles_uri parameter, often by sending a victim a specially crafted Create Workspace URL. Access may be limited to authenticated users, but social engineering (convincing someone to click a link) can be sufficient to exploit the issue.

The safest pattern is to avoid constructing shell commands from untrusted input altogether. Use non-shell APIs for operations like fetching dotfiles, enforce strict input validation and allowlists, and eliminate eval or generic sh -c calls that interpret user-controlled strings.

Treat provisioning scripts and Terraform modules as security-sensitive code: enforce reviews that flag any shell invocation with user-controlled parameters, adopt automated checks for dangerous shell constructs, centralize input validation logic, and design workflows so that auto-filled configuration values are transparent and require explicit user approval before execution.

Find out what's already
exploitable in your codebase.