unknown-payload: Use a new private payload type and make original type available

This fixes a DoS and potential remote code execution vulnerability that was
caused because the original payload type that was returned previously was
used to cast such payload objects to payloads of the indicated type (e.g.
when logging notify payloads with a payload type for the wrong IKE version).

Fixes CVE-2015-3991.
This commit is contained in:
Tobias Brunner
2015-06-01 09:42:11 +02:00
committed by Andreas Steffen
parent 62e0abe759
commit 1507647434
6 changed files with 35 additions and 10 deletions
+1 -1
View File
@@ -2513,7 +2513,7 @@ static status_t decrypt_payloads(private_message_t *this, keymat_t *keymat)
was_encrypted = "encrypted fragment payload";
}
if (payload_is_known(type, this->major_version) && !was_encrypted &&
if (type != PL_UNKNOWN && !was_encrypted &&
!is_connectivity_check(this, payload) &&
this->exchange_type != AGGRESSIVE)
{