Skip to content

Commit

Permalink
add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh committed Oct 10, 2023
1 parent 0ad61af commit 5297d62
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/contented-example/docs/04-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,18 @@ Remote images are left as is.

> You can inspect this HTML page to see how the images are embedded.
:::div{.admonitions.yellow}

Always be careful with user input. For example, it’s possible to hide JavaScript inside images (such as GIFs, WebPs, and
SVGs). User provided images open you up to a cross-site scripting (XSS) attack.

If you’re using Contented to render user-provided Markdown, you should disable images by default and only enable them
when you trust the source. Contented designed to be used for developer authoring where the source is trusted and XSS
being the least of your worries since the developer (having control of source code) can already inject arbitrary
JavaScript into the page without needing to go through this lengthy process.

:::

![local-embedded-image.png](local-embedded-image.png)
![placehold.co](https://placehold.co/1500x300.png?text=Remote%20Loaded%20Image)

Expand Down

0 comments on commit 5297d62

Please sign in to comment.