]> git.ipfire.org Git - thirdparty/pdns.git/commit
Damage control in Lua createForward() and createForward6(). 15222/head
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 26 Feb 2025 13:31:50 +0000 (14:31 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Wed, 26 Feb 2025 15:33:05 +0000 (16:33 +0100)
commit97800540ef65f19cd9cb6e2624682c0840a6eafc
tree6c43e918bcac085b70abd608b6cab1630b51859e
parent07688dc95cbd2374400b66894c9e7b973bafce61
Damage control in Lua createForward() and createForward6().

- make sure all computed results are passed to a ComboAddress
  constructor, which will reject ill-formed data. This wasn't the case
  in createForward, when interpreting part of the requested name as an
  ipv4 address encoded in hexadecimal (e.g. 7f000001), but the actual
  name wasn't.
  This would otherwise end up with a SERVFAIL answer and a Lua stack
  traceback containing messages such as:
    Unable to convert presentation address '4294967292.xx.yy.zz'
  for a name ending with "-4" and six hex digits.

- wrap these functions into a try/catch block in order to cope with
  possible exceptions raised by ComboAddress.
  This wasn't the case in createForward6 when the requested name
  contains at least 8 dots - this doesn't imply each component is a
  valid ipv6 chunk.
pdns/lua-record.cc
regression-tests.auth-py/test_LuaRecords.py