In Zonemaster::Engine::Recursor, glue A/AAAA records from responses are accepted into the internal glue map without validating bailiwick first (lib/Zonemaster/Engine/Recursor.pm, around lines 367-369 and 407-413). Because those addresses are later used for follow-up nameserver queries, this looks like a potential cache/glue poisoning path if an upstream server returns crafted additional records. A safer approach would be to only trust glue for NS names that are actually in the delegation NS RRset and in-bailiwick for that delegation.
In
Zonemaster::Engine::Recursor, glue A/AAAA records from responses are accepted into the internal glue map without validating bailiwick first (lib/Zonemaster/Engine/Recursor.pm, around lines 367-369 and 407-413). Because those addresses are later used for follow-up nameserver queries, this looks like a potential cache/glue poisoning path if an upstream server returns crafted additional records. A safer approach would be to only trust glue for NS names that are actually in the delegation NS RRset and in-bailiwick for that delegation.