Wysoka

Improper validation of URLs ('Cross-site Scripting') in Wagtail rich text fields

  • Ujawniono: 19.04.2021
  • Aktualizacja: 11.10.2026 15:17

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:

python
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


def link_entity(props):
    id_ = props.get('id')
    link_props = {}

    if id_ is not None:
        link_props['linktype'] = 'page'
        link_props['id'] = id_
    else:
        link_props['href'] = check_url(props.get('url'))

    return DOM.create_element('a', link_props, props['children'])


@hooks.register('register_rich_text_features', order=1)
def register_link(features):
    features.register_converter_rule('contentstate', 'link', {
        'from_database_format': {
            'a[href]': ExternalLinkElementHandler('LINK'),
            'a[linktype="page"]': PageLinkElementHandler('LINK'),
        },
        'to_database_format': {
            'entity_decorators': {'LINK': link_entity}
        }
    })

Acknowledgements

Many thanks to Kevin Breen for reporting this issue.

For more information

If you have any questions or comments about this advisory:

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Python (PyPI) wagtail < 2.11.7, >= 2.12, < 2.12.4 2.11.7, 2.12.4

Odnośniki

Ocena CVSS 6.1/10
Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:U/C:H/I:H/A:N
Słabość (CWE)
CWE-79
Platforma
Python (PyPI)
Paczka
wagtail
Ujawniono
19.04.2021
Aktualizacja
11.10.2026 15:17

Źródła i licencje

OSV / GitHub Advisory Database - PYSEC-2021-114 - PyPA Advisory Database; CC BY 4.0

OSV / GitHub Advisory Database - GHSA-wq5h-f9p5-q7fx - CC BY 4.0

Historia podatności: wagtail

Wszystkie opisane podatności tej paczki (Python (PyPI)), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (30) w archiwum
Wszystkich wpisów
30
Pierwsza → ostatnia
04.2020 08.2026
Bez poprawki
0
Wykorzystywana w atakach
0

Rozkład istotności

  • Wysoka 5
  • Średnia 22
  • Niska 3

Ujawnienia w latach

  1. 2020: 3
  2. 2021: 2
  3. 2022: 1
  4. 2023: 3
  5. 2024: 3
  6. 2025: 0
  7. 2026: 18
Istotność:
  1. Wysoka · 7.3 CVE-2026-54263 >= 7.3, < 7.3.3, >= 7.4, < 7.4.2 7.3.3, 7.4.2
  2. Wysoka · 6.5 CVE-2024-39317 >= 6.0, < 6.0.6, >= 6.1, < 6.1.3, >= 2.0, < 5.2.6 6.0.6, 6.1.3, 5.2.6
  3. Wysoka · 6.4 CVE-2023-28836 >= 1.5, < 4.1.4, >= 4.2, < 4.2.2 4.1.4, 4.2.2
  4. Improper validation of URLs ('Cross-site Scripting') in Wagtail rich text fields ten wpis
    Wysoka · 6.1 CVE-2021-29434 < 2.11.7, >= 2.12, < 2.12.4 2.11.7, 2.12.4
  5. Wysoka · 5.7 CVE-2020-15118 >= 2.8rc1, < 2.9.3, < 2.7.4 2.9.3, 2.7.4

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.