You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ewald Dieterich <ew...@mailbox.org> on 2016/11/04 15:05:15 UTC
Multiple SessionCryptoPassphrase keys lead to segfault when
decrypting session
mod_session_crypto supports multiple SessionCryptoPassphrase keys. The
idea is that when decrypting a session you try one key after the other
until the decryption succeeds, assuming that the successful key is the
key that was used when the session was encrypted.
But this assumption obviously doesn't hold. I have a case where a wrong
(old) key successfully decrypts a session that was encrypted with a
different (new) key. This leads to a segfault in mod_session.c,
session_identity_decode() because the tokenization assumes valid data
when in this case it's just binary rubbish (one of the apr_strtok()
calls segfaults).
I "fixed" this by adding an additional sanity check to
mod_session_crypto.c, decrypt_string(), see the attached patch. Of
course this fix only works for cases where the seemingly successfully
decrypted binary rubbish contains 0x00 somewhere in the decrypted data.
Any ideas for a proper fix?
Sorry that I can't provide you with the actual session data since it
contains sensitive information (username and password).
Re: Multiple SessionCryptoPassphrase keys lead to segfault when
decrypting session
Posted by Ewald Dieterich <ew...@mailbox.org>.
On 04.11.2016 16:05, Ewald Dieterich wrote:
> This leads to a segfault in mod_session.c,
> session_identity_decode() because the tokenization assumes valid data
> when in this case it's just binary rubbish (one of the apr_strtok()
> calls segfaults).
BTW, the segfault in mod_session.c, session_identity_decode() happens
when the session data (z->encoded) starts with this string: =&