Fix leaking environment variables#662
Conversation
ankostis
left a comment
There was a problem hiding this comment.
Isn't this change kind of intrusive?
- Hooks expect certain variables to function, is this working with new default NOT to expand env-variables at all?
- Or break BW-compatibility with existing clients?
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #662 +/- ##
=========================================
+ Coverage 92.57% 94.37% +1.8%
=========================================
Files 61 61
Lines 9968 9976 +8
=========================================
+ Hits 9228 9415 +187
+ Misses 740 561 -179
Continue to review full report at Codecov.
|
Sorry, something went wrong.
|
Regarding compatibility, this is OFF by default for now. It will work with existing projects just fine. |
Sorry, something went wrong.
|
Thanks a lot for your contribution! |
Sorry, something went wrong.
When cloning a repo, GitPython will leak environment variables in error messages. For instance, this code:
will output something like:
This behavior has unwanted security implications. To counter this, I've added an
unsafevariable, which will allow for environment variables to be expanded, otherwise, this behavior is disabled. By default, this variable is set to True. However, when used with environment variables, a warning is displayed. Hopefully, this will eventually be set to False by default. When running the same code, but with unsafe set to False, here's the output: