pdns
pdns copied to clipboard
Lua record function createForward6() throws exception when non-hex characters are in query for non-split full length format
-
[x] This is not a support question, I have read about opensource and will send support questions to the IRC channel, GitHub Discussions or the mailing list.
-
[x] I have read and understood the 'out in the open' support policy
-
Program: Authoritative
-
Issue type: Bug report
Short description
When Lua record AAAA "createForward6()" encounters non-hex characters in non-split full length format queries it creates an exception. This is also happens when more than 8 parts separated by hyphens are encountered.
Environment
- Operating system: Debian Bookworm 12.7
- Software version: 4.9.1-1pdns.bookworm
- Software source: PowerDNS repository
Steps to reproduce
- ENABLE-LUA-RECORDS via domain metadata
- add Lua record: AAAA "createForward6()"
- query for random string at least 32 characters long containing non-hex characters
Expected behaviour
no exception logged maybe NXDOMAIN answer sent instead of SERVFAIL
Actual behaviour
exception logged:
Sep 06 05:15:45 shinjuku pdns_server[1891040]: Exception building answer packet for 4yx5ax8swvnnx9wojgk95tj2u1czw0wz.static6.zaphods.net/AAAA (Exception thrown by a callback function called by Lua.
Sep 06 05:15:45 shinjuku pdns_server[1891040]: stack traceback:
Sep 06 05:15:45 shinjuku pdns_server[1891040]: [C]: at 0x5596a08d9490) sending out servfail
Sep 06 12:33:27 shinjuku pdns_server[3373701]: Exception building answer packet for iyMMTxpB4J1Z5EoekT6PGwEcV5T0UKeC.static6.zaphods.net/AAAA (Exception thrown by a callback function called by Lua.
Sep 06 12:33:27 shinjuku pdns_server[3373701]: stack traceback:
Sep 06 12:33:27 shinjuku pdns_server[3373701]: [C]: at 0x55f4ecef9490) sending out servfail
Sep 06 12:56:44 shinjuku pdns_server[3373701]: Exception building answer packet for 2001-67c-1400-1221-417-8f61-cd66-e42f-abc-abc.static6.zaphods.net/AAAA (Exception thrown by a callback function called by Lua.
Sep 06 12:56:44 shinjuku pdns_server[3373701]: stack traceback:
Sep 06 12:56:44 shinjuku pdns_server[3373701]: [C]: at 0x55f4ecef9490) sending out servfail
SERVFAIL response sent:
➜ ~ dig @shinjuku.zaphods.net aaaa iyMMTxpB4J1Z5EoekT6PGwEcV5T0UKeC.static6.zaphods.net
; <<>> DiG 9.20.1 <<>> @shinjuku.zaphods.net aaaa iyMMTxpB4J1Z5EoekT6PGwEcV5T0UKeC.static6.zaphods.net
; (2 servers found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 23264
;; flags: qr aa rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;iyMMTxpB4J1Z5EoekT6PGwEcV5T0UKeC.static6.zaphods.net. IN AAAA
;; Query time: 35 msec
;; SERVER: 2001:67c:1400:1220::25#53(shinjuku.zaphods.net) (UDP)
;; WHEN: Fri Sep 06 12:59:42 CEST 2024
;; MSG SIZE rcvd: 81