PaloAltoNetworks / pan-os-python

The PAN-OS SDK for Python is a package to help interact with Palo Alto Networks devices (including physical and virtualized Next-generation Firewalls and Panorama). The pan-os-python SDK is object oriented and mimics the traditional interaction with the device via the GUI or CLI/API.
https://pan-os-python.readthedocs.io
ISC License
339 stars 166 forks source link

Block adding an object to itself (by using .add) as it causes infinite recursive loop on PanObject.vsys() #512

Open AnthoBalitrand opened 1 year ago

AnthoBalitrand commented 1 year ago

Describe the bug

It is actually possible to add an object to itself (using the PanObject.add() method), which can causes infinite depth recursivity issue when using delete() or delete_similar() on it.

Possible solution

Avoid the possibility of adding an object to itself through the PanObject.add() method.