Description
NetBox versions 4.3.5 through 4.5.4 contain a remote code execution vulnerability in the RenderTemplateMixin.get_environment_params() method that allows authenticated users with exporttemplate or configtemplate permissions to execute arbitrary code by specifying malicious Python callables in the environment_params field. Attackers can bypass Jinja2 SandboxedEnvironment protections by setting the finalize parameter to any importable Python callable such as subprocess.getoutput, which is invoked on every rendered expression outside the sandbox's call interception mechanism, achieving remote code execution as the NetBox service user.
Problem types
CWE-183: Permissive List of Allowed Inputs
Product status
4.3.5 (semver)
Credits
Valentin Lobstein (Chocapikk)
References
chocapikk.com/posts/2026/netbox-export-template-rce/
github.com/netbox-community/netbox/issues/22079
github.com/netbox-community/netbox/pull/22078
www.vulncheck.com/...ries/netbox-rce-via-rendertemplatemixin