Skip to content

Commit 3ca83a7

Browse files
committed
Make note of possible XSS in Rustdoc
Fixes #24160
1 parent 00a8d65 commit 3ca83a7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/doc/trpl/documentation.md

+10
Original file line numberDiff line numberDiff line change
@@ -560,3 +560,13 @@ This sets a few different options, with a logo, favicon, and a root URL.
560560
- `--html-before-content FILE`: includes the contents of FILE directly after
561561
`<body>`, before the rendered content (including the search bar).
562562
- `--html-after-content FILE`: includes the contents of FILE after all the rendered content.
563+
564+
## Security note
565+
566+
The Markdown in documentation comments is placed without processing into
567+
the final webpage. Be careful with literal HTML:
568+
569+
```rust
570+
/// <script>alert(document.cookie)</script>
571+
# fn foo() {}
572+
```

0 commit comments

Comments
 (0)