Project

General

Profile

Actions

Security #8143

open

Misalligned access to ip header data.

Added by Sergey Zhidkih about 13 hours ago. Updated about 8 hours ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Affected Versions:
Label:
CVE:
Git IDs:
Severity:
HIGH
Disclosure Date:

Description

During fuzz session with enabled undefined sanitizer, fuzz_sigpcap discovered misaligned access to ip header data.

The core reason is that access to ip header data is determined by protocol and not by memory access rules.
For example most of findings include ethernet traffi which has this line of code:
DecodeNetworkLayer(tv, dtv, SCNtohs(ethh->eth_type), p, pkt + ETHERNET_HEADER_LEN, len - ETHERNET_HEADER_LEN);
Where ETHERNET_HEADER_LEN is 14. Since pkt is already aligned and 14 doesn't satisfy fundamental alignment the result is misaligned address.

The other discovered example is DecodePPP which may add +2 to already aligned pkt.

The problem is that on some platform misaligned access may lead to DoS attack and on those where it doesn't it reduces performance.

If I'm right CVSS v3 vector is (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H)
And base score is 5.9.

The most simple solution is to use memcpy which doesn't have these problems, but the right one is to rework whole access to that data, so it's not determined by protocol pointer offsets.


Files


Related issues 1 (1 open0 closed)

Is duplicate of Suricata - Bug #4736: ubsan: misaligned memory loadsFeedbackOISF DevActions
Actions

Also available in: Atom PDF