Skip to content

Commit 85485ea

Browse files
authored
OpenVPN: heuristic: add a simple check to avoid false positives (#2560)
We should have too big packets during the initial handshake
1 parent 9d07cf2 commit 85485ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib/protocols/openvpn.c

+4
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,10 @@ static int search_heur_opcode(struct ndpi_detection_module_struct* ndpi_struct,
417417
iter, offset, pdu_len);
418418
if(pdu_len < 14)
419419
return 1; /* Exclude */
420+
if(pdu_len > 4 * 1500) { /* 4 full size packets: simple threshold to avoid false positives */
421+
NDPI_LOG_DBG2(ndpi_struct, "Heur-opcode: pdu_len %d too big. Exclude\n", pdu_len);
422+
return 1; /* Exclude */
423+
}
420424
rc = search_heur_opcode_common(ndpi_struct, flow, *(ovpn_payload + offset + 2));
421425
NDPI_LOG_DBG2(ndpi_struct, "Heur-opcode: TCP, rc %d\n", rc);
422426
if(rc > 0) /* Exclude || Found --> stop */

0 commit comments

Comments
 (0)