@@ -32,6 +32,25 @@ await simpleGit({ unsafe: { allowAbbreviatedOptions: true } })
3232 .raw (' fetch' , ' --conf=user.name=me' );
3333```
3434
35+ ### Command Binaries
36+
37+ Options that allow supplying the path to executable binaries and writing to configuration options that set the path
38+ to executable binaries are caught as potentially unsafe RCE vectors, enabled through the
39+ ` allowUnsafeCommandBinaries ` option.
40+
41+ ``` typescript
42+ import { simpleGit } from ' simple-git' ;
43+
44+ // throws the GitPluginError for allowUnsafeCommandBinaries
45+ await simpleGit ().raw (' rebase' , ' --exec' , ' /custom/path' );
46+ await simpleGit ().raw (' config' , ' trailer.foo.command' , ' /custom/path' );
47+
48+ // opt in to using custom paths to executable binaries
49+ await simpleGit ({ unsafe: { allowUnsafeCommandBinaries: true } })
50+ .raw (' config' , ' trailer.foo.command' , ' /custom/path' )
51+ .raw (' rebase' , ' --exec' , ' /custom/path' );
52+ ```
53+
3554### Custom upload and receive packs
3655
3756Instead of using the default ` git-receive-pack ` and ` git-upload-pack ` binaries to parse incoming and outgoing
@@ -478,6 +497,8 @@ await simpleGit({ unsafe: { allowUnsafeExec: true } })
478497 .raw (' --exec-path=/opt/custom/libexec/git-core' , ' ls-remote' , ' https://example.com/repo.git' );
479498```
480499
500+ The ` allowUnsafeExec ` category also applies to ` --exec ` or ` -x ` options when rebasing.
501+
481502### Environment-based configuration
482503
483504Git supports injecting configuration values at runtime through a set of numbered environment variables:
0 commit comments