/

CVE-2026-54752

Severity:

CRITICAL RISK

(9.6)

Pickle Deserialization (CWE-502) in NetBox DTL Tests

CVE-2026-54752

Deferred

Vulnerability type

Category:

Unsafe Deserialization

CWE:

CWE-502, CWE-829

Impact:

Arbitrary Code Execution

Severity:

CRITICAL RISK

(9.6)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A critical unsafe deserialization vulnerability in the NetBox Device Type Library test harness allows pull-request-controlled pickle files to execute attacker-controlled code when loaded by pytest.

An unauthenticated contributor may be able to trigger code execution in a GitHub Actions runner or in a maintainer environment that runs the affected validation tests, potentially compromising reachable resources.

Affected context

The vulnerability occurs in the NetBox Device Type Library validation workflow when tests deserialize tracked pickle cache files using pickle.load. The risk is present where pull requests can influence the relevant test configuration or pickle files and automated or maintainer-controlled test execution processes those files without treating them as untrusted input.

Exploit preconditions

  • Attack surface: Pull-request-controlled repository files processed by the validation test harness
  • Required access: Ability to submit or modify contribution content; authentication to the application is not necessarily required
  • Trigger point: Pytest execution of the definitions validation tests
  • Relevant files: The test configuration and tracked known-module or known-rack pickle cache files
  • Why exploitation is possible: Python pickle deserialization can invoke attacker-controlled object reduction behavior during loading, before the resulting data is safely constrained

Why this happens

The underlying bug is the deserialization of untrusted or contributor-controlled data with Python's pickle.load. Pickle is a code-capable serialization format rather than a data-only interchange format, so loading a crafted object can invoke reduction behavior defined by that object.

This maps primarily to CWE-502: Deserialization of Untrusted Data. The contributor-controlled test workflow also relates to CWE-829: Inclusion of Functionality from Untrusted Control Sphere, because repository content from an external contribution is incorporated into a privileged or trusted execution environment.

Potential impact

  • Arbitrary code execution in a GitHub Actions runner
  • Compromise of credentials, tokens, or artifacts accessible to the runner
  • Modification of repository contents or build outputs
  • Execution of code in a maintainer-controlled test environment
  • Loss of confidentiality, integrity, or availability for reachable resources
  • Supply-chain compromise through altered validation or release-related artifacts

General mitigation guidance

Mitigation generally focuses on eliminating executable deserialization from contributor-controlled test paths and reducing trust in repository inputs.

Common defensive patterns include:

  • Replacing pickle with a data-only format such as JSON or another schema-constrained representation
  • Avoiding deserialization of files that can be changed through pull requests
  • Applying strict schemas and type validation before data is used by tests
  • Separating untrusted contribution testing from sensitive credentials, deployment permissions, and release infrastructure
  • Running automation with least privilege, isolated environments, restricted network access, and ephemeral credentials
  • Treating test configuration switches and cached artifacts as untrusted inputs
  • Requiring trusted review or controlled regeneration for serialized test fixtures

How teams detect issues like this

Organizations can detect similar issues through:

  • Static analysis rules for pickle.load, pickle.loads, and related deserialization APIs
  • Code review checks for executable serialization formats in tests, CI workflows, caches, and fixtures
  • Repository policies that flag contributor-controlled files consumed by privileged automation
  • Dependency and workflow reviews that identify broad runner permissions or exposed secrets
  • CI controls that prevent untrusted pull requests from accessing sensitive credentials or modifying trusted artifacts
  • Automated security review tools that report unsafe deserialization and untrusted control-flow boundaries

Sources

SourceLink
github.comgithub.com/netbox-community/devicetype-library/commit/1c6f7e2b93589b965318c6e67ac3504831f0e71e
github.comgithub.com/netbox-community/devicetype-library/pull/4238
github.comgithub.com/netbox-community/devicetype-library/security/advisories/GHSA-492p-5wp7-2w7c

Frequently asked

questions

It can be exploitable through a submitted or modified pull request when the validation workflow processes attacker-controlled pickle files. The practical scope depends on repository contribution settings and CI permissions.

Not necessarily. An unauthenticated contributor may be able to submit pull-request content if the repository accepts such contributions, although workflow approval and execution policies can limit exposure.

The safest pattern is to avoid loading pickle data from untrusted or contributor-controlled sources and use a non-executable, schema-validated data format instead.

Treat repository contributions and test fixtures as untrusted, apply least privilege to automation, restrict secrets and network access, and continuously scan code and workflows for unsafe deserialization APIs.

Find out what's already
exploitable in your codebase.