All vulnerabilities

Servers and applications

CVE-2026-34152

Command Injection via Newline in Pre/Post Deployment Commands (Heredoc Transport)

Severity
High 8.8
Published
2 Jul 2026
Last changed
2 Jul 2026
Added to UpHeron
22 Oct 2026
Fixed in
4.0.0-beta.471
Exploit chance
0.7% in the next 30 daysHigher than 51% of CVEs. EPSS by FIRST, 19 Nov 2026
Weakness
OS command injection (CWE-78)
Attack
Over the network · Needs a user account · No user action needed
Attacker can
Read data · Change data · Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Also known as
GHSA-5qp8-9gg7-4c86
Sources
Project advisories (GitHub)

Description

Pre-deployment and post-deployment commands are escaped only for single quotes (str_replace("'", "'\''", ...)) before being wrapped in sh -c '...'. That protects against breaking out of the single-quoted string in the local shell layer. The command is then sent to the server via SSH using a heredoc in SshMultiplexingHelper::generateSshCommand(): the full command string is written literally into the heredoc body, with no sanitization of newlines. On the remote side, bash -se receives the heredoc and runs it; the argument to sh -c can be a multi-line string. In sh, -c executes its argument as a script, so each line runs as a separate statement. A newline in the payload therefore injects a second (arbitrary) command without needing to break the single quotes.

The same risk was already addressed for health_check_command in ApplicationDeploymentJob.php (line 2782) by replacing newlines with spaces; that fix was not applied to pre_deployment_command or post_deployment_command.

From coollabsio/coolify's security advisory. Shortened; the full text is there.

Affected software

SoftwareAffected versions
CoolifyServers and applications · github:coollabsio/coolify
  • Every version before 4.0.0-beta.471

About Coolify

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

From its GitHub repository.
Docker Hub pulls
4,970,195Docker Hub, 15 Nov 2026
GitHub stars
66,095GitHub, 15 Nov 2026
Forks
5,989GitHub, 15 Nov 2026
Latest release
v4.7.5GitHub, 15 Nov 2026
Released
10 Nov 2026GitHub
License
Apache-2.0GitHub
First published on GitHub
25 Jan 2021GitHub

References