/

CVE-2026-34597

Severity:

HIGH RISK

(8.8)

OS Command Injection (CWE-78) in Coolify Nixpacks Build

CVE-2026-34597

Deferred

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Authenticated Remote Code Execution on Deployment Host

Severity:

HIGH RISK

(8.8)

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

An OS command injection vulnerability in Coolify's Nixpacks build pack allows attacker-controlled build parameters to be concatenated into shell commands executed on the deployment host.

When a malicious install_command is supplied by an authenticated user, it can escape the intended build context and run arbitrary commands with host-level privileges during the build phase.

Affected context

This vulnerability affects Coolify installations that use the Nixpacks build pack and allow users to define custom build parameters, including install_command.

It becomes relevant when application owners or tenant users can configure build commands that are later executed on a server responsible for building and deploying applications.

The risk increases in multi-tenant or shared-host environments where build operations execute with elevated or host-level privileges.

Exploit preconditions

  • Attack surface: Coolify web interface or API exposed for configuring Nixpacks build settings
  • Required access: Authenticated access with permission to set or modify install_command for a project or service
  • Trigger point: Initiation of a deployment or build process that uses the crafted install_command
  • Why exploitation is possible: User-controlled data is directly concatenated into a shell command string without proper validation, escaping, or context separation, enabling arbitrary command execution.

Why this happens

The core issue is the direct inclusion of user-supplied build parameters into shell command strings, mapping to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

Instead of treating install_command as data within a constrained execution context (e.g., arguments to a fixed binary or structured configuration), the application embeds it into a shell command, allowing metacharacters, control operators, and additional commands to be interpreted by the shell.

This pattern reflects a broader bug class where untrusted input is passed to command interpreters without neutralization, escaping, or strict command templates, permitting attackers to alter the command's semantics and execute arbitrary operations.

Potential impact

  • Attacker may execute arbitrary commands on the deployment host
  • Host-level compromise and potential full takeover of the underlying server
  • Unauthorized access to other applications, databases, or services deployed via Coolify
  • Data exfiltration, modification, or destruction on the host and connected systems
  • Lateral movement into adjacent infrastructure or internal networks

General mitigation guidance

Effective mitigation centers on eliminating direct command concatenation and constraining how user-supplied values interact with the operating system.

Recommended patterns include:

  • Treat user-defined build parameters as data, not commands, and pass them as arguments to well-defined tooling rather than to a shell.
  • Use high-level APIs or libraries that execute commands without invoking a shell, and avoid string-based command construction.
  • Enforce strict validation and allowlisting of acceptable command fragments or options for build parameters.
  • Run build processes with least privilege, isolating them in containers or sandboxes to reduce blast radius if misuse occurs.
  • Clearly separate tenant-controlled configuration from host-level automation and avoid exposing sensitive execution paths to user input.

How teams detect issues like this

Detection typically involves a combination of code-level analysis and runtime monitoring:

  • Static analysis rules that flag uses of shell execution functions (e.g., system, exec, shell wrappers) where user-controlled data is concatenated into command strings.
  • Code review practices that require justification for any dynamic command construction and enforce patterns such as parameterized execution APIs.
  • Configuration and policy checks to ensure build parameters are validated, constrained, and not passed directly to shell interpreters.
  • Runtime logging and monitoring of build commands executed on hosts, with alerts for unexpected command patterns or anomalous behavior.
  • Use of automated security scanning tools that can model data flow from user inputs into OS command execution sites.

Sources

SourceLink
github.comgithub.com/coollabsio/coolify/security/advisories/GHSA-9pp4-wcmj-rq73

Frequently asked

questions

Exploitation requires authenticated access to Coolify with the ability to configure Nixpacks build parameters. Within that scope, any user who can control install_command for a project can potentially achieve code execution on the deployment host during builds.

An attacker needs an account or API token with permissions to modify or define build configuration, particularly the install_command field for services using Nixpacks. No direct shell or host access is required beyond this application-level control.

The safest approach is to remove direct shell command construction based on user input, instead using parameterized execution APIs or constrained build templates. User-provided values should be validated and treated as data, not commands, and build environments should run with minimal privileges.

Design deployment and build systems so that configuration influences behavior through structured parameters rather than arbitrary command strings. Establish secure coding guidelines around command execution, enforce validation and allowlists on user-supplied inputs, and integrate static analysis and security review into CI/CD pipelines to catch injection patterns early.

Find out what's already
exploitable in your codebase.