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.
| Package | Affected versions | Patched versions |
|---|---|---|
ckanPyPI | >= 2.11.0, < 2.11.4 | 2.11.4 |
ckanPyPI | < 2.10.9 | 2.10.9 |
Affected products
1Patches
4882f16b6de85466f516528a72 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, ), ],
112affffa74bhelpers: strip tags with bleach only
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- github.com/advisories/GHSA-2r4h-8jxv-w2j8ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2025-54384ghsaADVISORY
- github.com/ckan/ckan/commit/112affffa74b14fc97c54abcf18315df97114917ghsaWEB
- github.com/ckan/ckan/commit/6d0065f2fc7e2682196d125275af34b93e9e554envdWEB
- github.com/ckan/ckan/releases/tag/ckan-2.10.9ghsaWEB
- github.com/ckan/ckan/releases/tag/ckan-2.11.4ghsaWEB
- github.com/ckan/ckan/security/advisories/GHSA-2r4h-8jxv-w2j8nvdWEB
News mentions
0No linked articles in our index yet.