The vulnerability is a Time-of-Check Time-of-Use (TOCTOU) flaw resulting from the default plugin execution order in CoreDNS. The security advisory and the associated patch confirm that the acl plugin was being executed before the rewrite plugin. This allowed an attacker to craft a DNS query for a domain that is permitted by the ACLs. After the acl plugin's ServeDNS method approved the query, the rewrite plugin's ServeDNS method would then modify the query to point to a restricted internal service, bypassing the intended security policy.
The patch, found in commit e4b9a976441491881377947a200f414c7961e936, addresses this by modifying the plugin.cfg file to reorder the plugins, placing rewrite before acl. This ensures that any name rewriting occurs before the access control check is performed, so the ACL is evaluated against the final, potentially sensitive, domain name.
Therefore, the functions ACL.ServeDNS and Rewrite.ServeDNS are the key runtime indicators of this vulnerability. During an exploit scenario on a vulnerable version, a profiler would show ACL.ServeDNS executing and allowing a request, followed by Rewrite.ServeDNS modifying it to access a restricted resource.