From d739a920c91b8fbc9ce39e11e84e76d54dc5531e Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 28 Jan 2019 23:35:25 -0700 Subject: [PATCH] User.pm: kindly suggest too large keys are unfriendly There's no compelling reason to allow keys larger than 16384 bits in length. In fact, an RSA key of 15360 bits in length provides an equivalent security strength of 256 bits; perhaps that should be the maximum, but some software does round up and allow 16384 bits so we'll go ahead and allow up to that long. The handshake for very long keys imposes a computational burden on the server so it behooves us to put a maximum in place to avoid any unfortunate DOS attacks with regard to that. Signed-off-by: Kyle J. McKay --- Girocco/User.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Girocco/User.pm b/Girocco/User.pm index a1d9dfe..c2d88fe 100644 --- a/Girocco/User.pm +++ b/Girocco/User.pm @@ -293,6 +293,13 @@ EOT Your ssh key ("$keyval") appears to be of type dsa but only rsa keys are supported - please generate an rsa key (starts with ssh-rsa) and try again EOT + } elsif ($bits > 16384) { + my $keyval = CGI::escapeHTML($key); + $gcgi->err(<err(<