Improper validation of URLs ('Cross-site Scripting') in Wagtail rich text fields
Impact
When saving the contents of a rich text field in the admin interface, Wagtail does not apply server-side checks to ensure that link URLs use a valid protocol. A malicious user with access to the admin interface could thus craft a POST request to publish content with javascript: URLs containing arbitrary code. The vulnerability is not exploitable by an ordinary site visitor without access to the Wagtail admin.
Patches
Patched versions have been released as Wagtail 2.11.7 (for the LTS 2.11 branch) and Wagtail 2.12.4 (for the current 2.12 branch).
Workarounds
For sites that cannot easily upgrade to a current supported version, the vulnerability can be patched by adding the following code to a wagtail_hooks.py module in any installed app:
from draftjs_exporter.dom import DOM
from wagtail.admin.rich_text.converters.html_to_contentstate import ExternalLinkElementHandler, PageLinkElementHandler
from wagtail.core import hooks
from wagtail.core.whitelist import check_url
* Fix: Un-pin django-treebeard following upstream fix for migration issue (Matt Westcott)
* Fix: Prevent crash when copying an alias page (Karl Hobley)
* Fix: Prevent errors on page editing after changing LANGUAGE_CODE (Matt Westcott)
* Fix: Correctly handle model inheritance and `ClusterableModel` on `copy_for_translation` (Karl Hobley)
2.11.5 (18.02.2021)
Fix: Pin django-treebeard to <4.5 to prevent migration conflicts (Matt Westcott)
2.11.4 (16.02.2021)
* Fix: Prevent delete button showing on collection / workflow edit views when delete permission is absent (Helder Correia)
* Fix: Ensure aliases are published when the source page is published (Karl Hobley)
* Fix: Make page privacy rules apply to aliases (Karl Hobley)
2.11.3 (10.12.2020)
Fix: Updated project template migrations to ensure that initial homepage creation runs before addition of locale field (Dan Braghis)
Fix: Restore ability to use translatable strings in LANGUAGES / WAGTAIL_CONTENT_LANGUAGES settings (Andreas Morgenstern)
Fix: Allow locale / translation_of API filters to be used in combination with search (Matt Westcott)
Fix: Prevent error on create_log_entries_from_revisions when checking publish state on a revision that cannot be restored (Kristin Riebe)
2.11.2 (17.11.2020)
* Add custom finder to support Instagram oEmbed API (Luis Nell)
* Add custom finder to support Facebook oEmbed API (Cynthia Kiser)
* Fix: Improve performance of permission check on translations for edit page (Karl Hobley)
* Fix: Gracefully handle missing Locale records on `Locale.get_active` and `.localized` (Matt Westcott)
* Fix: Handle `get_supported_language_variant` returning a language variant not in `LANGUAGES` (Matt Westcott)
* Fix: Reinstate missing icon on settings edit view (Jérôme Lebleu)
* Fix: Avoid performance and pagination logic issues with a large number of languages (Karl Hobley)
* Fix: Allow deleting the default locale (Matt Westcott)
2.11.1 (06.11.2020)
Fix: Ensure that cached wagtail_site_root_paths structures from older Wagtail versions are invalidated (Sævar Öfjörð Magnússon)
Fix: Avoid circular import between wagtail.admin.auth and custom user models (Matt Westcott)
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language
- `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme
Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com):
- Update frequency (including time of day and day of week)
- Pull request limits (per update run and/or open at any time)
- Out-of-range updates (receive only lockfile updates, if desired)
- Security updates (receive only security updates, if desired)
Bumps wagtail from 2.10 to 2.11.6. This update includes a security fix.
Vulnerabilities fixed
Sourced from The GitHub Security Advisory Database.
... (truncated)
Release notes
Sourced from wagtail's releases.
... (truncated)
Changelog
Sourced from wagtail's changelog.
... (truncated)
Commits
4ddfb48
Fill in release date for 2.11.6a67d129
Version bump to 2.11.61a40d97
Fix migration dependency in i18n test migrationcb0c643
Fix copy_for_translation on inherited and clusterable models2d66f49
Release note for #6818 in 2.11.6f374ebd
Release note for #6872 in 2.11.64344d82
Prevent error on page editing after changing LANGUAGE_CODE6e20cec
Release note for #6871 in 2.11.668e9d49
Unpin django-treebeard - allow all up to 5.092bd561
Release note for #6854 in 2.11.6Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) - `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language - `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language - `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language - `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language - `@dependabot badge me` will comment on this PR with code to add a "Dependabot enabled" badge to your readme Additionally, you can set the following in your Dependabot [dashboard](https://app.dependabot.com): - Update frequency (including time of day and day of week) - Pull request limits (per update run and/or open at any time) - Out-of-range updates (receive only lockfile updates, if desired) - Security updates (receive only security updates, if desired)