Skip to content

Commit 4d69c1a

Browse files
committed
Fix Issue 17391 - SECURITY: XSS through DDOC comments
Add a documentation note about the security considerations of embeddable HTML in DDoc.
1 parent 5d214d4 commit 4d69c1a

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

dcompiler.dd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,9 @@ dmd -cov -unittest myprog.d
424424
)
425425

426426
$(SWITCH $(SWNAME -D),
427-
generate $(LINK2 spec/ddoc.html, documentation) from source
427+
$(P Generate $(LINK2 spec/ddoc.html, documentation) from source.)
428+
429+
$(P Note: mind the $(LINK2 spec/ddoc.html#security, security considerations).)
428430
)
429431

430432
$(SWITCH $(SWNAME -Dd)$(I docdir),

spec/ddoc.dd

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,16 @@ $(P
10331033
generated by Ddoc.
10341034
)
10351035

1036+
$(H2 $(LNAME2 security, Security considerations))
1037+
1038+
$(P
1039+
Note that DDoc comments may embed raw HTML, including
1040+
$(LT)script$(GT) tags. Be careful when publishing or distributing
1041+
rendered DDoc HTML generated from untrusted sources, as this may
1042+
allow $(LINK2 https://en.wikipedia.org/wiki/Cross-site_scripting,
1043+
cross-site scripting).
1044+
)
1045+
10361046
$(H2 Links to D documentation generators)
10371047

10381048
$(P

0 commit comments

Comments
 (0)