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

 
 

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

Submitter:  None
Submitted:  Mon 02 May 2011 11:51:59 AM UTC
   
 
Category:  input Severity:  High
Priority:  5 - Normal Item Group:  Crash/Error
Status:  None Privacy:  Public
Assigned to:  None Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 03 May 2011 01:40:47 PM UTC, comment #3: 
Stephane Bortzmeyer <bortzmeyer>
Group 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>
Group 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>
Group 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 Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    No changes have been made to this item

    Back to the top

    Powered by Savane 3.13-758e.
    Corresponding source code