fix(deps): update dependency simple-git to ~3.36.0 [security]#172
Open
renovate[bot] wants to merge 1 commit intomainfrom
Open
fix(deps): update dependency simple-git to ~3.36.0 [security]#172renovate[bot] wants to merge 1 commit intomainfrom
renovate[bot] wants to merge 1 commit intomainfrom
Conversation
9a0ee56 to
013d2fb
Compare
013d2fb to
c05a8d1
Compare
c05a8d1 to
3aa042e
Compare
3aa042e to
fb93ec9
Compare
fb93ec9 to
96b43dc
Compare
96b43dc to
f308160
Compare
f308160 to
5f78615
Compare
0cdf5f2 to
d73e41c
Compare
0a3a459 to
3bf770c
Compare
3bf770c to
6fe7945
Compare
6fe7945 to
bb76293
Compare
bb76293 to
70b707f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
~3.15.0→~3.36.0simple-git has blockUnsafeOperationsPlugin bypass via case-insensitive protocol.allow config key enables RCE
CVE-2026-28292 / GHSA-r275-fr43-pm7q
More information
Details
Summary
The
blockUnsafeOperationsPlugininsimple-gitfails to block git protocoloverride arguments when the config key is passed in uppercase or mixed case.
An attacker who controls arguments passed to git operations can enable the
ext::protocol by passing-c PROTOCOL.ALLOW=always, which executes anarbitrary OS command on the host machine.
Details
The
preventProtocolOverridefunction insimple-git/src/lib/plugins/block-unsafe-operations-plugin.ts(line 24)checks whether a
-cargument configuresprotocol.allowusing this regex:This regex is case-sensitive. Git treats config key names
case-insensitively — it normalises them to lowercase internally.
As a result, passing
PROTOCOL.ALLOW=always,Protocol.Allow=always,or any mixed-case variant is not matched by the regex, the check
returns without throwing, and git is spawned with the unsafe argument.
Verification that git normalises the key:
$ git -c PROTOCOL.ALLOW=always config --list | grep protocol protocol.allow=alwaysThe fix is a single character — add the
/iflag:poc.js
Test Results
Vector 1 — Original CVE-2022-25912 (
protocol.ext.allow=always, lowercase)Result: BLOCKED ✅
The original Snyk PoC payload using lowercase
protocol.ext.allow=alwaysis correctly intercepted bypreventProtocolOverridebefore git is invoked. AGitPluginErroris thrown immediately and the sentinel file is never created.Output:
Vector 2 — Uppercase bypass (
PROTOCOL.ALLOW=always)Result: BYPASSED⚠️ — RCE confirmed
The
preventProtocolOverrideregex/^\s*protocol(.[a-z]+)?.allow/is case-sensitive.PROTOCOL.ALLOW=always(uppercase) passes the check without error. Git normalises config key names to lowercase internally, enabling theext::protocol. The injected shell command executes before git errors on the missing repository stream.Output:
/tmp/pwn-codeantwas created by the git subprocess — command execution confirmed.Vector 3 — Real-world scenario (target:
https://github.com/CodeAnt-AI/codeant-quality-gates)Result: BYPASSED⚠️ — RCE confirmed
An application passes user-controlled
customArgstosimpleGit().clone(). The attacker injectsPROTOCOL.ALLOW=alwaysand substitutes a maliciousext::URL in place of the intended repository URL. The plugin does not block the uppercase variant; git enablesext::and executes the payload before the application can detect the failure.Output:
/tmp/pwn-realworldwas created — arbitrary command execution in a realistic application context confirmed.Summary
protocol.ext.allow=always(lowercase)PROTOCOL.ALLOW=always(uppercase)/tmp/pwn-codeantcreatedPROTOCOL.ALLOW=always+ attacker URL/tmp/pwn-realworldcreatedThe case-sensitive regex in
preventProtocolOverrideblocksprotocol.*.allowbut does not account for uppercase or mixed-case variants. Git accepts all variants identically due to case-insensitive config key normalisation, allowing full bypass of the protection in all versions of simple-git that carry the 2022 fix./tmp/pwnedis created by the git subprocess via theext::protocol.All of the following bypass the check:
-cprotocol.allow=alwaysPROTOCOL.ALLOW=alwaysProtocol.Allow=alwaysPROTOCOL.allow=alwaysprotocol.ALLOW=alwaysImpact
Any application that passes user-controlled values into the
customArgsparameter of
clone(),fetch(),pull(),push()or similarsimple-gitmethods is vulnerable to arbitrary command execution on the host machine.
The
ext::git protocol executes an arbitrary binary as a remote helper.With
protocol.allow=alwaysenabled, an attacker can run any OS commandas the process user — full read, write and execution access on the host.
Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
simple-git Affected by Command Execution via Option-Parsing Bypass
CVE-2026-28291 / GHSA-jcxm-m3jx-f287
More information
Details
Summary
simple-git enables running native Git commands from JavaScript. Some commands accept options that allow executing another command; because this is very dangerous, execution is denied unless the user explicitly allows it. This vulnerability allows a malicious actor who can control the options to execute other commands even in a “safe” state where the user has not explicitly allowed them. The vulnerability was introduced by an incorrect patch for CVE-2022-25860. It is likely to affect all versions prior to and including 3.28.0.
Detail
This vulnerability was introduced by an incorrect patch for CVE-2022-25860.
It was reproduced in the following environment:
The issue was not reproduced on Windows 11.
The
-uoption, like--upload-pack, allows a command to be executed.Currently, the
-uand--upload-packoptions are blocked in the filesimple-git/src/lib/plugins/block-unsafe-operations-plugin.ts.However, the problem is that command option parsing is quite flexible.
By brute forcing, I found various options that bypass the
-ucheck.All of the above are three-character options that allow command execution. They enable execution even when
allowUnsafePackis explicitly set to false.The depressing fact is that the options I found are probably only a tiny fraction of all possible option formats that enable command execution. In addition to the
-uoption, there is also the--upload-packoption and others, and some of the options I found can probably be extended to arbitrary length. Considering this, the number of option variants that enable command execution is probably infinite.Therefore, I could not find an effective way to block all such cases. Personally, I think it is virtually impossible to block this vulnerability completely. To fully block it, one would have to faithfully emulate Git’s option parsing rules, and it’s doubtful whether that is feasible.
Just in case, I’ll share the brute-force code I used to find options that enable command execution.
PoC
The environment in which I succeeded is as follows. As long as the OS remains Linux, I suspect it will succeed reliably despite considerable variation in other factors.
Create any git repository inside the
testrepo1folder. A very simple repository with a single commit and a single file is fine.Run the following:
This PoC explicitly configures
allowUnsafePacktofalse. Of course, the same vulnerability occurs even without this option. An error is the expected behavior.Check
/tmpto confirm thatpwnedhas been created.If it failed, try replacing
-vuwith a different option from the list.Impact
This vulnerability is likely to affect all versions prior to and including 3.28.0. This is because it appears to be a continuation of the series of four vulnerabilities previously found in simple-git (CVE-2022-24433, CVE-2022-24066, CVE-2022-25912, CVE-2022-25860).
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
steveukx/git-js (simple-git)
v3.36.0Compare Source
Minor Changes
89a2294: Extend known exploitable configuration keys and per-task environment variables.Note -
ParsedVulnerabilitiesfromargv-parseris removed in favour of a readonly array ofVulnerabilityto match usage insimple-git, rolled into the newvulnerabilityCheckfor simpler access to the identified issues.Thanks to @zebbern for identifying the need to block
core.fsmonitor.Thanks to @kodareef5 for identifying the need to block
GIT_CONFIG_COUNTenvironment variables and--template/mergerelated config.Patch Changes
1ad57e8: Remove conflicting node:buffer import89a2294]675570a]v3.35.2Compare Source
Patch Changes
0cf9d8c: Improvements for mono-repo publishing pipeline0cf9d8c]v3.35.1Compare Source
Patch Changes
0de400e: Update monorepo version handling during publish0de400e]v3.35.0Compare Source
Minor Changes
3d8708b: Updating publish configPatch Changes
3d8708b]v3.34.0Compare Source
Minor Changes
2b68331: Revised dependency tree to add helper modules as dependencies in mainsimple-gitPatch Changes
2e1f51c: Enhances scanning of arguments before passing on to the spawnedchild_process.Caters for
-cflags prefixing thegittask (used when setting global inline config) and suffixing with either-c,--configor--config-env. Detectsgit configoperations that write to the configuration.Updated dependencies [
2e1f51c]v3.33.0Compare Source
Minor Changes
a263635: Usepathspecwrappers for remote and local paths when running eithergit.cloneorgit.mirrortoavoid leaving them less open for unexpected outcomes when passing unsanitised data into these tasks.
Patch Changes
e253a0d: Enhancedgit -cchecks inunsafeplugin.Thanks to @JohannesLks for identifying the issue
v3.32.3Compare Source
Patch Changes
f704208: Enhancedprotocol.allowchecks inallowUnsafeExtProtocolhandling.Thanks to @CodeAnt-AI-Security for identifying the issue
v3.32.2Compare Source
Patch Changes
8d02097: Enhanced clone unsafe switch detection.v3.32.1Compare Source
Patch Changes
23b070f: Fix regex for detecting unsafe clone optionsThanks to @stevenwdv for reporting this issue.
v3.32.0Compare Source
Minor Changes
1effd8e: Enhances theunsafeplugin to block additional cases where the-uswitch may be disguisedalong with other single character options.
Thanks to @JuHwiSang for identifying this as vulnerability.
Patch Changes
d5fd4fe: Use task runner for logging use of deprecated (already no-op) functions.v3.31.1Compare Source
Patch Changes
a44184f: Resolve NPM publish stepsv3.30.0Compare Source
Minor Changes
bc77774: Correctly identify current branch name when usinggit.statusin a cloned empty repo.Previously
git.statuswould report the current branch name asNo. Thank you to @MaddyGuthridge for identifying this issue.v3.29.0Compare Source
Minor Changes
240ec64: Support for absolute paths on Windows when usinggit.checkIngore, previously Windows would reportpaths with duplicate separators
\\\\between directories.Following this change all paths returned from
git.checkIgnorewill be normalized throughnode:path,this should have no impact on non-windows users where the
gitbinary doesn't wrap absolute paths withquotes.
Thanks to @Maxim-Mazurok for reporting this issue.
9872f84: Support the use ofgit.branch(['--show-current'])to limit the branch list to only the current branch.Thanks to @peterbe for pointing out the use-case.
5736bd8: Change to biome for lint and formatv3.28.0Compare Source
Minor Changes
2adf47d: Allow repeating git options like{'--opt': ['value1', 'value2']}v3.27.0Compare Source
Minor Changes
52f767b: Addsimilarityto theDiffResultNameStatusFileinterface used when fetching log/diff with the--name-statusoption.739b0d9: Diff summary includes original name of renamed files when run wiht the--name-statusoption.bc90e7e: Fixes an issue with reporting name changes in thefilesarray returned bygit.status.Thank you @mark-codesphere for the contribution.
Patch Changes
03e1c64: Resolve error in log parsing when fields have empty values.v3.26.0Compare Source
Minor Changes
28d545b: Upgrade build tools and typescriptv3.25.0Compare Source
Minor Changes
0a5378d: Add support for parsingcount-objectsPatch Changes
4aceb15: Upgrade dependencies and build toolsv3.24.0Compare Source
Minor Changes
c355317: Enable the use of a two part custom binaryv3.23.0Compare Source
Minor Changes
9bfdf08: Bump package manager from yarn v1 to v4Patch Changes
8a3118d: Fixed a performance issue when parsing stat diff summaries9f1a174: Update build tools and workflows for Yarn 4 compatibilityv3.22.0Compare Source
Minor Changes
df14065: add status to DiffResult when using --name-statusv3.21.0Compare Source
Minor Changes
709d80e: Add firstCommit utility interfacePatch Changes
b4ab430: Add trailing callback support to git.firstCommitd3f9320: chore(deps): bump @babel/traverse from 7.9.5 to 7.23.2b76857f: chore(deps): bump axios from 1.1.3 to 1.6.1v3.20.0Compare Source
Minor Changes
2eda817: Usepathspecingit.logto allow use of previously deleted files infileargumentv3.19.1Compare Source
Patch Changes
2ab1936: keep path splitter without path specsv3.19.0Compare Source
Minor Changes
f702b61: Create a utility to append pathspec / file lists to tasks through the TaskOptions array/objectv3.18.0Compare Source
Minor Changes
5100f04: Add new interface for showBuffer to allow usinggit showon binary files.Patch Changes
f54cd0d: Examples and documentation for outputHandlerv3.17.0Compare Source
Minor Changes
a63cfc2: Timeout plugin can now be configured to ignore data on either stdOut or stdErr in the git process when determining whether to kill the spawned process.v3.16.1Compare Source
Patch Changes
066b228: Fix overly permissive regex in push parserv3.16.0Compare Source
Minor Changes
97fde2c: Support the use of-Bin place of the default-bin checkout methods0a623e5: Adds vulnerability detection to prevent use of--upload-packand--receive-packwithout explicitly opting in.Patch Changes
ec97a39: Include restricting the use of git push --exec with other allowUnsafePack exclusions, thanks to @stsewd for the suggestion.Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.