Live data from Hacker News

Show HN: MapChat – A simple location based chat in 300 lines of code

idoco.github.io

51–60 of 122 posts

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#51
post #47

This has serious XSS holes which need fixing! Here is a PR that should do the job (not tested): https://github.com/idoco/map-chat/pull/1

I received an alert in my browser while using this site - should I be worried?

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#55
post #48
post #28

Earlier quoted context omitted.

This is what I did for now msg.text = msg.text.replace('>','') .replace(' I will think of a more clever solution next week :)

Here is how mustache.js[0] does it: var entityMap = { "&": "&", " ": ">", '"': '"', "'": ''', "/": '/' }; function escapeHtml(string) { return String(string).replace(/[& "'\/]/g, function (s) { return entityMap[s]; }); } also document.createTextNode will tell the browser not to render the children as html, whereas appending a dom element and innerHTML will.[1] I'm just assuming that behavior is c…

Thanks I added that on top of JsHtmlSanitizer.

Re: Show HN: MapChat – A simple location based chat in 300 lines of code

#59
post #56
post #47

This has serious XSS holes which need fixing! Here is a PR that should do the job (not tested): https://github.com/idoco/map-chat/pull/1

Looks like it's all fixed now :)

Yeah, I added some real XSS protection.

Before today, I thought it would be cool to enable some html :)

Post reply on HN