Skip to content

Commit 0883b33

Browse files
Security Considerations: add HTML Editor Image Upload topic (DevExpress#8116) (DevExpress#8147)
1 parent cf55bc0 commit 0883b33

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Certain XSS risks cannot be mitigated solely through component properties. Application logic and rendering methods are equally critical. Passing user input to custom renderers, templates, or external scripts can still expose your application to XSS, regardless of property settings. To address these risks, use escape characters, sanitize user input, or enforce a strict [Content Security Policy](/Documentation/Guide/Common/Security_Considerations/#Content_Security_Policy).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
When users insert an image in the [HTML Editor](/api-reference/10%20UI%20Components/dxHtmlEditor '/Documentation/ApiReference/UI_Components/dxHtmlEditor/') "From the Web" dialog, treat the value as untrusted. Attackers may enter scriptable URLs (such as `javascript:` or `data:`) or targets that return HTML instead of an image.
2+
3+
![HTML Editor with an opened "From the Web" image upload dialog](/images/htmlEditor/html-editor-xss.png)
4+
5+
To block stored or reflected XSS:
6+
7+
- Validate each URL.
8+
- Route image retrieval through a server-side proxy and check returned data.
9+
- Clean document HTML during save.
10+
- Render with a restrictive [Content Security Policy (CSP)](/Documentation/Guide/Common/Security_Considerations/#Content_Security_Policy).
11+
12+
[important] SVG format allows scripts. Apply SVG-aware sanitization or rasterize images on the server before use.
337 KB
Loading

0 commit comments

Comments
 (0)