You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is possible to crash a DNS server created with .createServer by sending it a bad packet. An exception is thrown by the DNS message parser which cannot be caught using the .createServer API.
The crash can be reproduced by running the following server code:
var dnsd = require('dnsd');
dnsd.createServer(function(req, res) {
res.end('1.2.3.4');
}).listen(5300);
Once the server is started, send it a non-DNS packet:
netcat -u localhost 5300 <<< test
The server crashes with the following message:
buffer.js:582
throw new RangeError('Trying to access beyond buffer length');
^
RangeError: Trying to access beyond buffer length
at checkOffset (buffer.js:582:11)
at Buffer.readUInt16BE (buffer.js:602:5)
at record_count (/home/tim/test/node_modules/dnsd/parse.js:76:16)
at Object.sections (/home/tim/test/node_modules/dnsd/parse.js:144:30)
at Request.DNSMessage.parse (/home/tim/test/node_modules/dnsd/message.js:99:30)
at Request.DNSMessage (/home/tim/test/node_modules/dnsd/message.js:55:10)
at new Request (/home/tim/test/node_modules/dnsd/server.js:177:11)
at Server.on_udp (/home/tim/test/node_modules/dnsd/server.js:167:13)
at Socket.<anonymous> (/home/tim/test/node_modules/dnsd/server.js:45:54)
at Socket.emit (events.js:98:17)
The text was updated successfully, but these errors were encountered:
It is possible to crash a DNS server created with
.createServer
by sending it a bad packet. An exception is thrown by the DNS message parser which cannot be caught using the.createServer
API.The crash can be reproduced by running the following server code:
Once the server is started, send it a non-DNS packet:
The server crashes with the following message:
The text was updated successfully, but these errors were encountered: