CVE-2026-54752: NetBox Device Type Library: Insecure Pickle Deserialization in Test Suite Allows Remote Code Execution via Malicious Pull Request
NetBox Device Type Library is a collection of community-sourced device type definitions for import into NetBox. The validation test harness can deserialize pull-request-controlled tracked pickle cache files through pickle.load in the readpickledata function in tests/pickleoperations.py. An unauthenticated contributor can change USELOCALKNOWNSLUGS in tests/testconfiguration.py and supply a crafted tests/known-modules.pickle or tests/known-racks.pickle file that tests/definitionstest.py loads when pytest runs. Deserialization invokes attacker-controlled object reduction behavior, allowing arbitrary code execution in the GitHub Actions runner or in a maintainer process that runs the tests, with the confidentiality, integrity, and availability of reachable resources at risk. This vulnerability is fixed with commit 1c6f7e2b93589b965318c6e67ac3504831f0e71e.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
NetBox (Test Suite)to a version that resolves this vulnerability.Fixed in 1c6f7e2b93589b965318c6e67ac3504831f0e71e - Configuration
Modify tests/pickle_operations.py so that read_pickle_data does not call pickle.load on pull-request-controlled tracked pickle cache files (e.g., tests/known-modules.pickle / tests/known-racks.pickle).
NetBox test suite (tests/pickle_operations.py) pickle.load in read_pickle_data = Do not deserialize attacker-controlled tracked pickle cache files
Event History
Frequently Asked Questions
Which systems are exposed to code execution?
GitHub Actions runners that execute the affected pytest suite on a malicious pull request are exposed. Maintainer systems are also exposed if they run the tests against the attacker-controlled changes.
What does an attacker need to do to exploit this?
An unauthenticated contributor needs to submit a pull request that changes USE_LOCAL_KNOWN_SLUGS in tests/test_configuration.py and includes a crafted tests/known-modules.pickle or tests/known-racks.pickle file. Exploitation occurs when pytest runs tests/definitions_test.py and it deserializes the supplied pickle data.
How can I determine whether a pull request is attempting this attack?
Review pull-request changes for modifications to USE_LOCAL_KNOWN_SLUGS in tests/test_configuration.py and for added or changed tests/known-modules.pickle or tests/known-racks.pickle files. These changes can cause the test suite to load pull-request-controlled serialized data.
What fix is available?
The issue is fixed by commit 1c6f7e2b93589b965318c6e67ac3504831f0e71e.