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

Accessibility strings would be vulnerable to xss #175

Closed
jonathanolson opened this issue Jan 14, 2017 · 9 comments
Closed

Accessibility strings would be vulnerable to xss #175

jonathanolson opened this issue Jan 14, 2017 · 9 comments
Assignees

Comments

@jonathanolson
Copy link
Contributor

If these are ever made translatable, or could change with a query parameter.

In JohnTravoltageA11yStrings, replace arrowKeysMoveFootString's value to:

'<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVQIW2NkYGD4DwABCQEBtxmN7wAAAABJRU5ErkJggg==" onload="window.location.href=atob(\'aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQ==\')" />'

to reproduce.

We should have a better way to mark up bold/non-bold text, or we could use improved validation.

@mattpen, in your investigation with the OWASP validator, is that something we could use in rosetta to prevent this type of attack vector? (I'd really like to allow the current usage, as it's quite flexible for the translator).

Code review for #128

@jonathanolson
Copy link
Contributor Author

Also @ariel-phet, I don't recall the timeline or chance of having accessible strings be translated (this and some other issues like handling long strings would only apply if we plan on doing this in the future at some time).

Is it valuable to create review items anticipating translation, or should we plan to leave related improvements until that point (like XSS/layout).

@mattpen
Copy link

mattpen commented Jan 14, 2017

The OWASP validator I looked at was a Java library. I'll investigate if a JavaScript library exists.

Alternatively, is this something that could be prevented with CSP, or do these types of tags need to be allowed elsewhere?

@jonathanolson
Copy link
Contributor Author

Good point. Can CSP prevent execution from setting element.innerHTML? We'd also need to ensure that type of behavior wasn't needed elsewhere in sims.

@mattpen
Copy link

mattpen commented Jan 14, 2017

@jonathonolson - I misunderstood how these strings were being used, I don't think CSP will be viable. Anything that would block this text would also block sim code from running. I thought you were referring to alt attributes for images.

I couldn't find a widely trusted validation library for Node after a quick search. According to OWASP, Microsoft provides one for .NET framework and OWASP provides one for Java projects. We could potentially use the OWASP project but would need to build a new service to use it rather than integrating it directly in rosetta.

@ariel-phet
Copy link

@jonathanolson yes it is valuable to create review items anticipating translation.

Although there is not yet a specific timeline, updating the translation utility to allow translation of a11y strings is on the horizon.

@ariel-phet ariel-phet removed their assignment Jan 17, 2017
@mattpen
Copy link

mattpen commented Jan 19, 2017

@jonathanolson - Let me know if you want help building a validator service. I'm removing my assignment for now.

@mattpen mattpen assigned jonathanolson and unassigned mattpen Jan 19, 2017
@jessegreenberg
Copy link
Contributor

Thanks for working on this @jonathanolson and @mattpen. This issue is not specific to this sim, would you mind if I move the ticket to rosetta?

@mattpen
Copy link

mattpen commented Feb 7, 2017

That sounds ok to me.

@jessegreenberg
Copy link
Contributor

I opened phetsims/rosetta#146 and moved all comments to that issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants