]> git.ipfire.org Git - thirdparty/pdns.git/commit
Damage control in Lua createForward() and createForward6(). 15228/head
authorMiod Vallat <miod.vallat@powerdns.com>
Wed, 26 Feb 2025 13:31:50 +0000 (14:31 +0100)
committerMiod Vallat <miod.vallat@powerdns.com>
Thu, 27 Feb 2025 15:22:47 +0000 (16:22 +0100)
commit550150dca3819e9881cc82e55f88b6b5d11f350b
treed48056293cb14af95d6ca363d45a6034e63efe0e
parent10e42ba4325c7422f4445a95b64be3cd317cf7ee
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.

(cherry picked from commit 97800540ef65f19cd9cb6e2624682c0840a6eafc)
pdns/lua-record.cc
regression-tests.auth-py/test_LuaRecords.py