{"api_version":"1","generated_at":"2026-12-02T22:27:12+00:00","cve":"CVE-2026-142541","urls":{"html":"https://cve.report/CVE-2026-142541","api":"https://cve.report/api/cve/CVE-2026-142541.json","docs":"https://cve.report/api","cve_org":"https://www.cve.org/CVERecord?id=CVE-2026-142541","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2026-142541"},"summary":{"title":"A branch name beginning with a hyphen is parsed as a git option by add-and-commit, allowing a forced overwrite of remote history","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.","state":"PUBLISHED","assigner":"Secur0","published_at":"2026-12-02 20:20:48","updated_at":"2026-12-02 22:18:35"},"problem_types":["CWE-88","CWE-88 CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')"],"metrics":[{"version":"4.0","source":"4daa8cea-433a-44bd-9456-53b127fc289a","type":"Secondary","score":"6.3","severity":"MEDIUM","vector":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","data":{"version":"4.0","vectorString":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":6.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}},{"version":"4.0","source":"CNA","type":"CVSS","score":"6.3","severity":"MEDIUM","vector":"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","data":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":6.3,"baseSeverity":"MEDIUM","exploitMaturity":"NOT_DEFINED","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnerabilityResponseEffort":"NOT_DEFINED"}}],"references":[{"url":"https://github.com/EndBug/add-and-commit/commit/b4a0134716b4bf226c6b957f03ee862e961afd8d","name":"https://github.com/EndBug/add-and-commit/commit/b4a0134716b4bf226c6b957f03ee862e961afd8d","refsource":"4daa8cea-433a-44bd-9456-53b127fc289a","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://secur0.com/en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection","name":"https://secur0.com/en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection","refsource":"4daa8cea-433a-44bd-9456-53b127fc289a","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/EndBug/add-and-commit/releases/tag/v11.0.0","name":"https://github.com/EndBug/add-and-commit/releases/tag/v11.0.0","refsource":"4daa8cea-433a-44bd-9456-53b127fc289a","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://github.com/EndBug/add-and-commit/pull/755","name":"https://github.com/EndBug/add-and-commit/pull/755","refsource":"4daa8cea-433a-44bd-9456-53b127fc289a","tags":[],"title":"","mime":"","httpstatus":"","archivestatus":"0"},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-142541","name":"CVE Program record","refsource":"CVE.ORG","tags":["canonical"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-142541","name":"NVD vulnerability detail","refsource":"NVD","tags":["canonical","analysis"]}],"affected":[{"source":"CNA","vendor":"EndBug","product":"add-and-commit","version":"affected 5.0.0 11.0.0 semver","platforms":[]}],"timeline":[],"solutions":[{"source":"CNA","title":"","value":"Upgrade to add-and-commit 11.0.0 or later, which validates new_branch with assertValidBranchName() before using it. On an affected version, do not derive new_branch from a value an outside contributor controls, such as a head branch name; where it has to be dynamic, reject any value beginning with a hyphen in a preceding step.","time":"","lang":"en"}],"workarounds":[],"exploits":[],"credits":[{"source":"CNA","value":"Lois del Río Somoza","lang":"en"},{"source":"CNA","value":"Xoán M. Otero Jorge","lang":"en"},{"source":"CNA","value":"Darío Rivas","lang":"en"},{"source":"CNA","value":"Secur0 CNA","lang":"en"},{"source":"CNA","value":"Federico Grandi @EndBug","lang":"en"}],"nvd_cpes":[],"vendor_comments":[],"enrichments":{"kev":null,"epss":null,"legacy_qids":[]},"source_records":{"cve_program":{"containers":{"adp":[{"metrics":[{"other":{"content":{"id":"CVE-2026-142541","options":[{"Exploitation":"none"},{"Automatable":"yes"},{"Technical Impact":"partial"}],"role":"CISA Coordinator","timestamp":"2026-12-02T21:24:27.135201Z","version":"2.0.3"},"type":"ssvc"}}],"providerMetadata":{"dateUpdated":"2026-12-02T21:24:36.208Z","orgId":"134c704f-9b21-4f2e-91b3-4a467353bcc0","shortName":"CISA-ADP"},"title":"CISA ADP Vulnrichment"}],"cna":{"affected":[{"cpes":["cpe:2.3:a:endbug:add-and-commit:*:*:*:*:*:*:*:*"],"defaultStatus":"unaffected","packageURL":"pkg:github/endbug/add-and-commit","product":"add-and-commit","programFiles":["src/main.ts","src/util.ts"],"repo":"https://github.com/EndBug/add-and-commit","vendor":"EndBug","versions":[{"lessThan":"11.0.0","status":"affected","version":"5.0.0","versionType":"semver"}]}],"cpeApplicability":[{"nodes":[{"cpeMatch":[{"criteria":"cpe:2.3:a:endbug:add-and-commit:*:*:*:*:*:*:*:*","versionEndExcluding":"11.0.0","versionStartIncluding":"5.0.0","vulnerable":true}],"negate":false,"operator":"OR"}],"operator":"OR"}],"credits":[{"lang":"en","type":"finder","value":"Lois del Río Somoza"},{"lang":"en","type":"analyst","value":"Xoán M. Otero Jorge"},{"lang":"en","type":"analyst","value":"Darío Rivas"},{"lang":"en","type":"coordinator","value":"Secur0 CNA"},{"lang":"en","type":"remediation developer","value":"Federico Grandi @EndBug"}],"descriptions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"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 <code>git checkout</code> and <code>git push</code> with an option of their choosing. The <code>new_branch</code> input, called <code>branch</code> before 8.0.0, is used as a single positional value and is never passed through <code>matchGitArgs()</code> or validated, unlike the inputs the README documents as taking raw git arguments. <code>src/main.ts</code> hands it to simple-git's <code>checkout()</code>, which builds the argument vector <code>['checkout', value]</code>, and on the default push path to <code>push()</code>, which builds <code>['push', 'origin', value, '--set-upstream']</code>. git parses every element of its argument vector for a leading hyphen wherever it appears, so a value of <code>--force</code> is taken as the option and not as a branch name. The two commands become <code>git checkout --force</code>, which discards the staged changes the action was about to commit, and <code>git push origin --force --set-upstream</code>, 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 <code>--force</code> can be created and pushed to a fork with <code>git push origin HEAD:refs/heads/--force</code>, although the <code>git branch</code> porcelain refuses such a name; a workflow that derives <code>new_branch</code> from a head branch name therefore takes the value from whoever opened the pull request. The action reports <code>committed</code> and <code>pushed</code> as true and logs that the branch already existed."}],"value":"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."}],"metrics":[{"cvssV4_0":{"Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","Safety":"NOT_DEFINED","attackComplexity":"LOW","attackRequirements":"PRESENT","attackVector":"NETWORK","baseScore":6.3,"baseSeverity":"MEDIUM","exploitMaturity":"NOT_DEFINED","privilegesRequired":"NONE","providerUrgency":"NOT_DEFINED","subAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","userInteraction":"NONE","valueDensity":"NOT_DEFINED","vectorString":"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","version":"4.0","vulnAvailabilityImpact":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnerabilityResponseEffort":"NOT_DEFINED"},"format":"CVSS","scenarios":[{"lang":"en","value":"GENERAL"}]}],"problemTypes":[{"descriptions":[{"cweId":"CWE-88","description":"CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')","lang":"en","type":"CWE"}]}],"providerMetadata":{"dateUpdated":"2026-12-02T19:18:50.070Z","orgId":"4daa8cea-433a-44bd-9456-53b127fc289a","shortName":"Secur0"},"references":[{"tags":["patch"],"url":"https://github.com/EndBug/add-and-commit/commit/b4a0134716b4bf226c6b957f03ee862e961afd8d"},{"tags":["patch"],"url":"https://github.com/EndBug/add-and-commit/pull/755"},{"tags":["release-notes"],"url":"https://github.com/EndBug/add-and-commit/releases/tag/v11.0.0"},{"tags":["third-party-advisory","technical-description"],"url":"https://secur0.com/en/cna/cve-list/cve-2026-142541-add-and-commit-git-argument-injection"}],"solutions":[{"lang":"en","supportingMedia":[{"base64":false,"type":"text/html","value":"Upgrade to add-and-commit 11.0.0 or later, which validates <code>new_branch</code> with <code>assertValidBranchName()</code> before using it. On an affected version, do not derive <code>new_branch</code> from a value an outside contributor controls, such as a head branch name; where it has to be dynamic, reject any value beginning with a hyphen in a preceding step."}],"value":"Upgrade to add-and-commit 11.0.0 or later, which validates new_branch with assertValidBranchName() before using it. On an affected version, do not derive new_branch from a value an outside contributor controls, such as a head branch name; where it has to be dynamic, reject any value beginning with a hyphen in a preceding step."}],"source":{"discovery":"EXTERNAL"},"tags":["x_open-source"],"title":"A branch name beginning with a hyphen is parsed as a git option by add-and-commit, allowing a forced overwrite of remote history","x_generator":{"engine":"Vulnogram 1.0.5"}}},"cveMetadata":{"assignerOrgId":"4daa8cea-433a-44bd-9456-53b127fc289a","assignerShortName":"Secur0","cveId":"CVE-2026-142541","datePublished":"2026-12-02T19:18:50.070Z","dateReserved":"2026-12-02T19:01:36.224Z","dateUpdated":"2026-12-02T21:24:36.208Z","state":"PUBLISHED"},"dataType":"CVE_RECORD","dataVersion":"5.2"},"nvd":{"publishedDate":"2026-12-02 20:20:48","lastModifiedDate":"2026-12-02 22:18:35","problem_types":["CWE-88","CWE-88 CWE-88 Improper Neutralization of Argument Delimiters in a Command ('Argument Injection')"],"metrics":{"cvssMetricV40":[{"source":"4daa8cea-433a-44bd-9456-53b127fc289a","type":"Secondary","cvssData":{"version":"4.0","vectorString":"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","baseScore":6.3,"baseSeverity":"MEDIUM","attackVector":"NETWORK","attackComplexity":"LOW","attackRequirements":"PRESENT","privilegesRequired":"NONE","userInteraction":"NONE","vulnConfidentialityImpact":"NONE","vulnIntegrityImpact":"LOW","vulnAvailabilityImpact":"NONE","subConfidentialityImpact":"LOW","subIntegrityImpact":"LOW","subAvailabilityImpact":"NONE","exploitMaturity":"NOT_DEFINED","confidentialityRequirement":"NOT_DEFINED","integrityRequirement":"NOT_DEFINED","availabilityRequirement":"NOT_DEFINED","modifiedAttackVector":"NOT_DEFINED","modifiedAttackComplexity":"NOT_DEFINED","modifiedAttackRequirements":"NOT_DEFINED","modifiedPrivilegesRequired":"NOT_DEFINED","modifiedUserInteraction":"NOT_DEFINED","modifiedVulnConfidentialityImpact":"NOT_DEFINED","modifiedVulnIntegrityImpact":"NOT_DEFINED","modifiedVulnAvailabilityImpact":"NOT_DEFINED","modifiedSubConfidentialityImpact":"NOT_DEFINED","modifiedSubIntegrityImpact":"NOT_DEFINED","modifiedSubAvailabilityImpact":"NOT_DEFINED","Safety":"NOT_DEFINED","Automatable":"NOT_DEFINED","Recovery":"NOT_DEFINED","valueDensity":"NOT_DEFINED","vulnerabilityResponseEffort":"NOT_DEFINED","providerUrgency":"NOT_DEFINED"}}],"ssvcV203":[{"source":"134c704f-9b21-4f2e-91b3-4a467353bcc0","ssvcData":{"timestamp":"2026-12-02T21:24:27.135201Z","id":"CVE-2026-142541","options":[{"exploitation":"none"},{"automatable":"yes"},{"technicalImpact":"partial"}],"role":"CISA Coordinator","version":"2.0.3"}}]},"configurations":[]},"legacy_mitre":{"record":{"CveYear":"2026","CveId":"142541","Ordinal":"1","Title":"A branch name beginning with a hyphen is parsed as a git option ","CVE":"CVE-2026-142541","Year":"2026"},"notes":[{"CveYear":"2026","CveId":"142541","Ordinal":"1","NoteData":"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.","Type":"Description","Title":"A branch name beginning with a hyphen is parsed as a git option "}]}}}