Skip to main content
Vulnerability Database/CVE-2025-62798

CVE-2025-62798: Sharp Laravel CMS XSS Vulnerability

CVE-2025-62798 is a cross-site scripting flaw in Sharp content management framework for Laravel that allows attackers to inject malicious code. This post explains its impact, affected versions, and mitigation steps.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2025-62798 Overview

CVE-2025-62798 is a Cross-Site Scripting (XSS) vulnerability in Sharp, a content management framework built for Laravel. The flaw affects the SharpShowTextField component in versions prior to 9.11.1. Expressions wrapped in {{ & }} were evaluated by Vue, allowing attackers to inject arbitrary JavaScript or HTML that executes in the browser when the field is displayed. The maintainer released a fix in version 9.11.1. The vulnerability is classified under [CWE-79] (Improper Neutralization of Input During Web Page Generation).

Critical Impact

Authenticated attackers can inject scripts that execute in the browsers of other Sharp users viewing affected text fields, enabling session theft or actions on behalf of victims.

Affected Products

  • code16/sharp (Laravel CMS framework)
  • Sharp versions prior to 9.11.1
  • Applications using the SharpShowTextField component to render user-supplied content

Discovery Timeline

  • 2025-10-28 - CVE-2025-62798 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2025-62798

Vulnerability Analysis

Sharp is a Laravel package that provides an administration interface for content management. The framework uses Vue.js on the client side to render entity fields inside its show and form views. The SharpShowTextField component is responsible for displaying text content stored by application entities.

In affected versions, the component rendered stored content in a way that Vue interpreted template expressions inside the payload. Specifically, text containing the unescaped interpolation syntax {{ & }} was evaluated by Vue rather than rendered as inert text. This allowed stored content to introduce arbitrary HTML or JavaScript into the rendered DOM.

Exploitation requires an attacker with permission to write into a field that is later shown through SharpShowTextField. Because scripts execute in the browser of any authenticated user viewing the record, the flaw enables session hijacking, forced actions in the administration interface, and defacement of the CMS view.

Root Cause

The root cause is unsafe rendering of stored content through a Vue interpolation path that evaluates template expressions. The SharpShowTextField component did not neutralize or escape the raw HTML interpolation marker ({{ & }}) before passing content to the template engine, resulting in stored XSS.

Attack Vector

An authenticated attacker submits a payload containing the Vue unescaped interpolation syntax into a text field managed by Sharp. When another user opens the record in the Sharp interface, the browser evaluates the payload and executes attacker-controlled JavaScript in the context of the victim's session. See the GitHub Security Advisory GHSA-9f58-4465-23c7 for technical details on the affected code path.

Detection Methods for CVE-2025-62798

Indicators of Compromise

  • Stored records containing the Vue unescaped interpolation pattern {{ & }} or references to v-html inside text fields.
  • Unexpected outbound HTTP requests originating from browsers of administrative users while viewing Sharp records.
  • Creation or modification of Sharp entities by low-privileged accounts followed by administrator access to those records.

Detection Strategies

  • Query the application database for text field values containing {{, }}, <script, or onerror= substrings against tables backing Sharp entities.
  • Inspect web server logs for POST and PUT requests to Sharp form endpoints with payloads matching Vue interpolation markers.
  • Review the deployed Sharp package version through composer show code16/sharp and confirm it is 9.11.1 or later.

Monitoring Recommendations

  • Enable Content Security Policy (CSP) reporting to capture inline script violations triggered in the Sharp administration interface.
  • Log and alert on administrative user sessions that trigger unusual DOM-originating requests, particularly to unknown external domains.
  • Track edits to entities by non-administrator roles and correlate with subsequent administrator views of the same records.

How to Mitigate CVE-2025-62798

Immediate Actions Required

  • Upgrade code16/sharp to version 9.11.1 or later using Composer.
  • Audit existing stored content in Sharp-managed entities for injected Vue interpolation payloads or HTML tags.
  • Rotate administrator session cookies after patching if exploitation is suspected.
  • Restrict write access to Sharp entities to trusted roles until the upgrade is verified in production.

Patch Information

The fix is available in Sharp version 9.11.1. Refer to the GitHub Release v9.11.1 notes and the code changes in GitHub Pull Request #654 for details on the corrected rendering behavior.

Workarounds

  • Strip or encode {{ and }} sequences in user input before persisting values that will be rendered by SharpShowTextField.
  • Deploy a strict Content Security Policy that disallows unsafe-inline scripts on the Sharp administration interface.
  • Limit accounts that can write to Sharp entities to a minimal, trusted set until the patched version is deployed.
bash
# Upgrade Sharp to the patched release
composer require code16/sharp:^9.11.1
composer update code16/sharp
php artisan view:clear

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.