Skip to content

Fix some bugs in the way DNS compression is handled in dns.c#10

Open
pictyeye wants to merge 2 commits intojbangert:masterfrom
pictyeye:master
Open

Fix some bugs in the way DNS compression is handled in dns.c#10
pictyeye wants to merge 2 commits intojbangert:masterfrom
pictyeye:master

Conversation

@pictyeye
Copy link

As described in issue #7 DNS decompression does not always work as expected.

This can lead to hangs (that we found with AFL). Some of them were due to a problem with operator precedence, but other were due to the fact the code carelessly follows compression pointers.

With the attached patches, we did not find hangs with AFL anymore.

Yet, the code is still not fully compliant, since it is possible to follow a pointer that does not correspond to a previously encountered label.

pictyeye added 2 commits July 27, 2020 14:04
The bug was first reported by @nigeltao on GitHub.

We hit the same bug while testing nail in our platform
(https://gitlab.com/pictyeye/langsec-pf).
The fix was proposed by Sebastien Naud, intern at Télécom SudParis.
DNS pointers used in compression should always point backwards.
Actually, they should really point at labels, but patching dns.c to do
that would require an internal state that is way more intrusive.

The fix was proposed by Sébastien Naud.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant