Security

An editor produces HTML that other people will see, so rich text is a classic way to attack a website. Typical scenarios are a script hidden in a link, an event handler in an attribute and markup that changes meaning when parsed again. Here is how VEditor protects against them and how we tested it.

Safeguards

The browser cleans content for convenience; the PHP sanitizer on your server is the security boundary and enforces the same rules.

  • One content model

    The editor schema and HtmlSanitizer share the same whitelist of tags, attributes, classes and styles, kept in sync and tested with real form posts.

  • Sanitizer on the server

    Built on DOMDocument with no libraries. Anything the editor would not produce is removed, whatever the browser sent.

  • Checked URLs

    Only http, https, mailto, tel and relative addresses, after removing control characters. Every srcset entry is checked like src.

  • Attributes by pattern

    Every attribute has a pattern: title without quotes or angle brackets, width in pixels, start as a number. No on*, no style outside the whitelist.

  • Prefixed ids

    Only ve- ids are allowed, which prevents DOM clobbering of your page’s scripts.

  • Safe new tabs

    target="_blank" always gets noopener noreferrer; rel values come from a short list.

  • Embeds from a whitelist

    Only YouTube (no-cookie) and Vimeo iframes inside a figure, with sandbox and referrerpolicy forced on output.

  • Size limit and linear time

    LengthException above 1 MB, invalid UTF-8 scrubbed, no quadratic loops on large documents.

  • Strict CSP

    No eval, no inline handlers; the integrations pass a nonce to the only inline module script.

  • AI keys stay on the server

    Prompts live on the server, the browser sends only content and names from whitelists, and model output is sanitized before the preview.

  • No calls to the vendor

    The licence is verified locally. The editor sends nothing to our server.

  • No supply chain

    Zero npm and Composer dependencies, so there is no third-party package to compromise. Releases are built from signed-off tags with a secret scan.

Test results

Typical XSS payloads sent straight to HtmlSanitizer::sanitize(), bypassing the editor. None survived.

XSS payloads and the sanitizer output
PayloadResult
<script>, <svg onload>, <img onerror>handler removed; `script` and `svg` removed with their content, the surrounding text kept
javascript: links, also jav&#x09;ascript: and &#106;avascript:link removed, text kept
data:text/html;base64,… linklink removed
title with &quot; onmouseover=…attribute removed
<noscript> with an <img onerror> inside an attribute (mXSS)container removed
<iframe> from any other domain, <object>, <embed>removed
<form>, <meta http-equiv="refresh">, <base href>removed
id="cookie", srcset="javascript:… 1x", style="background:url(javascript:…)"attribute removed

Performance under attack

A sanitizer that can be slowed down is a denial-of-service target. Large and deeply nested documents are processed in linear time.

Sanitizer processing time for large inputs
InputSizeTime
12,000 paragraphs with formatting and links996 KB425 ms
10,000 nested quotes244 KB1 ms
50,000 unclosed tags146 KB2 ms
Table with 300 rows and 30 columns91 KB66 ms
Content one byte over the limit1 MB + 1 Brejected before parsing

PHP 8.2 on a developer laptop (Windows, XAMPP). The limit is maxLength in the constructor; handle LengthException in your controller.

Reporting a vulnerability

Found a vulnerability? Report it confidentially through the form (type “Vulnerability”); we do not accept reports by e-mail. Do not describe it in public places such as the ideas list or forums.

Acknowledgement
within 14 days
Initial assessment
within 30 days (CVSS 4.0)
Fix
critical and high: target 30 days; medium and low: target 90 days
Security fix period
every X.Y version: 24 months of security fixes from its release (table on the Changelog page); updates: 12 months from purchase
Disclosure
coordinated, normally up to 90 days from the report; advisory and CVE for released versions

Please include the VEditor version and integration, the browser and PHP versions, a description and impact of the issue and steps to reproduce it with a harmless payload. The full policy is in the SECURITY.md file included in the package.

Security fix log

All versions
DateVersionDescriptionSeverity
No security fixes published yet.

Try it in your browser

The demo has the full toolbar and shows what the PHP sanitizer returns for your content.