CVE-2026-54916: NetBox Device Type Library: Module Shadowing Bypass of prior pickle fix - RCE via missing `tests/__init__.py` + SSRF via unfixed `NETBOX_DT_LIBRARY_URL` → Cloud Metadata credential theft

Published Sep 17, 2026
·
Updated

NetBox Device Type Library is a collection of community-sourced device type definitions for import into NetBox. The absence of tests/init.py and the lack of --import-mode=importlib cause pytest prepend import mode to place the tests directory at the front of sys.path during collection. An unauthenticated contributor can add a module such as tests/git.py that shadows GitPython when tests/definitionstest.py executes from git import Git, Repo, or add tests/conftest.py for automatic collection-time execution. Python imports and runs the pull-request module before any test function, allowing arbitrary code execution on the GitHub Actions runner, test-result tampering, and access to tokens or network resources exposed to the workflow. This module-shadowing path is independent of the earlier pickle deserialization flaw and the separately tracked NETBOXDTLIBRARYURL issue. This vulnerability is fixed by commit b0d9a3dadd0a0a9d3c93b0b2777559fd4bad1037.

Affected Software

2 affected components
NetBox Device Type Library
NETBOX_DT_LIBRARY_URL

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade NetBox Device Type Library / NetBox tests module-shadowing fix to a version that resolves this vulnerability.

    Patch b0d9a3dadd0a0a9d3c93b0b2777559fd4bad1037
  2. Configuration

    Run pytest with --import-mode=importlib so pytest does not prepend the tests directory to sys.path during collection (prevents module shadowing).

    pytest import-mode = importlib
  3. Configuration

    Ensure tests/__init__.py exists so the tests directory is treated as a package and cannot be used for import-time module shadowing during pytest collection.

    tests package tests/__init__.py presence = present
  4. Compensating control

    Mitigate SSRF/credential theft risk by addressing the unfixed NETBOX_DT_LIBRARY_URL setting (the material states it leads to Cloud Metadata credential theft).

Event History

Sep 17, 2026
CVE Published
via MITRE·08:01 PM
Data Sourced
via MITRE·08:01 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

GitHub Actions workflows that run the affected pytest configuration on untrusted pull requests are exposed. An unauthenticated contributor can supply a pull-request module that is imported during test collection and executes on the runner.

2

What does an attacker need to exploit it?

The attacker needs the ability to contribute a pull request containing a shadowing module such as tests/git.py, or a tests/conftest.py file. No credentials are required, and execution occurs before test functions run.

3

What could an attacker do after successful exploitation?

They can execute arbitrary code on the GitHub Actions runner, tamper with test results, and access workflow-exposed tokens or reachable network resources. The described impact includes theft of cloud metadata credentials where the runner can access metadata services.

4

How can this be remediated?

Apply the fix in commit b0d9a3dadd0a0a9d3c93b0b2777559fd4bad1037. The issue is associated with pytest prepend import mode and the missing tests/__init__.py.

5

Is this the same issue as the prior pickle flaw or NETBOX_DT_LIBRARY_URL issue?

No. The module-shadowing execution path is independent of the earlier pickle deserialization flaw and of the separately tracked NETBOX_DT_LIBRARY_URL issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203