- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit1ba9ffa
committed
doc: Warn that ts_headline() output is not HTML-safe.
Add a documentation warning to ts_headline() pointing out that, whenworking with untrusted input documents, the output is not guaranteedto be safe for direct inclusion in web pages. This is because, whileit does remove some XML tags from the input, it doesn't remove allHTML markup, and so the result may be unsafe (e.g., it might permitXSS attacks).To guard against that, all HTML markup should be removed from theinput, making it plain text, or the output should be passed through anHTML sanitizer.In addition, document precisely what the default text search parserrecognises as valid XML tags, since that's what determines which XMLtags ts_headline() will remove.Reported-by: Richard Neill <richard.neill@telos.digital>Author: Dean Rasheed <dean.a.rasheed@gmail.com>Reviewed-by: Noah Misch <noah@leadboat.com>Backpatch-through: 131 parent7be51eb commit1ba9ffa
1 file changed
+28
-1
lines changedLines changed: 28 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1339 | 1339 |
| |
1340 | 1340 |
| |
1341 | 1341 |
| |
1342 |
| - | |
| 1342 | + | |
1343 | 1343 |
| |
1344 | 1344 |
| |
1345 | 1345 |
| |
| |||
1351 | 1351 |
| |
1352 | 1352 |
| |
1353 | 1353 |
| |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
1354 | 1369 |
| |
1355 | 1370 |
| |
1356 | 1371 |
| |
| |||
2222 | 2237 |
| |
2223 | 2238 |
| |
2224 | 2239 |
| |
| 2240 | + | |
| 2241 | + | |
| 2242 | + | |
| 2243 | + | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
| 2247 | + | |
| 2248 | + | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
2225 | 2252 |
| |
2226 | 2253 |
| |
2227 | 2254 |
| |
|
0 commit comments
Comments
(0)