Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lua record function createForward6() throws exception when non-hex characters are in query for non-split full length format #14629

Open
2 tasks done
ZaphodB opened this issue Sep 6, 2024 · 0 comments · May be fixed by #14630
Milestone

Comments

@ZaphodB
Copy link
Contributor

ZaphodB commented Sep 6, 2024

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

  1. ENABLE-LUA-RECORDS via domain metadata
  2. add Lua record: AAAA "createForward6()"
  3. 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

Other information

@Habbie Habbie added this to the auth-5 milestone Sep 6, 2024
Habbie added a commit to Habbie/pdns that referenced this issue Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants