A branch name beginning with a hyphen is parsed as a git option by add-and-commit, allowing a forced overwrite of remote history
- Exploited
- No known exploitation
- Fix
- Fixed in 11.0.0
- Who is exposed
- Not reported
Summary
Improper Neutralization of Argument Delimiters in a Command (CWE-88) in add-and-commit from 5.0.0 before 11.0.0 allows a party who controls the branch name a workflow passes to the action to run git checkout and git push with an option of their choosing. The new_branch input, called branch before 8.0.0, is used as a single positional value and is never passed through matchGitArgs() or validated, unlike the inputs the README documents as taking raw git arguments. src/main.ts hands it to simple-git's checkout(), which builds the argument vector ['checkout', value], and on the default push path to push(), which builds ['push', 'origin', value, '--set-upstream']. git parses every element of its argument vector for a leading hyphen wherever it appears, so a value of --force is taken as the option and not as a branch name. The two commands become git checkout --force, which discards the staged changes the action was about to commit, and git push origin --force --set-upstream, which overwrites the remote branch with the runner's local state and removes from its history any commits pushed since that checkout. git's reference name rules permit a leading hyphen, so a branch named --force can be created and pushed to a fork with git push origin HEAD:refs/heads/--force, although the git branch porcelain refuses such a name; a workflow that derives new_branch from a head branch name therefore takes the value from whoever opened the pull request. The action reports committed and pushed as true and logs that the branch already existed.
What to do
Upgrade to a fixed version: 11.0.0.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-142541 (A branch name beginning with a hyphen is parsed as a git option by add-and-commit, allowing a forced overwrite of remote history), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-142541 (entry last updated 2026-12-02):
Affected:
- EndBug add-and-commit: from 5.0.0, fixed in 11.0.0
Fixed versions: 11.0.0.
Setup: unknown whether the bug needs a non-default feature or setting. Check the advisory.
CISA KEV: CVE-2026-142541 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-142541 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Installed software: check what is actually running, not what a repo declares. Read the version from each host, container image and Kubernetes node (the binary's version output, the OS package database, image layers), and check whether the conditions above hold there. Distribution packages may carry a backported fix under an older version number; confirm against the distribution's own advisory.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/EndBug/add-and-commit/commit/b4a0134716b4bf226c6b957f03ee862e961afd8d
- https://github.com/EndBug/add-and-commit/pull/755
- https://github.com/EndBug/add-and-commit/releases/tag/v11.0.0
- https://secur0.com/en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-142541
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-142541"}.Affected versions
- EndBug add-and-commitFrom 5.0.0 · fixed in 11.0.0
cve.now Index
- Exploitation0/40No signal
- Exposure20/25No login or user action needed per the CVSS vector, CISA rates it automatable · Unknown: No advisory context yet
- Reach?/20Unknown. No tracked technology or package matched
- Severity6.3/10CVSS 6.3
- No patch0/5No signal
What would change the score
- Would score about 71 if added to CISA KEV
- Would score about 66 if CISA's SSVC rates exploitation active
- Would score about 31 if advisories confirm default setups are exposed
Timeline
- CVE published
- First seen by cve.now
- CISA SSVC assessment
Exploitation: none · Automatable: yes · Technical impact: partial
- Record last updated
Evidence 6
| Kind | Source |
|---|---|
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-142541 |
| Record | NVD · CVE-2026-142541 |
| Other links 4 | |
| Patch | GitHub · EndBug/add-and-commit · Commit b4a01347 |
| Patch | GitHub · EndBug/add-and-commit · Pull request #755 |
| Repository | GitHub · EndBug/add-and-commit · Release v11.0.0 |
| Link | secur0.com · en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection |
Questions about CVE-2026-142541
Is CVE-2026-142541 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
Which versions are affected by CVE-2026-142541?
add-and-commit: from 5.0.0 before 11.0.0.
Source: cve.now feed data
How do I fix CVE-2026-142541?
Upgrade to a fixed version: 11.0.0.
Source: cve.now feed data
Related
- CVE-2026-142525User-controlled inputs are written to the job log unescaped in add-and-commit, allowing workflow commands to be forged
- CVE-2026-108043Command injection and arbitrary file write via unvalidated server-supplied VPN configuration
- CVE-2026-136629Nektos act 0.2.92 before 0.2.95 .actrc Allowlist Bypass via Argument Smuggling
- CVE-2026-137198cross-spawn: Argument injection on Windows via backslashes before a double quote
- CVE-2026-134494Tanium addressed an argument injection vulnerability in Core Content.
- CVE-2026-142216gemini-mcp-tool through 1.1.8 Argument Injection via model Parameter
No corrections so far. Something wrong on this page? Report an error.