Handle multiple identical near simultaneous DNS queries better. 53/252553/1 accepted/tizen/6.0/unified/20230220.060935 submit/tizen_6.0/20230126.093147 submit/tizen_6.0/20230126.094048 submit/tizen_6.0/20230220.025051
authorSeonah Moon <seonah1.moon@samsung.com>
Thu, 28 Jan 2021 02:07:50 +0000 (11:07 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Fri, 29 Jan 2021 07:46:13 +0000 (16:46 +0900)
commitc142c491503f3be06012c038d065945228ae4456
tree72e195203f93f8ca01fe4e7e89ad313d5574a21b
parent493e826e42788463feafd38d032e2ba10be8270a
Handle multiple identical near simultaneous DNS queries better.

Previously, such queries would all be forwarded
independently. This is, in theory, inefficent but in practise
not a problem, _except_ that is means that an answer for any
of the forwarded queries will be accepted and cached.
An attacker can send a query multiple times, and for each repeat,
another {port, ID} becomes capable of accepting the answer he is
sending in the blind, to random IDs and ports. The chance of a
succesful attack is therefore multiplied by the number of repeats
of the query. The new behaviour detects repeated queries and
merely stores the clients sending repeats so that when the
first query completes, the answer can be sent to all the
clients who asked. Refer: CERT VU#434904.

Backported for CVE-2020-25686

Change-Id: I2b4dfd8ff28b72ad67da4eacf2a8baa98d7eb5d9
CHANGELOG
src/dnsmasq.h
src/forward.c