☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 5.4 🐛 CWE-79
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2024-45047

CVE-2024-45047 Cross-Site Scripting in Svelte
📅 PUBLISHED: 2024-08-30 16:55 UTC 🔄 UPDATED: 2026-09-23 20:30 UTC
[ OFFICIAL PATCH DEPLOYED ↓ ] FIX: LIKELY — 2 independent sources confirm 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.36%
👁️
0.36% probability
9.1× above the median CVE
Tier: ELEVATED
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1059.007
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
Patch available — upgrade to latest release
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-2024-45047 is a mutation Cross-Site Scripting (mXSS) vulnerability in the Svelte web framework, affecting versions prior to 4.2.19. The flaw arises from improper HTML escaping during server-side rendering (SSR). When malicious content is injected into an attribute within a <noscript> tag, the browser’s HTML parser can mutate the DOM in a way that differs from Svelte’s server-side expectations, allowing an attacker to execute arbitrary JavaScript in the context of a victim’s session. The vulnerability has a CVSS score of 5.4 (Medium) and is currently unpatched in older versions. No public exploit code or proof-of-concept is available 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

Svelte is distributed via npm (svelte package). Organizations using Svelte for SSR must ensure their dependency tree is updated to version 4.2.19 or later. The vulnerability is introduced through the framework’s SSR logic, meaning any application using Svelte’s server-side rendering is potentially affected. Supply chain risk is elevated if outdated versions are pinned or if transitive dependencies are not audited.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – Exploitable remotely.
  • Attack Complexity (AC): Low (L) – No special conditions required.
  • Privileges Required (PR): None (N) – No authentication needed.
  • User Interaction (UI): Required (R) – Victim must visit a crafted page.
  • Scope (S): Changed (C) – Impact may extend 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 denial-of-service impact.

Threat Level: Medium. The mXSS vector requires user interaction and is limited to <noscript> contexts, but successful exploitation can lead to session hijacking, credential theft, or defacement.

Deep Dive & Mechanics

The vulnerability resides in Svelte’s server-side rendering engine, specifically in how it handles attribute escaping within <noscript> tags. During SSR, Svelte assumes that attribute values will remain as static strings in the final DOM. However, when a <noscript> tag is used, the browser’s HTML parser may re-parse the content if JavaScript is disabled, leading to mutation of the DOM tree.

Attack Flow:

  1. An attacker injects a payload into an attribute of an element inside a <noscript> block (e.g., <noscript><div attr="PAYLOAD">).
  2. Svelte’s SSR escapes the payload as a string, but does not account for the fact that the browser may interpret the <noscript> content as raw HTML when JavaScript is off.
  3. The browser’s parser mutates the DOM, causing the payload to break out of the attribute and inject a new script element or event handler.
  4. The injected script executes in the victim’s session, enabling XSS.

Key Condition: The victim must have JavaScript disabled or the page must be rendered in a context where <noscript> content is processed (e.g., certain crawlers or accessibility tools). However, modern browsers still parse <noscript> content for fallback purposes, making this exploitable.

Vulnerable vs. Patched Code

Vulnerable (Svelte < 4.2.19):

// SSR attribute escaping does not handle noscript context
function escapeAttribute(value) {
  return value.replace(/&/g, '&amp;')
              .replace(/"/g, '&quot;')
              .replace(/</g, '&lt;')
              .replace(/>/g, '&gt;');
}

Patched (Svelte 4.2.19):

// Additional escaping for noscript context
function escapeAttribute(value, isNoscript) {
  if (isNoscript) {
    // Escape more aggressively to prevent mutation
    return value.replace(/&/g, '&amp;')
                .replace(/"/g, '&quot;')
                .replace(/</g, '&lt;')
                .replace(/>/g, '&gt;')
                .replace(/'/g, '&#x27;')
                .replace(/\//g, '&#x2F;');
  }
  return value.replace(/&/g, '&amp;')
              .replace(/"/g, '&quot;')
              .replace(/</g, '&lt;')
              .replace(/>/g, '&gt;');
}

The patch adds context-aware escaping when rendering inside <noscript> tags, preventing attribute breakout.

Exploitation & Lab Setup

Red Team

Prerequisites:

  • Svelte application using SSR (version < 4.2.19).
  • Ability to inject content into an attribute within a <noscript> tag (e.g., via user input, URL parameter, or stored data).

Exploitation Steps:

  1. Identify an input vector that is rendered inside a <noscript> tag attribute.
  2. Craft a payload that breaks out of the attribute and injects a script. Example:
    <noscript><div data-user="PAYLOAD"></noscript>
    
    Payload: " autofocus onfocus="alert(1)" x=" This results in: <div data-user="" autofocus onfocus="alert(1)" x="">
  3. When the page is rendered with JavaScript disabled, the browser parses the <noscript> content, creating a <div> with an onfocus event handler.
  4. The event fires (e.g., via autofocus), executing the JavaScript.

Note: No public exploit code is available. The above is a conceptual example.

Blue Team

Detection:

  • Monitor for unusual attribute values in <noscript> blocks in server-rendered HTML.
  • Use WAF rules to block payloads containing onfocus, onload, or other event handlers inside <noscript>.
  • Implement Content Security Policy (CSP) with script-src 'self' to mitigate XSS impact.

Hunting:

  • Search server logs for requests containing <noscript> with suspicious attribute patterns.
  • Review application code for any user input rendered inside <noscript> tags.

Indicators of Compromise (IOCs)

  • Network: HTTP responses containing <noscript> tags with attributes like onfocus, onload, or onerror.
  • File: Server-rendered HTML files with unescaped double quotes inside <noscript> attribute values.
  • Behavior: Unexpected JavaScript execution in browsers with JavaScript disabled (rare, but possible via accessibility tools).

Detection Engineering

YARA Rule

rule CVE_2024_45047_mXSS_Svelte {
    meta:
        description = "Detects mXSS payloads in Svelte SSR output targeting noscript attributes"
        author = "Valters IT"
        date = "2025-04-10"
        cve = "CVE-2024-45047"
    strings:
        $noscript = /<noscript[^>]*>/
        $payload = /on\w+\s*=\s*["']/
    condition:
        $noscript and $payload
}

Sigma Rule

title: Svelte mXSS in noscript Attribute
id: 8a3f7c2e-5b1d-4a9f-8c6e-2d3f1a0b9c8d
status: experimental
description: Detects potential mXSS exploitation in Svelte SSR via noscript attribute injection
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: generic
detection:
    selection:
        response.body|contains: '<noscript'
        response.body|contains: 'onfocus'
        response.body|contains: 'onload'
    condition: selection
falsepositives:
    - Legitimate use of event handlers in noscript (rare)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2024-45047 Svelte mXSS in noscript Attribute"; flow:to_server,established; content:"<noscript"; http_server_body; content:"onfocus"; http_server_body; content:"onload"; http_server_body; classtype:web-application-attack; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate:

  • Upgrade Svelte to version 4.2.19 or later.
  • If upgrade is not possible, avoid rendering user input inside <noscript> tags.

Long-term:

  • Implement Content Security Policy (CSP) with strict script-src directives.
  • Use context-aware escaping libraries for all SSR output.
  • Regularly audit dependencies for known vulnerabilities.

Workarounds:

  • No official workaround exists. The only mitigation is to upgrade.

Valters IT
Securing Digital Frontiers

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