-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Remove environment variable parsing from SSH server #4266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4266 +/- ##
==========================================
+ Coverage 38.83% 38.84% +<.01%
==========================================
Files 354 354
Lines 50174 50163 -11
==========================================
Hits 19485 19485
+ Misses 27866 27855 -11
Partials 2823 2823
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add Gitea copyright to header of file
This removes the environment variable parsing code from the SSH server, which never worked in the first place. Since environment variable passing doesn't appear to be necessary for the built-in SSH server to work properly, it's removed to reduce attack surface rather than fixing it. The current code processes (untrusted) input in a buggy manner and passes it to a process invocation which doesn't actually do anything. I don't *think* this is an exploitable vulnerability but I haven't looked at it in detail, and it wouldn't really surprise me if it was. Closes go-gitea#1935, an alternative proposal which which partially fixes the environment variable handling but ultimately still leaves it broken. Signed-off-by: Hugo Landau <[email protected]>
@techknowlogick Done. |
See Git Wire Protocol, git will send SetEnv to allow wire protocol. https://github.com/git/git/blob/master/Documentation/technical/protocol-v2.txt
|
This can be closed now, as it was implemented and merged by #6825. |
This removes the environment variable parsing code from the SSH server,
which never worked in the first place. Since environment variable
passing doesn't appear to be necessary for the built-in SSH server to
work properly, it's removed to reduce attack surface rather than fixing
it.
The current code processes (untrusted) input in a buggy manner and
passes it to a process invocation which doesn't actually do anything. I
don't think this is an exploitable vulnerability but I haven't looked
at it in detail, and it wouldn't really surprise me if it was.
Closes #1935, an alternative proposal which which partially fixes the
environment variable handling but ultimately still leaves it broken.
Signed-off-by: Hugo Landau [email protected]