The SentinelOne Annual Threat Report - A Defenders Guide from the FrontlinesThe SentinelOne Annual Threat ReportGet the Report
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2025-46734

CVE-2025-46734: league/commonmark Attributes XSS Vulnerability

CVE-2025-46734 is a cross-site scripting flaw in the league/commonmark PHP Markdown parser that enables attackers to inject malicious JavaScript through HTML attributes. This article covers technical details, affected versions, and mitigation.

Updated: January 22, 2026

CVE-2025-46734 Overview

A cross-site scripting (XSS) vulnerability has been identified in the Attributes extension of the league/commonmark library, a widely-used PHP Markdown parser. This vulnerability affects versions 1.5.0 through 2.6.x and allows remote attackers to inject malicious JavaScript calls into HTML output by exploiting the curly brace syntax used for attribute injection in Markdown.

The league/commonmark library provides configuration options such as html_input: 'strip' and allow_unsafe_links: false to mitigate XSS attacks by stripping raw HTML and disallowing unsafe links. However, when the Attributes Extension is enabled, it introduces a way for users to inject arbitrary HTML attributes into elements via Markdown syntax using curly braces, effectively bypassing these protective measures.

Critical Impact

Attackers can inject arbitrary HTML attributes including event handlers (e.g., onclick, onerror) to execute malicious JavaScript in the context of victim users' browsers, potentially leading to session hijacking, credential theft, or malware distribution.

Affected Products

  • league/commonmark versions 1.5.0 through 2.6.x
  • PHP applications using the Attributes Extension
  • Web applications parsing untrusted Markdown input with AttributesExtension enabled

Discovery Timeline

  • 2025-05-05 - CVE CVE-2025-46734 published to NVD
  • 2025-05-05 - Last updated in NVD database

Technical Details for CVE-2025-46734

Vulnerability Analysis

This vulnerability is classified as CWE-79 (Improper Neutralization of Input During Web Page Generation), commonly known as Cross-Site Scripting (XSS). The attack vector is network-based and requires low privileges to exploit, making it accessible to authenticated users with the ability to submit Markdown content.

The core issue lies in the Attributes Extension's design, which allows users to specify arbitrary HTML attributes using curly brace syntax in Markdown documents. While the library's core security settings (html_input: 'strip' and allow_unsafe_links: false) are intended to prevent XSS attacks, the Attributes Extension operates independently of these controls, creating a security gap.

When processing Markdown content, the extension parses curly brace notation and directly applies the specified attributes to HTML elements without adequate filtering. This allows attackers to inject event handler attributes (such as onclick, onmouseover, onerror) that execute JavaScript when triggered by user interaction.

Root Cause

The root cause stems from insufficient attribute filtering in the AttributesExtension and AttributesListener classes. The original implementation did not validate or sanitize attribute names before applying them to HTML elements, nor did it respect the existing security configuration options designed to prevent XSS attacks.

Specifically, the AttributesListener class processed user-supplied attributes without:

  1. Blocking event handler attributes (attributes starting with on)
  2. Implementing an allowlist for permitted attributes
  3. Respecting the allow_unsafe_links configuration for href and src attributes

Attack Vector

An attacker with the ability to submit Markdown content can craft malicious input using the curly brace syntax to inject JavaScript event handlers. When a victim views the rendered HTML output, the injected JavaScript executes in their browser context.

For example, a malicious Markdown input might include attributes like {onclick="malicious_code()"} appended to links or images. Since the Attributes Extension did not filter these attributes, the resulting HTML would include the event handler, ready to execute when triggered.

The fix implemented in version 2.7.0 addresses this vulnerability through three key changes visible in the security patch:

php
// Security patch in src/Extension/Attributes/AttributesExtension.php
 use League\CommonMark\Extension\Attributes\Event\AttributesListener;
 use League\CommonMark\Extension\Attributes\Parser\AttributesBlockStartParser;
 use League\CommonMark\Extension\Attributes\Parser\AttributesInlineParser;
-use League\CommonMark\Extension\ExtensionInterface;
+use League\CommonMark\Extension\ConfigurableExtensionInterface;
+use League\Config\ConfigurationBuilderInterface;
+use Nette\Schema\Expect;

-final class AttributesExtension implements ExtensionInterface
+final class AttributesExtension implements ConfigurableExtensionInterface
 {
+    public function configureSchema(ConfigurationBuilderInterface $builder): void
+    {
+        $builder->addSchema('attributes', Expect::structure([
+            'allow' => Expect::arrayOf('string')->default([]),
+        ]));
+    }
+
     public function register(EnvironmentBuilderInterface $environment): void
     {
+        $allowList        = $environment->getConfiguration()->get('attributes.allow');
+        $allowUnsafeLinks = $environment->getConfiguration()->get('allow_unsafe_links');
+
         $environment->addBlockStartParser(new AttributesBlockStartParser());
         $environment->addInlineParser(new AttributesInlineParser());
-        $environment->addEventListener(DocumentParsedEvent::class, [new AttributesListener(), 'processDocument']);
+        $environment->addEventListener(DocumentParsedEvent::class, [new AttributesListener($allowList, $allowUnsafeLinks), 'processDocument']);
     }
 }

Source: GitHub Commit Changes

The AttributesListener was also updated to accept and enforce security configuration:

php
// Security patch in src/Extension/Attributes/Event/AttributesListener.php
     private const DIRECTION_PREFIX = 'prefix';
     private const DIRECTION_SUFFIX = 'suffix';

+    /** @var list<string> */
+    private array $allowList;
+    private bool $allowUnsafeLinks;
+
+    /**
+     * @param list<string> $allowList
+     */
+    public function __construct(array $allowList = [], bool $allowUnsafeLinks = true)
+    {
+        $this->allowList        = $allowList;
+        $this->allowUnsafeLinks = $allowUnsafeLinks;
+    }
+
     public function processDocument(DocumentParsedEvent $event): void
     {
         foreach ($event->getDocument()->iterator() as $node) {

Source: GitHub Commit Changes

Detection Methods for CVE-2025-46734

Indicators of Compromise

  • Presence of event handler attributes (onclick, onerror, onload, onmouseover, etc.) in rendered HTML output from Markdown content
  • Markdown content containing curly brace syntax with suspicious attribute names starting with on
  • User-submitted content containing JavaScript URIs (javascript:) within attribute values
  • Unexpected JavaScript execution in pages displaying user-generated Markdown content

Detection Strategies

  • Review application dependencies for league/commonmark versions between 1.5.0 and 2.6.x using composer show league/commonmark
  • Implement Content Security Policy (CSP) headers to detect and block inline script execution attempts
  • Monitor web application firewall (WAF) logs for requests containing curly brace notation with event handler patterns
  • Audit existing Markdown content in databases for potentially malicious attribute injections

Monitoring Recommendations

  • Enable SentinelOne Singularity Platform to detect anomalous JavaScript execution patterns in web application contexts
  • Configure browser-based XSS auditors and CSP violation reporting to capture exploitation attempts
  • Implement logging for Markdown rendering operations to track input patterns that may indicate attack attempts
  • Deploy runtime application self-protection (RASP) solutions to detect XSS payloads at the application layer

How to Mitigate CVE-2025-46734

Immediate Actions Required

  • Upgrade league/commonmark to version 2.7.0 or later immediately
  • Audit all Markdown rendering configurations to identify instances where AttributesExtension is enabled
  • Review stored user-generated Markdown content for potential malicious attribute injections
  • Implement Content Security Policy headers with strict inline script restrictions as a defense-in-depth measure

Patch Information

The vulnerability has been patched in league/commonmark version 2.7.0. The fix implements three critical security improvements:

  1. All attributes starting with on are now considered unsafe and blocked by default
  2. Support for an explicit allowlist of permitted HTML attributes via the attributes.allow configuration option
  3. Manually-added href and src attributes now respect the existing allow_unsafe_links configuration option

Update via Composer:

bash
composer require league/commonmark:^2.7.0

For detailed patch information, refer to the GitHub Security Advisory GHSA-3527-qv2q-pfvx.

Workarounds

  • Disable the AttributesExtension entirely for untrusted users if upgrading is not immediately feasible
  • Filter rendered HTML output through a sanitization library like HTMLPurifier before displaying to users
  • Implement a custom attribute filter to strip event handler attributes before the Markdown is processed
  • Restrict Markdown input to trusted, authenticated users only until the patch can be applied
bash
# Configuration example - Disable AttributesExtension in PHP
# Remove or comment out the extension registration:
# $environment->addExtension(new AttributesExtension());

# If using with attributes in version 2.7.0+, configure allowlist:
# 'attributes' => [
#     'allow' => ['class', 'id', 'href', 'src', 'alt', 'title'],
# ],

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

  • Vulnerability Details
  • TypeXSS

  • Vendor/TechLeague Commonmark

  • SeverityMEDIUM

  • CVSS Score6.4

  • EPSS Probability0.01%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:L/I:L/A:N
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityNone
  • CWE References
  • CWE-79
  • Technical References
  • GitHub Commit Changes

  • GitHub Security Advisory GHSA-3527-qv2q-pfvx
  • Related CVEs
  • CVE-2026-33347: league/commonmark Auth Bypass Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English