This is a migrated thread and some comments may be shown as answers.

[Solved] xss

3 Answers 130 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Oleg
Top achievements
Rank 1
Oleg asked on 16 Nov 2010, 09:17 PM
Hi,

I am using ComboBox and see that there is a possibility for persisted xss attack. It happens when clicking down in combobox to select a valule.


Here is an example demonstrating the issue.
Create a model with 2 properties:
    public Llist<SelectListItem> GroupList;
    public string SelectedGroup;


 <%Model.GroupList.Add(
    new SelectListItem {
        Text  = "Test<script>alert('i can haz your data');</script>",
        Value = "Test<script>alert('i can haz your data');</script>" }
); %>

<%= Html.Telerik().ComboBoxFor(x => x.SelectedGroup).
   .BindTo(Model.GroupList)
   .AutoFill(true)
   .HighlightFirstMatch(true)
%>

3 Answers, 1 is accepted

Sort by
0
Oleg
Top achievements
Rank 1
answered on 17 Nov 2010, 06:53 PM
Any chance this will be fixed anytime soon?

I can html encode values in the list before passing them into the combo box, but that will mean that I will have to html decode it, before using selected value.
0
Georgi Krustev
Telerik team
answered on 18 Nov 2010, 06:10 PM
Hi Oleg,

We will investigate the issue and write you shortly.

Sincerely yours,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Georgi Krustev
Telerik team
answered on 22 Nov 2010, 05:39 PM
Hello Oleg,

ComboBox UI components now encodes Text property of the DropDownItem. If you need to stop encoding you can use Encode() method.

I have attached latest internal build to this message. Check it and let me know if you encounter any problems with it.

Best wishes,
Georgi Krustev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
ComboBox
Asked by
Oleg
Top achievements
Rank 1
Answers by
Oleg
Top achievements
Rank 1
Georgi Krustev
Telerik team
Share this question
or