Net::DNS versions up to and including 1.57 use a 16-bit query ID generated by Perl's built-in rand() function to match DNS responses to requests. An attacker who can observe the sequence of query IDs can expose the internal state of the pseudorandom number generator (PRNG) and predict future query IDs. This allows the attacker to inject forged DNS responses to the victim, bypassing the intended matching mechanism. The deduplication cache in version 1.57 does not mitigate this attack.