-
-
Notifications
You must be signed in to change notification settings - Fork 332
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
[14.0][FIX] document_page: Stored XSS #426
[14.0][FIX] document_page: Stored XSS #426
Conversation
b700fb0
to
90c66bc
Compare
e567de9
to
e3757f5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All existing contents that are not HTML will show incorrectly after this change. You need to incorporate a migration script that converts them to HTML.
It might be worth adding a test which verifies that the content is indeed sanitized after writing the record. |
e3757f5
to
4073b53
Compare
All existing contents currently are stored in a HTML format. Regardless of whether the Field is type Text, the editor takes the input, generates and stores the data in a HTML format. |
unitary tests added post-migration script added
4073b53
to
eda3c2a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. |
Field 'content' on 'document.page' model is compute. So when Field Type is changed to HTML this receives default sanitize. This data is computed from 'content' field on model 'document.page.history', which is stored. If some 'content' data was malicious the malicious script is still stored on the database on model 'document.page.history'. That's why I have added post-migration script on the recent commit. Just by reassigning the content data, now this field also receives default HTML sanitize and the script is completely erased from database. |
@pedrobaeza The merge process could not be finalized, because command
|
Congratulations, your PR was merged at 002e1b8. Thanks a lot for contributing to OCA. ❤️ |
Currently Knowledge pages are vulnerable to stored XSS attacks. This is because the 'content' field is type Text, so it doesn't receive the default sanitize provided by Html fields.
This PR solves this, changing 'content' field to type Html.