Skip to main content
CVE Vulnerability Database
Vulnerability Database/CVE-2026-27113

CVE-2026-27113: Liquid Prompt RCE Vulnerability

CVE-2026-27113 is a remote code execution flaw in Liquid Prompt that allows command injection through crafted Git branch names. This post explains its impact, affected versions, and mitigation steps.

Published:

CVE-2026-27113 Overview

CVE-2026-27113 is a command injection vulnerability affecting Liquid Prompt, an adaptive prompt tool for Bash and Zsh shells. The vulnerability exists in the gitstatusd backend functionality where crafted Git branch names containing shell metacharacters can lead to arbitrary code execution when a user navigates to a malicious repository.

Critical Impact

Attackers can achieve arbitrary code execution by crafting Git branch names containing shell syntax such as $(...) or backtick expressions, which are evaluated when the shell prompt renders.

Affected Products

  • Liquid Prompt (master branch) - commits from cf3441250bb5d8b45f6f8b389fcdf427a99ac28a to a4f6b8d8c90b3eaa33d13dfd1093062ab9c4b30c
  • Environments with LP_ENABLE_GITSTATUSD enabled (default)
  • Systems with gitstatusd installed and started before Liquid Prompt loads

Discovery Timeline

  • 2026-02-20 - CVE-2026-27113 published to NVD
  • 2026-02-23 - Last updated in NVD database

Technical Details for CVE-2026-27113

Vulnerability Analysis

This command injection vulnerability (CWE-78) occurs in Liquid Prompt's Git branch handling when the gitstatusd backend is enabled. The flaw stems from improper sanitization of branch names retrieved from Git repositories. When a user enters a directory containing a Git repository with a maliciously crafted branch name, the shell evaluates the branch name as part of prompt rendering.

The vulnerability requires a specific configuration: LP_ENABLE_GITSTATUSD must be enabled (which is the default setting), gitstatusd must be installed and running before Liquid Prompt loads (not the default behavior), and shell prompt substitution must be active (enabled by default in Bash via shopt -s promptvars, but not in Zsh).

Exploitation occurs when branch names contain shell command syntax such as $(malicious_command) or backtick expressions. These are interpreted and executed by the shell during prompt rendering, allowing an attacker to execute arbitrary commands in the context of the user's session.

Root Cause

The root cause lies in the _lp_git_branch() function's handling of branch names from the gitstatusd backend. Prior to the fix, when gitstatusd data was available, the branch name from VCS_STATUS_LOCAL_BRANCH was assigned directly to lp_vcs_branch without being passed through the __lp_escape sanitization function. This allowed shell metacharacters in branch names to be interpreted during prompt evaluation.

Attack Vector

The attack vector is local, requiring user interaction. An attacker must create a Git repository with a maliciously named branch (either as the default branch or a checked-out branch) and trick a victim into navigating to that directory. Common attack scenarios include:

  1. Distributing malicious repositories via code hosting platforms
  2. Placing malicious repositories in shared file systems
  3. Social engineering attacks targeting developers

When the victim enters the repository directory, Liquid Prompt renders the prompt, evaluating the malicious branch name and executing the embedded commands.

text
 
 # Get the branch name of the Git repo in the current directory.
 _lp_git_branch() {
-    if (( _LP_GITSTATUS_DATA )); then
-        lp_vcs_branch="${VCS_STATUS_LOCAL_BRANCH-}"
-        [[ -n "$lp_vcs_branch" ]] && return || return 1
-    fi
-
-    lp_vcs_branch=""
     local branch ret
+
+    if (( _LP_GITSTATUS_DATA )); then
+        branch="${VCS_STATUS_LOCAL_BRANCH-}"
     # Recent versions of Git support the --short option for symbolic-ref, but
     # not 1.7.9 (Ubuntu 12.04)
-    if branch="$(\git symbolic-ref -q HEAD 2>/dev/null)"; then
-        __lp_escape "${branch#refs/heads/}"
-        lp_vcs_branch="$ret"
+    elif branch="$(\git symbolic-ref -q HEAD 2>/dev/null)"; then
+        branch="${branch#refs/heads/}"
     else
+        lp_vcs_branch=""
         return 1
     fi
+
+    __lp_escape "$branch"
+    lp_vcs_branch="$ret"
+    [[ -n "$lp_vcs_branch" ]]
 }
 

Source: GitHub Commit Update

Detection Methods for CVE-2026-27113

Indicators of Compromise

  • Presence of Git branches with names containing shell metacharacters such as $(), backticks, or command substitution syntax
  • Unusual process spawning from shell prompt processes
  • Unexpected outbound network connections originating from shell sessions

Detection Strategies

  • Monitor for Git repository directories containing branches with suspicious naming patterns including $(, `, |, ;, or other shell metacharacters
  • Implement file integrity monitoring on Liquid Prompt installation files to detect unauthorized modifications
  • Review shell history and process execution logs for anomalous activity following directory changes

Monitoring Recommendations

  • Enable process auditing to track command execution patterns, particularly child processes spawned during prompt rendering
  • Implement endpoint detection rules for suspicious shell activity triggered by directory navigation
  • Monitor for unusual Git operations or repository cloning activity that could indicate delivery of malicious repositories

How to Mitigate CVE-2026-27113

Immediate Actions Required

  • Disable the gitstatusd backend by setting LP_ENABLE_GITSTATUSD=0 in your Liquid Prompt configuration
  • Update Liquid Prompt to commit a4f6b8d8c90b3eaa33d13dfd1093062ab9c4b30c or later on the master branch
  • Audit any Git repositories recently cloned or accessed for suspicious branch names

Patch Information

The vulnerability is fixed in commit a4f6b8d8c90b3eaa33d13dfd1093062ab9c4b30c on the master branch. The fix ensures that all branch names, including those retrieved from gitstatusd, are passed through the __lp_escape function before being assigned to lp_vcs_branch. This sanitizes shell metacharacters and prevents command injection during prompt rendering.

No stable release is affected by this vulnerability; only the master branch contains the vulnerable commit range. Users running development versions from the master branch should update immediately.

For more information, see the GitHub Security Advisory.

Workarounds

  • Set LP_ENABLE_GITSTATUSD=0 in your Liquid Prompt configuration file (~/.liquidpromptrc or /etc/liquidpromptrc)
  • Disable shell prompt substitution in Bash by running shopt -u promptvars (note: this may break other prompt functionality)
  • Do not start gitstatusd before loading Liquid Prompt to avoid the vulnerable code path
bash
# Configuration example
# Add to ~/.liquidpromptrc to disable gitstatusd backend
LP_ENABLE_GITSTATUSD=0

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.