VYPR
Medium severity6.3OSV Advisory· Published Oct 29, 2025· Updated Apr 15, 2026

CVE-2025-54384

CVE-2025-54384

Description

CKAN is an open-source DMS (data management system) for powering data hubs and data portals. Prior to 2.10.9 and 2.11.4, the helpers.markdown_extract() function did not perform sufficient sanitization of input data before wrapping in an HTML literal element. This helper is used to render user-provided data on dataset, resource, organization or group pages (plus any page provided by an extension that used that helper function), leading to a potential XSS vector. This vulnerability has been fixed in CKAN 2.10.9 and 2.11.4.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
ckanPyPI
>= 2.11.0, < 2.11.42.11.4
ckanPyPI
< 2.10.92.10.9

Affected products

1
  • Range: ckan-1.3.3b, ckan-1.4.3, ckan-1.5, …

Patches

4
882f16b6de85
466f516528a7
6d0065f2fc7e

Merge commit from fork

https://github.com/ckan/ckanAdrià MercaderOct 29, 2025via ghsa
2 files changed · +6 11
  • ckan/lib/helpers.py+1 6 modified
    @@ -1331,7 +1331,7 @@ def markdown_extract(text: str,
         will not be truncated.'''
         if not text:
             return ''
    -    plain = RE_MD_HTML_TAGS.sub('', markdown(text))
    +    plain = bleach_clean(markdown(text), strip=True)
         if not extract_length or len(plain) < extract_length:
             return literal(plain)
         return literal(
    @@ -2133,10 +2133,6 @@ def get_request_param(parameter_name: str,
         flags=re.UNICODE
     )
     
    -# find all tags but ignore < in the strings so that we can use it correctly
    -# in markdown
    -RE_MD_HTML_TAGS = re.compile('<[^><]*>')
    -
     
     @core_helper
     def html_auto_link(data: str) -> str:
    @@ -2196,7 +2192,6 @@ def render_markdown(data: str,
         if allow_html:
             data = markdown(data.strip())
         else:
    -        data = RE_MD_HTML_TAGS.sub('', data.strip())
             data = bleach_clean(
                 markdown(data), strip=True,
                 tags=MARKDOWN_TAGS,
    
  • ckan/tests/lib/test_helpers.py+5 5 modified
    @@ -260,8 +260,8 @@ class TestHelpersRenderMarkdown(object):
         @pytest.mark.parametrize(
             "data,output,allow_html",
             [
    -            ("<h1>moo</h1>", "<h1>moo</h1>", True),
    -            ("<h1>moo</h1>", "<p>moo</p>", False),
    +            ("<script>moo</script>", "<script>moo</script>", True),
    +            ("<script>moo</script>", "moo", False),
                 (
                     "http://example.com",
                     '<p><a href="http://example.com" target="_blank" rel="nofollow">http://example.com</a></p>',
    @@ -285,7 +285,7 @@ class TestHelpersRenderMarkdown(object):
                 (u"[text](javascript: alert(1))", u"<p><a>text</a></p>", False),
                 (
                     u'<p onclick="some.script"><img onmouseover="some.script" src="image.png" /> and text</p>',
    -                u"<p>and text</p>",
    +                '<p><img src="image.png"> and text</p>',
                     False,
                 ),
                 (u"#heading", u"<h1>heading</h1>", False),
    @@ -381,8 +381,8 @@ class TestHelpersRenderMarkdown(object):
                     False,
                 ),
                 (
    -                u"<a href=\u201dsomelink\u201d>somelink</a>",
    -                "<p>somelink</p>",
    +                "<a href=\u201dsomelink\u201d>somelink</a>",
    +                '<p><a href="\u201dsomelink\u201d">somelink</a></p>',
                     False,
                 ),
             ],
    
112affffa74b

helpers: strip tags with bleach only

https://github.com/ckan/ckanIan WardOct 9, 2025via ghsa
1 file changed · +1 6
  • ckan/lib/helpers.py+1 6 modified
    @@ -1331,7 +1331,7 @@ def markdown_extract(text: str,
         will not be truncated.'''
         if not text:
             return ''
    -    plain = RE_MD_HTML_TAGS.sub('', markdown(text))
    +    plain = bleach_clean(markdown(text), strip=True)
         if not extract_length or len(plain) < extract_length:
             return literal(plain)
         return literal(
    @@ -2133,10 +2133,6 @@ def get_request_param(parameter_name: str,
         flags=re.UNICODE
     )
     
    -# find all tags but ignore < in the strings so that we can use it correctly
    -# in markdown
    -RE_MD_HTML_TAGS = re.compile('<[^><]*>')
    -
     
     @core_helper
     def html_auto_link(data: str) -> str:
    @@ -2196,7 +2192,6 @@ def render_markdown(data: str,
         if allow_html:
             data = markdown(data.strip())
         else:
    -        data = RE_MD_HTML_TAGS.sub('', data.strip())
             data = bleach_clean(
                 markdown(data), strip=True,
                 tags=MARKDOWN_TAGS,
    

Vulnerability mechanics

Generated by null/stub on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

7

News mentions

0

No linked articles in our index yet.