- Version: 6.5.0
- Platform:
- Subsystem:
dns.setServers is memory unsafe and can be used to dump core.
This doesn't seem like a serious security vulnerability (hence my reporting here), but can certainly be used to cause DOS and it might be nice to have a stdlib that is memory safe.
constdns=require('dns');constservers=[];servers[0]='127.0.0.1';servers[2]='0.0.0.0';dns.setServers(servers);// causes the CHECK src/cares_wrap.cc:1241 to dump coreanother variant:
constdns=require('dns');constservers=['127.0.0.1','192.168.1.1'];servers[3]='127.1.0.1';servers[4]='127.1.0.1';servers[5]='127.1.1.1';Object.defineProperty(servers,2,{enumerable: true,get: ()=>{servers.length=3;return'0.0.0.0';}});dns.setServers(servers);// causes the CHECK src/cares_wrap.cc:1241 to dump coreRelated to: #8539, #8537, #7902
dns.setServersis memory unsafe and can be used to dump core.This doesn't seem like a serious security vulnerability (hence my reporting here), but can certainly be used to cause DOS and it might be nice to have a stdlib that is memory safe.
another variant:
Related to: #8539, #8537, #7902