Skip to content

Commit 3d07e2a

Browse files
committed
Add notes on security
1 parent 353a9a3 commit 3d07e2a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

readme.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@ Yields:
200200
Some text with <svg viewBox="0 0 1 1" width="1" height="1"><rect fill="black" x="0" y="0" width="1" height="1"></rect></svg> a graphic… Wait is that a dead pixel?
201201
```
202202

203+
## Security
204+
205+
Use of `hast-util-to-mdast` can open you up to a
206+
[cross-site scripting (XSS)][xss] attack if the hast tree is unsafe.
207+
Use [`hast-util-santize`][sanitize] to make the hast tree safe.
208+
203209
## Related
204210

205211
* [`hast-util-to-nlcst`](https://github.com/syntax-tree/hast-util-to-nlcst)
@@ -291,6 +297,10 @@ abide by its terms.
291297

292298
[rehype-remark]: https://github.com/rehypejs/rehype-remark
293299

300+
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
301+
302+
[sanitize]: https://github.com/syntax-tree/hast-util-sanitize
303+
294304
[handler]: #optionshandlers
295305

296306
[handlers]: https://github.com/syntax-tree/hast-util-to-mdast/tree/master/lib/handlers

0 commit comments

Comments
 (0)