[VULN-2216191] neutralize git core.fsmonitor/hooksPath RCE - #1918
Merged
Conversation
…191) The Shell class now prepends '-c core.fsmonitor= -c core.hooksPath=' and sets GIT_CONFIG_NOSYSTEM=1 / GIT_CONFIG_GLOBAL='' for every git invocation. This prevents a malicious repository's .git/config from causing git to execute an attacker-supplied program when the extension runs git blame, git rev-parse, git log, or git diff operations — all without any authentication or user interaction beyond opening the repository. 4 new unit tests added to verify the hardening is applied correctly.
marcomura
requested review from
Blastoplex,
amarg-at,
bwieger-atlassian-com,
cabella-dot,
ccallcottstevens,
cindy-atl,
dchiew-atl,
jwang19-atlassian,
leandrowd,
matt-lassian,
mattcolman,
sdzh-atlassian and
teg-atlassian
as code owners
July 28, 2026 18:33
jwang19-atlassian
approved these changes
Jul 28, 2026
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.
fix(security): neutralize git core.fsmonitor/hooksPath RCE (VULN-2216191)
Summary
The extension’s
Shellclass spawnedgitwith no config isolation, allowing a malicious repository’s.git/configto setcore.fsmonitorto an attacker-controlled executable. Git runs this program automatically during index refreshes triggered byblame,rev-parse,log, anddiff— achieving arbitrary code execution with no authentication required, just opening the repository.Fix
Shell.exec() now automatically applies the following hardening for every git invocation:
GIT_CONFIG_NOSYSTEM=1andGIT_CONFIG_GLOBAL=to skip system/global configAll four call sites (
git blame,git rev-parse,git log,git diff) are covered by this single change. Non-git commands are unaffected.Rovo Dev code review: Rovo Dev has reviewed this pull request
Any suggestions or improvements have been posted as pull request comments.