npm / simple-git
simple-git
What changed in simple-git 2 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
19 breaking19 security12 new APIs and options1 behavior and defaults4 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsimple-git 440 changes
Breaking changes 15
Now also covers
difftool.<tool>.path, matchingmergetool.<tool>.pathunderallowUnsafeMergeDriver.Now also covers the
git filter-branchoptions that run shell commands.Now blocks
gpg.ssh.defaultKeyCommand.Now blocks
--execfor every command other thanrebase, includingpush,send-pack,fetch-pack,archive --remote, andls-remote.When recommended checks are enabled, supplying a
.env()value different fromprocess.envrequiresallowUnsafeConfigPathsor naming the variable inallowEnvironment; passing through the inherited value is unaffected.Unlisted configuration keys emit a one-off warning unless strict mode rejects them.
Abbreviated long-form git options are no longer accepted and now throw a GitConfigurationError; use full option names.
Use this option to allow named environment variables through to the git child process; explicitly supplied disallowed variables throw when used.
Ambient environment variables are filtered before they are passed into the git child process.
The legacy gitP export was removed; use the main simpleGit export.
Parsed properties are available only through error.git; they are no longer spread onto the error itself when accessed through a trailing callback.
The deprecated import path was removed; use the main simple-git import.
The default export was removed; import the named simpleGit export instead.
The no-op clearQueue method was removed; switch to using the abort plugin.
The silent method was removed; logging is configured through environment variables in the debug package.
Security 11
Allows individually permitting environment variables; it also replaces the deprecated unsafe options that only covered environment variables.
With recommended checks or strict mode, also covers configuration settings ending in
.cmdorcommand.Blocks
git config --rename-sectionandgit config rename-section, which could move keys from a harmless section into one that runs commands.Introduced as a deprecated-on-arrival option covering listed
sendemail.*andimap.*command, file, and certificate-verification settings; preferallowConfig.Runs commands written as tagged template literals, treating each interpolated value as untrusted data that cannot add options, set configuration keys, or select a remote helper transport.
Enables strict controls for Git-impacting environment variables and Git configuration writes, and implies
unsafe.recommended.Enables checks using broader catch-all rules, defaults to false, is implied by
strict: true, and is planned to default to true in the next major version.simple-git unsafe-operation guard does not block trailer command configuration
Detection of allowUnsafeExec was added for rebase -x and rebase --exec.
simple-git allows command execution through unblocked Git configuration includes
simple-git: unsafe-operations plugin bypass via git long-option abbreviation (--receive-p/--exe) -> command execution (residual of CVE-2026-28291)
New APIs and options 11
Allows individually permitting configuration keys outside the built-in safe list; unlisted keys otherwise emit a one-off warning or are rejected in strict mode.
Introduced as a deprecated-on-arrival option covering browser and man-viewer path and command keys; prefer
allowConfig.Introduced as a deprecated-on-arrival option covering signature trust settings; prefer
allowConfig.Introduced as a deprecated-on-arrival option covering
instaweb.httpd,instaweb.modulePath, andinstaweb.gitwebDir; preferallowConfig.Exported from
@simple-git/argv-parserto identify environment variables thatsimple-gitremoves from an inherited environment.Accepts the inherited environment as an optional second argument, used to compare
HOMEandXDG_CONFIG_HOMEagainst.Provides a value wrapper for stricter validation of interpolated values passed to
git.cmd.Reported vulnerabilities now carry a
levelofdefaultfor explicitly identified risks orrecommendedfor risks caught by a catch-all rule.The vulnerability level type is exported.
VISUAL is now among the environment variables allowed by allowUnsafeEditor.
Supports one-shot stdin via git.input(data), where data can be a string or Buffer.
Behavior and default changes 1
Now covers custom binaries used by
git grep --open-files-in-pagerandinteractive.diffFilter, which pipes diffs from patch commands through a shell command.
Fixes and other changes 2
The custom binary may contain spaces when it looks like a file path, provided it includes a path separator and no path part starts or ends with a space.
Binary rename entries without byte counts are now parsed in diff summaries.
simple-git 314 changes
Breaking changes 3
simple-git now blocks this exploitable configuration key.
simple-git now blocks this per-task environment variable.
This type from argv-parser is removed in favor of a readonly array of Vulnerability.
Security 8
simple-git is vulnerable to Remote Code Execution
Remote and local paths passed to git.clone and git.mirror are wrapped with pathspec to avoid unexpected outcomes from unsanitised data.
Enhanced protocol.allow checks in allowUnsafeExtProtocol handling.
simple-git has blockUnsafeOperationsPlugin bypass via case-insensitive protocol.allow config key enables RCE
Unsafe switch detection for clone has been enhanced.
Fixes the regex for detecting unsafe clone options.
simple-git Affected by Command Execution via Option-Parsing Bypass
The unsafe plugin blocks additional cases where the -u switch is disguised alongside other single-character options.
New APIs and options 1
A new API provides simpler access to identified vulnerabilities.
Fixes and other changes 2
Checks for git -c were enhanced in the unsafe plugin.
Correctly identifies the current branch name in a cloned empty repository instead of reporting it as No.
simple-git 21 changes
Breaking changes 1
git.log now uses strict ISO dates by default; set strictDate to false to restore the previous ISO-like format.