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
AI summary AI generated
An attacker who controls a branch name passed to add-and-commit can inject git options, forcing checkout and push that overwrite remote branch history.
Mitigation
- Upgrade add-and-commit to 11.0.0 or later.
Who should check
- Anyone running EndBug add-and-commit >= 5.0.0, < 11.0.0
Vulnerability facts
- Affected
- EndBug add-and-commit >= 5.0.0, < 11.0.0
- Fixed in
- EndBug add-and-commit 11.0.0
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 6.3 (v4.0, CNA)CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:NOpen in CVSS calculator
Show all 11 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Attack requirements: Present
- Privileges required: None
- User interaction: None
- Confidentiality impact: None
- Integrity impact: Low
- Availability impact: None
- Confidentiality impact on other systems: Low
- Integrity impact on other systems: Low
- Availability impact on other systems: None
- CWE
- CWE-88
- Modified
Description
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.
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| EndBug add-and-commit | >= 5.0.0, < 11.0.0 | — | cvelist |
Versions mentioned in the description AI generated
Extracted by AI; each line quotes the description word for word. Source data above takes precedence.
- Affected: add-and-commit from 5.0.0 before 11.0.0
from 5.0.0 before 11.0.0
- Fixed: add-and-commit 11.0.0
before 11.0.0
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2026-142541. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2026-142541.md Affected: EndBug add-and-commit >= 5.0.0, < 11.0.0 Fixed in: EndBug add-and-commit 11.0.0 Steps: 1. Search this machine and project for EndBug add-and-commit: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
Technologies
References
Patches
FAQ
Is CVE-2026-142541 being exploited?
There is no confirmed exploitation: CVE-2026-142541 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.
How serious is CVE-2026-142541?
Medium: CVSS 6.3 (v4.0, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2026-142541?
EndBug add-and-commit >= 5.0.0, < 11.0.0.
Is there a fix for CVE-2026-142541?
Yes. Fixed in EndBug add-and-commit 11.0.0. Upgrade add-and-commit to 11.0.0 or later.
How do I check if I'm affected by CVE-2026-142541?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.
More endbug vulnerabilities
See all| Severity | Identifier / vulnerability | Technology | Signals | Age |
|---|---|---|---|---|
| MEDIUM 6.3 | CVE-2026-142525 User-controlled inputs are written to the job log unescaped in add-and-commit, allowing workflow commands to be forged | GitHub Actions |