Skip to content

Harden JSON deserialization against arbitrary code execution - #818

Open
kbensafta wants to merge 2 commits into
e2nIEE:developfrom
kbensafta:fix/deserialization
Open

Harden JSON deserialization against arbitrary code execution#818
kbensafta wants to merge 2 commits into
e2nIEE:developfrom
kbensafta:fix/deserialization

Conversation

@kbensafta

@kbensafta kbensafta commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Aligns pandapipes' JSON loading mechanism with the recent security patch in pandapower, Commit f105e70.
The rest() method in the deserialization registry now uses pandapower's _is_safe_to_deserialize helper to prevent the loading of arbitrary, non-pandapipes-related objects. This closes a remote code execution vulnerability.
Additionally, this commit exposes the skip_checks parameter in from_json and from_json_string to allow trusted files to bypass these new security checks, maintaining API consistency with pandapower.

@kbensafta kbensafta self-assigned this Jul 15, 2026
@kbensafta
kbensafta marked this pull request as ready for review July 15, 2026 19:28
@SimonRubenDrauz

Copy link
Copy Markdown
Collaborator
  • Please fix the tutorial tests
  • check if it works with the most recent pandapower-version. Currently you are using pandapower 3.3.3.

@kbensafta

kbensafta commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@SimonRubenDrauz I bumped pandapower from 3.3.3 to 3.5.4 which made the tests pass. But I just noticed that there is PR #817 that addresses the same problem, so I don't know which one we should keep.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants