{"id":"CVE-2026-142541","summary":"A branch name beginning with a hyphen is parsed as a git option by add-and-commit, allowing a forced overwrite of remote history","details":"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.","modified":"2026-12-02T22:45:23.591725232Z","published":"2026-12-02T19:18:50.070Z","database_specific":{"cwe_ids":["CWE-88"],"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142541.json","cna_assigner":"Secur0"},"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/142xxx/CVE-2026-142541.json"},{"type":"PACKAGE","url":"https://github.com/EndBug/add-and-commit"},{"type":"FIX","url":"https://github.com/EndBug/add-and-commit/commit/b4a0134716b4bf226c6b957f03ee862e961afd8d"},{"type":"FIX","url":"https://github.com/EndBug/add-and-commit/pull/755"},{"type":"ADVISORY","url":"https://github.com/EndBug/add-and-commit/releases/tag/v11.0.0"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142541"},{"type":"ADVISORY","url":"https://secur0.com/en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://github.com/endbug/add-and-commit","events":[{"introduced":"55e3676294ceab7c5a60fa9b2828ab0716926b3c"},{"fixed":"645ecc0dd0a57f4d86d26c0aa5fc42c0a856fbca"},{"fixed":"b4a0134716b4bf226c6b957f03ee862e961afd8d"}],"database_specific":{"extracted_events":[{"range":[{"introduced":"5.0.0"},{"fixed":"11.0.0"}],"source":"AFFECTED_FIELD","strategy":"StandardRange"},{"range":[{"fixed":"b4a0134716b4bf226c6b957f03ee862e961afd8d"}],"source":"REFERENCES_COMMIT"},{"original_tag":"v11.0.0","range":[{"fixed":"645ecc0dd0a57f4d86d26c0aa5fc42c0a856fbca"}],"source":"REFERENCES_TAG"}]}}],"versions":["v10.0.0","v10","v9.1.4","v9","v9.1.3","v9.1.2","v9.1.0","v9.0.1","v9.0.0","v8.0.2","v8","v8.0.1","v8.0.0","v7.5.0","v7","v7.4.0","v7.3.0","v7.2.1","v7.2.0","v7.1.2","v7.1.1","v7.1.0","v7.0.0","v6.2.0","v6","v6.1.0","v6.0.0","v5.3.0","v5","v5.2.0","v5.1.2","v5.1.1","v5.1.0","v5.0.0"],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-142541.json"}}],"schema_version":"1.9.2","severity":[{"type":"CVSS_V4","score":"CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N"}]}