Commit ab2575e
authored
Escape HTML in LDKController to prevent XSS (#288)
## Rationale
Two spots in LDKController rendered untrusted content as raw HTML. The
container-scoped-table inspection view is a correction to a previous
security fix (#268): the HTMLView cleanup there wrapped the whole string
in HtmlString.of, which escaped the literal <br>/<p> markup too — safe,
but it broke the intended formatting. This escapes only the dynamic
validation messages (which can contain arbitrary content from direct DB
inserts that bypass the user schema) while preserving the markup. The
invalid-redirect error message separately echoed the user-supplied URL
via HtmlString.unsafe, so it is now escaped.
## Related Pull Requests
- #268
## Changes
- Container-scoped-table inspection view: escape each validation message
with PageFlowUtil.filter before joining with <br>, then wrap the
assembled markup in HtmlString.unsafe — fixing the over-escaping
introduced by #268 while keeping the output safe.
- Invalid-redirect error message: switch the user-supplied URL from
HtmlString.unsafe to HtmlString.of so it is escaped.1 parent 5a5bd07 commit ab2575e
1 file changed
Lines changed: 4 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
439 | 440 | | |
440 | 441 | | |
441 | 442 | | |
442 | | - | |
| 443 | + | |
443 | 444 | | |
444 | | - | |
| 445 | + | |
445 | 446 | | |
446 | 447 | | |
447 | 448 | | |
| |||
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
915 | | - | |
| 916 | + | |
916 | 917 | | |
917 | 918 | | |
918 | 919 | | |
| |||
0 commit comments