Skip to content

Commit dbd349b

Browse files
i-n-g-m-a-rjosevalim
authored andcommitted
Fix XSS on debug page (#1264)
1 parent cc535b1 commit dbd349b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/plug/debugger.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ defmodule Plug.Debugger do
214214
Keyword.merge(assigns,
215215
conn: conn,
216216
message: message,
217-
markdown: markdown,
217+
markdown: h(markdown),
218218
style: style,
219219
banner: banner,
220220
actions: actions,

lib/plug/templates/debugger.html.eex

+1-1
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@
849849
function copyToClipboard () {
850850
if(navigator.clipboard) {
851851
// For those working on localhost or HTTPS
852-
navigator.clipboard.writeText($copy.innerHTML).then(copiedClipboard).catch(() => {})
852+
navigator.clipboard.writeText($copy.textContent).then(copiedClipboard).catch(() => {})
853853
} else {
854854
// For those working on HTTP
855855
$copy.select()

0 commit comments

Comments
 (0)