Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reject potential option injections over ssh#6636

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ethomson merged 5 commits intomainfromcmn/ssh-eoo
Oct 17, 2023
Merged

Conversation

carlosmn
Copy link
Member

Like git (and basically everyone else, that was a fun CVE) did a while ago, we need to reject urls that might inject options into ssh which could cause it to execute arbitrary commands instead of what we mean for it to execute.

This is on the yet-unreleased exec-based transport so a public PR should be fine.

As git does, we also reject suspicious paths which may be trying to inject options into the command we ask the remote to execute. This is out of an abundance of caution.

I'm opening this up as a draft as we should have at least a little bit of testing there.

I put the function in with thenet ones because I couldn't think of where to put it. git puts it with some path functions but our organisation is different.

This function returns true if the string starts with a `-` as that could be usedto inject options into commands we execute.
If you pass along something like `-oProxyCommand=...` as the hostname, we wouldpass that along to ssh unbeknownst to us and potentially also the user, ifthey were asking a tool to recursively clone submodules.This is the same fix as mainline git although they don't separate the usernameand host for ssh so ours looks like it's checking more.
Like in the previous commit and in git, we reject a path that looks like anoption to avoid injection into the command we ask the remote to execute.
@ethomsonethomson marked this pull request as ready for reviewSeptember 19, 2023 23:00
@ethomson
Copy link
Member

Oops I fat fingered the mobile app and marked this for ready for review. 😅

@carlosmncarlosmnforce-pushed thecmn/ssh-eoo branch 2 times, most recently from017062e tob745268CompareSeptember 25, 2023 10:27
@carlosmn
Copy link
MemberAuthor

OK I think we're good to go now.

@ethomson
Copy link
Member

Thanks@carlosmn -- sorry for the delay here. I was thinking thatprocess might make more sense? I just went ahead and pushed up a change since it's been so long. 😓

@carlosmn
Copy link
MemberAuthor

Yes, that namespace make sense, I was just trying to fit it into the existing ones.

@ethomsonethomson merged commita6205fa intomainOct 17, 2023
@ethomsonethomson deleted the cmn/ssh-eoo branchOctober 17, 2023 07:23
@ethomson
Copy link
Member

Thanks Carlos!

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@carlosmn@ethomson

[8]ページ先頭

©2009-2025 Movatter.jp