Skip to content

Commit

Permalink
server/user-create: Disallow single and double quotes in SSH key
Browse files Browse the repository at this point in the history
  • Loading branch information
leonklingele committed May 18, 2018
1 parent 67029aa commit 2d3ab5d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/git-shell-commands/user-create
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ if [ -z "$PUBLIC_KEY" ]; then
exit 1
fi

if (echo "$PUBLIC_KEY" | grep -xPq '^.*(\047|\042).*$'); then
echo 'Disallowed characters in public key. Disallowed: '"'"', "'
exit 1
fi

# TODO(leon): Do we want to validate ssh-key type (e.g. rsa / ed25519 / ..)?
case "$PUBLIC_KEY" in
'ssh-'*)
Expand Down

0 comments on commit 2d3ab5d

Please sign in to comment.