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

Sqid-generated links in descriptions broken by escaping #128

Closed
mkroetzsch opened this issue Dec 1, 2017 · 3 comments
Closed

Sqid-generated links in descriptions broken by escaping #128

mkroetzsch opened this issue Dec 1, 2017 · 3 comments
Assignees
Labels
bug Something isn't working view: Entity This relates to the entity view

Comments

@mkroetzsch
Copy link
Member

The recent XSS fix has broken SQID's ability to add some hyperlinks to descriptions. For example see

https://tools.wmflabs.org/sqid/#/view?id=Q6581097

This shows correct links in the main description below the header, but broken links in the description of "female" on the page. It would be good if this could be fixed or at least disabled to make the markup disappear, but one might also wonder why it works in the main description (are we correctly escaping there after all?).

@mkroetzsch mkroetzsch added bug Something isn't working view: Entity This relates to the entity view labels Dec 1, 2017
@mmarx mmarx self-assigned this Dec 1, 2017
@mmarx
Copy link
Member

mmarx commented Dec 1, 2017

Yes, but escaping works differently for the main description. The problem seems to be that the property's description is escaped twice.

@mkroetzsch
Copy link
Member Author

Why twice? The problematic cases just show the HTML source code, which is what you would get when escaping the SQID-generated markup once. It seems one would merely have to do the escaping before inserting the (safe) markup.

@mmarx
Copy link
Member

mmarx commented Dec 1, 2017

Yes, it turns out you were right, escaping was applied after inserting the links instead of before.

@mmarx mmarx closed this as completed in 4e7ed25 Dec 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working view: Entity This relates to the entity view
Projects
None yet
Development

No branches or pull requests

2 participants