-
Notifications
You must be signed in to change notification settings - Fork 2k
Potential stored xss issue? #1106
Comments
I am curious as to why that was left that in there because it looks like code testing rather than production code. Also worth noting that all these properties of the user object will be exposed by angular if the user pries:
Earlier I raised this issue in gitter, and @mleanos replied:
|
Thanks @mg1075. I am not up to speed on v0.4 I'm afraid but I know in previous versions the embedded user object was referenced directly client-side. To the extent that people are using mean.js to build very simple apps then I don't think it is a serious security issue....but the moment you create a view that exposes another users' username (i.e. pretty much any social or platform-type app) I believe there is a potential issue. |
I think perhaps here: Which is then referenced in the header at a minimum. |
Correction: views with other usernames will of course be sanitized by angular...so, yeah, probably not a major security issue. |
I don't see a problem with these fields. It shows your username or e-mail to you, so what? |
@lirantal I have sent you an email on the XSS topic. |
thanks, so where should this be fixed?
so (2) is an obvious fix no matter what and we can already provide a PR for. I believe Angular has it's own built in filters for that. as for (1) that's a more open question, usually data is saved on the db "as is" |
I believe if we can do 2 that should be enough. Issue is I believe we have escaped swig's sanitization. I for one am not certain how you would apply angular sanitization to a swig object...no doubt it's possible though. |
I feel like it should be stated clearly at this point — if someone manages to produce an actual XSS vulnerability — how should they disclose that information? Openly here or via emails directly to @lirantal? @apitts that swig object is visible only to authenticate user him/herself. For others everything is visible only via Angular, which has its own escaping methods as mentioned. |
@simison email to everyone on the team is best. |
e-mails are best for now, yes. |
@simison Yes - I agree. That is what I was trying to get at with my correction above but you have stated it more clearly. I can envision a situation where some other user-generated content is stored across users...though that would be pretty rare. |
Hi @apitts Getting back to this - I did see that the script tags are breaking the HTML and messing it up but I don't see any popups, though I bet it's easier to still attack it via XSS with a proper query. Were there any specific areas in the view that you noticed suffering from the XSS? |
Here:
mean/modules/core/server/views/layout.server.view.html
Line 48 in 3a4c51a
I am thinking about stored xss in the user object (e.g. signup with a script as a user name).
Let me know if I've missed where this would be filtered out elsewhere please.
The text was updated successfully, but these errors were encountered: