Skip to content

Commit

Permalink
Add notes on security
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Jul 20, 2019
1 parent 077a1b2 commit 31a4c77
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,15 @@ the things in a document.
The sanitation schema defines how and if nodes and properties should be cleaned.
The schema is documented in [`hast-util-sanitize`][schema].

## Security

Improper use of `rehype-sanitize` can open you up to a
[cross-site scripting (XSS)][xss] attack.
The defaults *are* safe, but deviating from them is likely *unsafe*.

Use `rehype-sanitize` *after* all other plugins, as other plugins are likely
also unsafe.

## Related

* [`hast-util-sanitize`](https://github.com/syntax-tree/hast-util-sanitize)
Expand Down Expand Up @@ -144,4 +153,6 @@ abide by its terms.

[rehype]: https://github.com/rehypejs/rehype

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[schema]: https://github.com/syntax-tree/hast-util-sanitize#schema

0 comments on commit 31a4c77

Please sign in to comment.