Vote #81009
完了Inline issue auto complete doesn't sanitize HTML tags
0%
説明
If referring a issue that have a HTML tag in subject, the tag is rendered as an object in the auto complete tip.
To reproduce
Create one issue with a subject like @Test
Start a new issue, go to description field and type issue number created above¶
Result
- We should display something like @Feature #xxxx Test
- We display a @select@ object rendered in the tip, like image bellow
!tip.png!
This can be dangerous,as some one can inject HTML
journals
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Fernando, thanks for catching this.
I've attached a patch to fix this issue.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Marius BALTEANU wrote:
> I've attached a patch to fix this issue.
Thank you for fixing the issue but I see @<span>@ tags when using auto-complete by issue subject.
!{width: 502px; border: 1px solid grey;}.autocomplete-by-title.png!
--------------------------------------------------------------------------------
Thanks for pointing this out, I was able to reproduce the problem. I will post soon a fix.
--------------------------------------------------------------------------------
Please try this new version, it should work as expected with one mention: the letters that match the search are no longer highlighted.
!{border: 1px solid grey; width: 50%}.tribute.png!
Also, instead of the @sanitzeHTML@ function, I think it's better to use a library like https://lodash.com/docs/4.17.15#escape, but I'm not sure how to add it without copying the code or by using a module bundler like webpack. @Jean-Philippe, any recommendations on this?
--------------------------------------------------------------------------------
This one works on IE 11 as well.
--------------------------------------------------------------------------------
Attached is a test for this issue that can be applied only after #34123 is committed.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Update the patch for the latest trunk (r20791).
--------------------------------------------------------------------------------
Committed the fix. Thank you all for your contribution.
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
By the way: this a full-blown XSS vulnerability. With an issue subject such as
<pre>
<span onmouseover="alert('pwned');">This is some exciting text</span>
</pre>
arbitrary Javascript can be executed (as well as arbitrary HTML code shown). In my opinion, the assessment of the issue in [[Security_Advisories]] should therefore be increased to High.
--------------------------------------------------------------------------------
Holger Just wrote:
> By the way: this a full-blown XSS vulnerability. With an issue subject such as
>
> [...]
>
> arbitrary Javascript can be executed (as well as arbitrary HTML code shown). In my opinion, the assessment of the issue in [[Security_Advisories]] should therefore be increased to High.
Thanks Holger, I've changed to High.
--------------------------------------------------------------------------------
related_issues
relates,Closed,31989,Inline issue auto complete (#) in fields with text-formatting enabled