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
HtmlSanitizershare the same whitelist of tags, attributes, classes and styles, kept in sync and tested with real form posts.Sanitizer on the server
Built on
DOMDocumentwith 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
srcsetentry is checked likesrc.Attributes by pattern
Every attribute has a pattern:
titlewithout quotes or angle brackets,widthin pixels,startas a number. Noon*, nostyleoutside the whitelist.Prefixed ids
Only
ve-ids are allowed, which prevents DOM clobbering of your page’s scripts.Safe new tabs
target="_blank"always getsnoopener noreferrer;relvalues come from a short list.Embeds from a whitelist
Only YouTube (no-cookie) and Vimeo iframes inside a figure, with
sandboxandreferrerpolicyforced on output.Size limit and linear time
LengthExceptionabove 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.
| Payload | Result |
|---|---|
<script>, <svg onload>, <img onerror> | handler removed; `script` and `svg` removed with their content, the surrounding text kept |
javascript: links, also jav	ascript: and javascript: | link removed, text kept |
data:text/html;base64,… link | link removed |
title with " 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.
| Input | Size | Time |
|---|---|---|
| 12,000 paragraphs with formatting and links | 996 KB | 425 ms |
| 10,000 nested quotes | 244 KB | 1 ms |
| 50,000 unclosed tags | 146 KB | 2 ms |
| Table with 300 rows and 30 columns | 91 KB | 66 ms |
| Content one byte over the limit | 1 MB + 1 B | rejected 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| Date | Version | Description | Severity |
|---|---|---|---|
| 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.