Skip to content
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

Host keys are not checked when using SFTP #5466

Open
happyc0ding opened this issue Dec 27, 2024 · 1 comment
Open

Host keys are not checked when using SFTP #5466

happyc0ding opened this issue Dec 27, 2024 · 1 comment
Assignees

Comments

@happyc0ding
Copy link

https://github.com/juicedata/juicefs/blob/53f57ac4b06ce52d069b396c89d3e9e1487e3b7c/pkg/object/sftp.go#L532C20-L532C47 uses ssh.InsecureIgnoreHostKey().

As https://pkg.go.dev/golang.org/x/crypto/ssh#InsecureIgnoreHostKey states:

InsecureIgnoreHostKey returns a function that can be used for ClientConfig.HostKeyCallback to accept any host key. It should not be used for production code.

From a security perspective it is highly recommended to use the common methods (i.e. ~/.ssh/known_hosts) to read and verify known hosts or at least to provide a parameter/environment variable to provide a path.
This is (almost) worth a CVE these days since this is quite the same as ignoring certificates when using HTTPS.

@happyc0ding happyc0ding added the kind/bug Something isn't working label Dec 27, 2024
@zhijian-pro zhijian-pro self-assigned this Dec 30, 2024
@zhijian-pro zhijian-pro removed the kind/bug Something isn't working label Jan 2, 2025
@zhijian-pro
Copy link
Contributor

We will add a parameter to support this verification

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants