mirror of https://github.com/laurent22/joplin.git
Desktop: Security: Remove the `name` attribute when rendering to HTML (#11591)
parent
ac154ee1e8
commit
e70efcbd60
|
@ -0,0 +1,2 @@
|
|||
<img src="test/" class="jop-noMdConv"/>
|
||||
<img src="http://example.com/test.png" class="jop-noMdConv"/>
|
|
@ -0,0 +1,3 @@
|
|||
<img name=getElementById src=test/>
|
||||
|
||||
<IMG NAME="getElementById" SRC="http://example.com/test.png">
|
|
@ -308,6 +308,12 @@ class HtmlUtils {
|
|||
attrs['href'] = '#';
|
||||
}
|
||||
|
||||
// Allowing the 'name' attribute allows an attacker to overwrite
|
||||
// DOM methods (e.g. getElementById) with elements.
|
||||
if ('name' in attrs) {
|
||||
delete attrs['name'];
|
||||
}
|
||||
|
||||
// We need to clear any such attribute, otherwise it will
|
||||
// make any arbitrary link open within the application.
|
||||
if ('data-from-md' in attrs) {
|
||||
|
|
Loading…
Reference in New Issue