bugZoneCheck - Bugs: bug #33199, Unhandled Dnsruby exception when...

 
 

bug #33199: Unhandled Dnsruby exception when parsing a badly truncated UDP packet inside cachemanager init method

Submitted by:  None
Submitted on:  Mon 02 May 2011 11:51:59 AM UTC  
 
Category: inputSeverity: High
Priority: 5 - NormalItem Group: Crash/Error
Status: NonePrivacy: Public
Assigned to: NoneOpen/Closed: Open

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 03 May 2011 01:40:47 PM UTC, comment #3:

And the packet trace at:

http://www.pcapr.net/view/bortzmeyer+pcapr/2011/4/2/6/dns-truncation-middle-record.pcap.html

Stephane Bortzmeyer <bortzmeyer>
Project Administrator
Tue 03 May 2011 01:28:19 PM UTC, comment #2:

Example of a name server which truncates in the middle of a RR:

% dig @67.212.92.253 ANY olindo.fr
;; Warning: Message parser reports malformed message packet.
;; Truncated, retrying in TCP mode.

% zonecheck --ns "ns-canada.topdns.com;ns-uk.topdns.com;ns-usa.topdns.com" oli ndo.fr
ERROR: IPv4 address must be 4 bytes

Stephane Bortzmeyer <bortzmeyer>
Project Administrator
Tue 03 May 2011 09:07:06 AM UTC, comment #1:

I was surprised to see that the RFC 1035 and RFC 2181 do not seem to mandate that truncation keep Resource Records intact. So, it seems legal (but a very bad idea) to truncate anywhere inside a RR.

In the spirit of robustness, Zonecheck should handle this properly.

Stephane Bortzmeyer <bortzmeyer>
Project Administrator
Mon 02 May 2011 11:51:59 AM UTC, original submission:

When parsing an UDP reply badly truncated such as in the middle of an IPv4 address, Dnsruby throws an error : "ERREUR: IPv4 address must be 4 bytes"

This is not correctly catched by ZoneCheck in the init function of cachemanager.rb because the exception is of type ArgumentError while the init function try only the Dnsruby classes. This prematurely ends the ZoneCheck running flow and messes the output.

The following change makes at least ZoneCheck catch the error:
--- cachemanager.rb.orig 2010-06-17 11:46:17.000000000 +0200
+++ cachemanager.rb 2011-04-27 15:29:16.000000000 +0200
@@ -284,6 +284,8 @@
end
}
@edns = "auto"
+ rescue Exception => e
+ @edns = "autofailed"
rescue Dnsruby::ResolvError
@edns = "autofailed"
rescue Dnsruby::ResolvTimeout

Other better solutions:
- improve the error message
- retry over TCP or fail silently because in that specific case we are just trying to discover the EDNS status of remove server

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bortzmeyer (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    No Changes Have Been Made to This Item

    Back to the top


    Powered by Savane 3.1-cleanup1