Long TXT records wrap length value, cause havoc in packets #188

Closed
Habbie opened this Issue Apr 26, 2013 · 4 comments

Projects

None yet

1 participant

@Habbie
Member
Habbie commented Apr 26, 2013

It seems that a TXT record that's longer than 255 bytes will wrap the length counter on the TXT record data, causing unexpected havoc when attempting to serve the TXT record out. Since the counter in question is only 1 byte, obviously lengths > 255 bytes aren't possible, but there should be some kind of check/limit to prevent this sort of error from generating busted packets. I'll see what I can do about banging out a patch myself, but wanted to get something on record for this issue.

@Habbie Habbie was assigned Apr 26, 2013
@Habbie Habbie closed this Apr 26, 2013
@Habbie
Member
Habbie commented Apr 26, 2013

Attachment 'Splits large TXT records into max 255-byte chunks, like BIND and friends.' (04_split_content.diff) https://gist.github.com/5466634

@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
It appears that breaking the body up into multiple sections might be a workable solution; I'll look into that...

@Habbie
Member
Habbie commented Apr 26, 2013

Author: anon
I've attached a patch to resolve this issue. It's fairly short, but solves the problem by splitting long TXT data (like for SPF records, DomainKeys, etc.) into 255-byte RDATA chunks, as recommended in the RFC, and used in implementations like BIND.

Derrik Pates
dpates@voxel.net

@Habbie
Member
Habbie commented Apr 26, 2013

Author: ahu
Fixed in commit 1340, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment