Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make Dest column into clickable links #587

Merged
merged 2 commits into from
Feb 25, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion admin/ui/route.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ $(function(){
tbl += '<td>' + (i+1) + '</td>';
tbl += '<td>' + r.service + '</td>';
tbl += '<td>' + r.src + '</td>';
tbl += '<td>' + r.dst + '</td>';
tbl += '<td><a href="' + r.dst + '">' + r.dst + '</a></td>';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the attribute have to be escaped? What happens if r.dst contains a quote, for instance?.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this code is already vulnerable to XSS. I'm gonna fix this in another PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've only seen dst be an ip:port combo, not sure how clicking on a link has anything to do with XSS?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dst is an arbitrary string from the configuration and may contain <script>evilCode();</script>. But again, I've addressed this in #588, so don't worry about it here.

tbl += '<td>' + r.opts + '</td>';
tbl += '<td>' + (r.weight * 100).toFixed(2) + '%</td>';
tbl += '</tr>';
Expand Down