Fix vizier-pem DNS parser crash due to stack overflow and eventual segfault#2349
Open
ddelnano wants to merge 1 commit intopixie-io:mainfrom
Open
Fix vizier-pem DNS parser crash due to stack overflow and eventual segfault#2349ddelnano wants to merge 1 commit intopixie-io:mainfrom
ddelnano wants to merge 1 commit intopixie-io:mainfrom
Conversation
The previous version of the parser didn't properly use the entire 14 bit compression field. This meant large DNS packets w/ compression ptrs had the chance of pointing to bogus memory. Signed-off-by: Dom Del Nano <ddelnano@gmail.com> (cherry picked from commit c153155)
c153155 to
abd0098
Compare
ddelnano
commented
Apr 7, 2026
Comment on lines
-188
to
+190
| sha256 = "bdf6c7f56f33725c1c32e672a4779576fb639dd2df565115778eb6be48296431", | ||
| strip_prefix = "dnsparser-77398ffc200765db1cea9000d9f550ea99a29f7b", | ||
| urls = ["https://github.com/pixie-io/dnsparser/archive/77398ffc200765db1cea9000d9f550ea99a29f7b.tar.gz"], | ||
| sha256 = "de1c4270ddaf03c2d25ec02afd4b9b25e0748f84155449a2b68127813abad3a4", | ||
| strip_prefix = "dnsparser-362f3988b06b0831683155e110fdac946795c469", | ||
| urls = ["https://github.com/ddelnano/dnsparser/archive/362f3988b06b0831683155e110fdac946795c469.tar.gz"], |
Member
Author
There was a problem hiding this comment.
This will be updated to pixie-io/dnsparser once pixie-io/dnsparser#1 is merged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary: Fix vizier-pem DNS parser crash due to stack overflow and eventual segfault
The DNS parser library stirling uses didn't properly handle the RFC 1035 message compression pointers (section 4.1.4). These message compression pointers consist of the lower 14 bits of a 16 bit field. The DNS parser only read 8 bits of this field, meaning any DNS message that had a message compression pointer with offset > 256 (8 bits) would point to bogus memory.
For the end user I worked with, this manifested as a stack overflow and eventual segfault. See the stack trace below that shows ~20k frames after the first
dnsReadNamecall:Relevant Issues: N/A
Type of change: /kind bugfix
Test Plan: End user verified it worked and unit test passes with new dnsparser changes (pixie-io/dnsparser#1)
Changelog Message: Fixed an issue where certain large DNS query responses could cause a vizier-pem segfault