che icon indicating copy to clipboard operation
che copied to clipboard

Creating an SSH key/pair for host with invalid characters breaks Che for that user

Open andy316x opened this issue 7 years ago • 3 comments

Platform Openshift v3.11 Che 7.3.0-SNAPSHOT

Steps to reproduce Open a workspace Run the command “SSH: Generate key pair for particular host” Enter a host with an invalid character - for example a space a forward slash Close the workspace and try and reopen it Openshift throws an error saying that the secret being generated is invalid

This is a real issue as the user can no longer open any workspace, meaning they can’t even rectify the problem themselves, rendering Che completely unusable for the affected user, with no means to recover.

I was able to resolve the issue for the affected user by removing the invalid key pair from the Postgres DB.

I think what needs to happen is for the host to be validated by the generate key pair command before allowing it to be created - this validation process should at least only permit acceptable values in an Openshift secret name. Or maybe the host value that is used to create the secret name needs to be sanitised.

andy316x avatar Oct 17 '19 06:10 andy316x

I am not assigning "blocker" because I don't expect many users to encounter it, but once it happens, it sounds really bad.

tsmaeder avatar Oct 18 '19 14:10 tsmaeder

we have PR for this need to test it again https://github.com/eclipse/che/pull/14243

vparfonov avatar Oct 18 '19 14:10 vparfonov

Since new SSH keys name validation has been applied: https://github.com/eclipse/che-theia/pull/444 it could be reproduced only by creating a key via API.

vinokurig avatar Nov 05 '19 09:11 vinokurig