Skip to content

Commit 361b7fb

Browse files
authored
Fix XSS on debug page (#1264)
1 parent 587f365 commit 361b7fb

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
@@ -234,7 +234,7 @@ defmodule Plug.Debugger do
234234
Keyword.merge(assigns,
235235
conn: conn,
236236
message: maybe_autolink(message),
237-
markdown: markdown,
237+
markdown: h(markdown),
238238
style: style,
239239
banner: banner,
240240
actions: actions,

lib/plug/templates/debugger.html.eex

+1-1
Original file line numberDiff line numberDiff line change
@@ -1057,7 +1057,7 @@
10571057
function copyToClipboard () {
10581058
if(navigator.clipboard) {
10591059
// For those working on localhost or HTTPS
1060-
navigator.clipboard.writeText($copy.innerHTML).then(copiedClipboard).catch(() => {})
1060+
navigator.clipboard.writeText($copy.textContent).then(copiedClipboard).catch(() => {})
10611061
} else {
10621062
// For those working on HTTP
10631063
$copy.select()

0 commit comments

Comments
 (0)