Skip to content

Commit 42b242a

Browse files
committed
Add notes on security
1 parent 4254637 commit 42b242a

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

readme.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ One special value, namely `'data*'`, can be used to allow all `data` properties.
133133
"accept",
134134
"acceptCharset",
135135
//
136-
"vspace",
136+
"vSpace",
137137
"width",
138138
"itemProp"
139139
]
@@ -281,6 +281,15 @@ Whether to allow [*doctypes*][doctype] (`boolean`, default: `false`).
281281
"allowDoctypes": true
282282
```
283283

284+
## Security
285+
286+
Improper use of `hast-util-sanitize` can open you up to a
287+
[cross-site scripting (XSS)][xss] attack.
288+
The defaults *are* safe, but deviating from them is likely *unsafe*.
289+
290+
Use `hast-util-sanitize` *after* all other utilities, as other utilities are
291+
likely also unsafe.
292+
284293
## Contribute
285294

286295
See [`contributing.md` in `syntax-tree/.github`][contributing] for ways to get
@@ -359,6 +368,8 @@ abide by its terms.
359368

360369
[github]: https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/sanitization_filter.rb
361370

371+
[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting
372+
362373
[schema-github]: lib/github.json
363374

364375
[schema]: #schema

0 commit comments

Comments
 (0)