mfontanini / libtins

High-level, multiplatform C++ network packet sniffing and crafting library.
http://libtins.github.io/
BSD 2-Clause "Simplified" License
1.91k stars 377 forks source link

DNS decompression loops #443

Closed gaya-cohen closed 3 years ago

gaya-cohen commented 3 years ago

Parsing malformed DNS packets places the library in a while-true state. Attached is a capture file.

loop_each_other_responses.cap.gz image

Notice the function DNS::compose_name in dns.cpp only contains a check for the offset not being too low or high, but not a check for whether the offset loops.

image

444

mfontanini commented 3 years ago

Closing as #444 fixed it. Thanks for raising the issue and PR!