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

Sanitize invalid JSON script #893

Merged
merged 14 commits into from
Jan 24, 2018
Merged

Conversation

westonruter
Copy link
Member

Ryan Kienstra and others added 11 commits January 23, 2018 14:58
As Weston mentioned, adding this to the post content:
Hello <script>document.write('world');</script>
Produced:
This looks to be related to how process_node() gets the $attr_spec_list.
In some cases, all will have an equal 'score,'
As indicated in $spec_ids_sorted.
And sometimes, all of them will be missing a mandatory attribute.
In that case, $attr_spec_list will be empty.
If it is, use the first spec list in:
$rule_spec_list_to_validate.
This will need regression testing.
There was an error on the Travis build:
Can't use function return value in write context.
So store the result of reset() in $first_spec_list.
This has a mandatory attribute.
And per the previous commits,
It should fail validation.
Address an issue where <script> tags aren't stripped.
@westonruter westonruter added this to the v0.7 milestone Jan 24, 2018
@ThierryA ThierryA merged commit 891c150 into develop Jan 24, 2018
@ThierryA ThierryA deleted the fix/sanitize-invalid-script-json branch January 24, 2018 10:09
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.

2 participants