https://github.com/openssh/openssh-portable/commit/a546b17bbaeb12beac4c9aeed56f74a42b18a93a --- a/sshkey-xmss.c +++ b/sshkey-xmss.c @@ -977,7 +977,8 @@ sshkey_xmss_decrypt_state(const struct sshkey *k, struct sshbuf *encoded, goto out; } /* check that an appropriate amount of auth data is present */ - if (sshbuf_len(encoded) < encrypted_len + authlen) { + if (sshbuf_len(encoded) < authlen || + sshbuf_len(encoded) - authlen < encrypted_len) { r = SSH_ERR_INVALID_FORMAT; goto out; }