NLnetLabs / ldns

LDNS is a DNS library that facilitates DNS tool programming
https://nlnetlabs.nl/ldns
BSD 3-Clause "New" or "Revised" License
292 stars 98 forks source link

Performance vulnerability in dname compression #173

Open vzuevsky opened 2 years ago

vzuevsky commented 2 years ago

We saw some automated NSEC walks were degrading performance of our HW fleet. Based on that, I had designed an exploit that exacerbated the impact. Both scenaria employ query packets with the maximal number of labels:

Screenshot 2022-04-18 at 17 59 34

I profiled software performance under degradation and observed the culprit, that happens be LDNS wire compression algorithm as per this flame chart:

flame

I have now redesigned that algorithm and would like to contribute with a patch. I have also added a doc file explaining the proposed fix.