Summary
Multiple GitHub Actions workflows in the Langflow repository prior to 1.9.0 interpolate untrusted GitHub context values directly into run: shell commands without proper quoting or sanitization.
An attacker can craft malicious branch names, pull request titles, or workflow inputs that inject arbitrary shell commands into the CI environment, potentially leading to secret exfiltration, release tampering, and broader supply-chain compromise.
Affected context
The vulnerability occurs in GitHub Actions workflows and composite actions under .github/workflows/ and .github/actions/ in Langflow repositories that:
- Are using versions prior to 1.9.0
- Reference GitHub context fields (e.g.,
github.head_ref,github.event.pull_request.title,inputs.*) directly insiderun:shell steps - Execute these workflows for untrusted contributions (e.g., forks, feature branches, or PRs from external contributors)
Any Langflow repository with GitHub Actions enabled and these patterns present may be exposed, especially when workflows run with elevated permissions and access to CI secrets.
Exploit preconditions
- Attack surface: GitHub-hosted CI environment (GitHub Actions) associated with a Langflow repository.
- Required access: Ability to create a fork and open a pull request, or otherwise cause a branch/PR to be processed by the vulnerable workflows; no repository write access is required on the upstream.
- Trigger point: Execution of workflows that interpolate GitHub context values (branch name, PR title, workflow inputs) directly into shell commands within
run:steps. - Why exploitation is possible: Shell interprets unquoted or improperly quoted interpolated values as part of the command line. User-controlled strings (e.g., containing
&&,;, or command substitutions) are concatenated into the script, allowing attackers to break out of the intended command and execute arbitrary commands with the workflow's permissions.
Why this happens
This issue stems from treating GitHub Actions context data as trusted when embedding it into shell commands, mapping to:
- CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')
- CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component
In affected workflows, expressions such as ${{ github.head_ref }} or ${{ inputs.browsers }} are inserted directly into run: steps. When those values are not wrapped in robust quoting or safely passed as environment variables/arguments, shell metacharacters are interpreted by /bin/sh or bash, turning data into executable instructions. This is a classic injection pattern where downstream command interpreters process unvalidated, user-controlled input.
Potential impact
- Exfiltration of CI secrets (e.g.,
GITHUB_TOKEN, cloud provider credentials, package registry tokens). - Unauthorized modification of repository state via
GITHUB_TOKEN, including pushing malicious commits, tags, or releases. - Tampering with build artifacts, Docker images, or published packages, enabling supply-chain attacks on downstream users.
- Modification of deployment scripts or infrastructure configuration executed from CI workflows.
- Abuse of CI runners for arbitrary workloads, such as scanning internal resources reachable from the runner.
General mitigation guidance
Effective mitigation focuses on eliminating direct shell injection vectors and reducing trust in CI input data:
- Prefer passing context values via environment variables or action inputs and referencing them inside
run:steps with strict quoting (e.g.,"$BRANCH_NAME"). - Treat all GitHub context fields and workflow inputs as untrusted; avoid building shell command lines via string concatenation.
- Use safe argument passing patterns, such as explicit flags and arrays, rather than interpolating values into a single command string.
- Apply default-deny validation on user-controlled values where practical, enforcing whitelists for branch names, titles, or input parameters.
- Limit workflow permissions (e.g., GitHub token scopes) to the least privilege necessary, so even if a command injection occurs, its impact is constrained.
- Isolate high-privilege steps (such as publishing or deploying) into separate workflows that cannot be triggered with untrusted context or from forks.
How teams detect issues like this
Detection approaches generally combine code review discipline with automated analysis:
- Static analysis / linters for GitHub Actions that flag
${{ ... }}expressions embedded directly inrun:steps, especially those touchinggithub.*orinputs.*. - Code review checklists that require reviewers to scrutinize any new or modified workflows for unquoted context interpolation and shell-based logic.
- Repository-wide searches or CI policies for patterns like
${{ github.head_ref }},${{ github.event.pull_request.title }}, and${{ inputs.inside shell commands, ensuring they are properly quoted or refactored. - Use of policy-as-code tools (e.g., Open Policy Agent, custom GitHub Apps) to enforce rules on workflow files before merging.
- Periodic audits of workflows and composite actions, particularly those that have access to sensitive secrets or perform release/deployment operations.

