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

Inline JavaScript isn't properly escaped #3271

Closed
avernet opened this issue Jun 19, 2017 · 0 comments
Closed

Inline JavaScript isn't properly escaped #3271

avernet opened this issue Jun 19, 2017 · 0 comments
Assignees
Milestone

Comments

@avernet
Copy link
Collaborator

avernet commented Jun 19, 2017

To reproduce run this XForms, and notice the \n \n \n \n \n"}]}; at the top of the page. Looking at the source sent to the browser, you'll notice that the script is ended prematurely, because of a </script> in a string.

One possible solution would be have the content of the inline script protected by a CDATA section, but somehow the specific ForwardingXMLReceiver we have here has forwardLexical set to false. We could figure out to set it true, but risk having to deal with other handlers down the stream that don't properly propagate the startCDATA() and endCDATA(), so instead it seems simpler to avoid the use of CDATA and use escaping. We could escape specifically the value of the value property in orbeonInitData, but since we have other inline scripts where this problem can also occur, and since this technique seems safe, it seems safer to just escape the whole script.

+1 from community

@avernet avernet added this to the 2017.1 milestone Jun 19, 2017
@avernet avernet self-assigned this Jun 19, 2017
@ebruchez ebruchez added this to Fixed to Verify in Orbeon Forms 2017.1 Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Orbeon Forms 2017.1
Fixed to Verify
Development

No branches or pull requests

1 participant