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

There is no schema validation for policy XML #58

Closed
spassarop opened this issue Dec 12, 2020 · 4 comments
Closed

There is no schema validation for policy XML #58

spassarop opened this issue Dec 12, 2020 · 4 comments

Comments

@spassarop
Copy link
Collaborator

AntiSamy seems to lack of a schema validation when loading the XML of a policy.

This may lead to malformed policies that are valid (AntiSamy won't blow up) but do not comply with the XSD. Bugs can originate from bad policy definition, which could be prevented with XML schema validation.

Even if applying validation to current example policies (and some customized in tests), they fail to validate.

This is a screenshot to the validation on freeformatter for antisamy-tinymce.xml:

Screenshot 2020-12-12 094537

I would suggest applying strict schema validation with the already defined XSD. As an improvement, if requested or considered useful, multiple or "stacked" validation could be applied, seen as an intersection of schemas to restrict policies structure even more.

@davewichers
Copy link
Collaborator

Sounds good to me. Do you want to implement something in the new 1.6.0 branch?

@spassarop
Copy link
Collaborator Author

Today from the OWASP Uruguay chapter, we did an implementation with some tests on 1.6.0. Soon we’ll create a PR for review and reference this issue.

@spassarop
Copy link
Collaborator Author

@davewichers - PR was created referencing the issue. Maybe this could be tagged as "feature"?

@davewichers davewichers mentioned this issue Jan 12, 2021
This was referenced Jan 14, 2021
@davewichers
Copy link
Collaborator

This was addressed in commit 3f446c5 to the master branch and AntiSamy v1.6.0 was released today with this included.

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

No branches or pull requests

2 participants