Skip to content

Handle html encoded values in comment bindings #16

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jeremiahblanch
Copy link

Passing unencoded values in comments allows values such as --><script>alert(1)</script><!-- to be passed through and these will be executed by the browser. To prevent this, the values need to be html encoded, eg into "--&gt;&lt;script&gt;alert(1)&lt;/script&gt;&lt;!--. Existing Quench won't decode these values.

This change uses the DOMParser to decode strings that include these escaped characters, so a comment binding like this works:

<!-- q-binding:fieldSpecs.fanEmail = {   &quot;name&quot;: &quot;fanEmail&quot;,   &quot;required&quot;: true,   &quot;type&quot;: &quot;email&quot;,   &quot;validationMessage&quot;: &quot;We really really need your email&quot; } -->

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

Successfully merging this pull request may close these issues.

1 participant