Multiple flaws (7 CVEs) has been found in the dnsmasq package. Dnsmasq has two sets of vulnerabilities, one set of memory corruption issues handling DNSSEC and a second set of issues validating DNS responses. These vulnerabilities could allow an attacker to corrupt memory which can lead to denial of service, information exposure and potentially remote code execution on the target device. The DNS response validation vulnerabilities allow an attacker to use unsolicited DNS responses to poison the DNS cache resulting in redirection of users to malicious sites.
These vulnerabilities are also referred to as DNSpooq and there is full security advisory available as well.
1. Configuration based mitigation via LuCI web interface
-
Max. concurrent queries
isdnsforwardmax
, so set it to recommended value of 50 -
Size of DNS query cache
iscachesize
, so disable the caching by setting it to value of 0 -
DNSSEC
isdnssec
, so you need to disable it if enabled and available
2. Configuration based mitigation via commandline
-
Mitigation for DNS cache poisoning is disabling of caching:
uci set dhcp.@dnsmasq[0].cachesize='0'
-
Mitigation for DNSSEC vulnerability is disabling of DNSSEC feature:
uci set dhcp.@dnsmasq[0].dnssec='0'
-
It's recommended to reduce the maximum of queries allowed to be forwarded (default is 150):
uci set dhcp.@dnsmasq[0].dnsforwardmax='50'
-
Then you should commit changes and restart dnsmasq:
uci commit dhcp && /etc/init.d/dnsmasq restart
3. Package upgrade to fixed dnsmasq version
-
You need to update the affected dnsmasq package variant you're using with the
command below.opkg update; opkg upgrade $(opkg list-installed dnsmasq* | cut -d' ' -f1)
-
Then verify, that you're running fixed version.
opkg list-installed dnsmasq*
The above command should output following:
-
dnsmasq - 2.80-16.2
for stable 19.07 release -
dnsmasq - 2.83-1
for master/snapshot