/

CVE-2026-66297

Severity:

HIGH RISK

(8.0)

OS Command Injection (CWE-78) in Livebook Deployments

CVE-2026-66297

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

User-mediated code execution on the machine running a generated deployment command

Severity:

HIGH RISK

(8.0)

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

Livebook can generate Docker and Fly.io deployment commands that include deployment group environment variable values without shell escaping. If a privileged user configures a malicious value and another user copies and runs the generated command, the embedded shell syntax may execute on that user's machine under their account.

Affected context

The issue occurs in Livebook deployment workflows that generate Docker or Fly.io setup commands from deployment group environment variables. It becomes risky when a user with permission to configure deployment group variables can influence the generated command and another user trusts and executes that command without reviewing it. Kubernetes instructions are not affected because the values are rendered into an escaped YAML manifest rather than a shell command.

Exploit preconditions

  • Attack surface: Livebook web interface and generated Docker or Fly.io deployment instructions
  • Required access: Permission to set or modify deployment group environment variables
  • Trigger point: A user copies and executes the generated setup command
  • Why exploitation is possible: Environment variable values are interpolated into double-quoted shell words without adequate shell escaping, allowing command substitution or quote termination to be interpreted by the shell

Why this happens

The vulnerability results from inserting configuration-controlled data directly into shell commands without applying context-appropriate shell escaping. Double quotes do not prevent command substitution, and embedded literal quotes can terminate the intended quoted word and introduce additional shell syntax. This behavior maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, because untrusted or insufficiently trusted input reaches a command interpreter as executable syntax.

Potential impact

  • Arbitrary commands may execute on the machine where the generated command is run
  • The executing user's files, credentials, and environment may be exposed or modified
  • Local development or deployment environments could be compromised
  • Malicious configuration could be propagated through copied deployment instructions

General mitigation guidance

Mitigation generally centers on avoiding construction of shell commands from interpolated configuration values and reducing trust in values that can be controlled through deployment settings.

Common defensive patterns include:

  • Prefer structured process-execution APIs and argument arrays over shell command strings
  • Apply shell escaping appropriate to the exact command context when a shell command must be displayed
  • Treat generated commands as untrusted output and provide clear warnings before execution
  • Validate environment variable names and values against an explicit schema and allowed-character policy where appropriate
  • Minimize permissions for users who can change deployment group configuration
  • Preserve structured or escaped representations for deployment targets that do not require shell interpretation

How teams detect issues like this

Organizations can look for:

  • Static-analysis findings where configuration or user-controlled values are concatenated into shell commands
  • Code review signals involving command construction, string interpolation, double-quoted shell words, or shell invocation APIs
  • Tests that include command-substitution syntax, backticks, quotes, and shell metacharacters in configuration values
  • Policy checks requiring structured command execution or approved shell-escaping utilities
  • Audit events for deployment group environment-variable changes followed by generation or distribution of deployment instructions

Automated code review and security scanning tools may help identify command-construction patterns, but findings should be validated against the actual execution context.

Sources

SourceLink
cna.erlef.orgcna.erlef.org/cves/CVE-2026-66297.html
github.comgithub.com/livebook-dev/livebook/commit/0c2487326bbb37cb1eb43bb2f76eb93ad9f8fd6b
github.comgithub.com/livebook-dev/livebook/commit/b2a8416d149043132fe5a14ed611e0fefc9dc9cd
github.comgithub.com/livebook-dev/livebook/commit/f8fe9c62cb8bfc1dd0ccda4ea4a57c5e91563c85
github.comgithub.com/livebook-dev/livebook/security/advisories/GHSA-qpjc-w5mm-73mj
osv.devosv.dev/vulnerability/EEF-CVE-2026-66297

Frequently asked

questions

It is not an automatic server-side execution flaw. Exploitation depends on a user with sufficient deployment configuration privileges influencing generated instructions and another user copying and running them.

An attacker needs permission to set or modify deployment group environment variables. The resulting commands execute on the machine of the person who runs the generated instructions.

Avoid interpolating configuration values into shell command strings. Prefer structured argument handling, or apply proven shell escaping for the specific shell and command context when generated commands are unavoidable.

Enforce strict input validation, limit configuration privileges, test generated commands with shell metacharacters, and clearly distinguish untrusted generated instructions from trusted executable tooling.

Find out what's already
exploitable in your codebase.