mirror of https://github.com/status-im/codimd.git
Merge pull request #1193 from hackmdio/fix-render-view-error-msg-XSS
Fix stored XSS in the graphviz error message rendering [Security Issue]
This commit is contained in:
commit
9d7413d596
|
@ -333,7 +333,7 @@ export function finishView (view) {
|
|||
svg[0].setAttribute('preserveAspectRatio', 'xMidYMid meet')
|
||||
} catch (err) {
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
}
|
||||
})
|
||||
|
@ -357,7 +357,7 @@ export function finishView (view) {
|
|||
$value.children().unwrap().unwrap()
|
||||
} catch (err) {
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
}
|
||||
})
|
||||
|
@ -376,7 +376,7 @@ export function finishView (view) {
|
|||
$value.children().unwrap().unwrap()
|
||||
} catch (err) {
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
}
|
||||
})
|
||||
|
@ -398,7 +398,7 @@ export function finishView (view) {
|
|||
}
|
||||
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + errormessage + '</div>')
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(errormessage)}</div>`)
|
||||
console.warn(errormessage)
|
||||
}
|
||||
})
|
||||
|
@ -418,7 +418,7 @@ export function finishView (view) {
|
|||
svg[0].setAttribute('preserveAspectRatio', 'xMidYMid meet')
|
||||
} catch (err) {
|
||||
$value.unwrap()
|
||||
$value.parent().append('<div class="alert alert-warning">' + err + '</div>')
|
||||
$value.parent().append(`<div class="alert alert-warning">${escapeHTML(err)}</div>`)
|
||||
console.warn(err)
|
||||
}
|
||||
})
|
||||
|
@ -578,7 +578,7 @@ export function postProcess (code) {
|
|||
if (warning && warning.length > 0) {
|
||||
warning.text(md.metaError)
|
||||
} else {
|
||||
warning = $('<div id="meta-error" class="alert alert-warning">' + md.metaError + '</div>')
|
||||
warning = $(`<div id="meta-error" class="alert alert-warning">${escapeHTML(md.metaError)}</div>`)
|
||||
result.prepend(warning)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue