PaloAltoNetworks / PaloAltoNetworks/pan-os-python

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

Open
#512 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
400
Forks
199
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating PanObject.add() and tracing how a self-added object reaches vsys(), delete(), and delete_similar(). Done means PanObject.add() prevents an object from being added to itself and those operations no longer enter infinite recursion; run the existing test suite to verify the behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.