Medium
Security advisory
An issue was discovered in markdown2 (aka python-markdown2) through 2.3.5. The safe_mode feature, which is supposed to sanitize user input against XSS, is flawed and does not escape the input properly. With a crafted payload, XSS can be triggered, as demonstrated by omitting the final '>' character from an IMG tag.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2018-5773
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 10:30 UTC · Revision 1
Source evidence
An issue was discovered in markdown2 (aka python-markdown2) through 2.3.5. The safe_mode feature, which is supposed to sanitize user input against XSS, is flawed and does not escape the input properly. With a crafted payload, XSS can be triggered, as demonstrated by omitting the final '>' character from an IMG tag.
osv:CVE-2018-5773
Complete source record
{
"id": "4ee20b1772aa8d4440e99c80fca17af45dc5cd61208022ea8ea122de11e94099",
"url": "https://osv.dev/vulnerability/CVE-2018-5773",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2018-5773",
"summary": "An issue was discovered in markdown2 (aka python-markdown2) through 2.3.5. The safe_mode feature, which is supposed to sanitize user input against XSS, is flawed and does not escape the input properly. With a crafted payload, XSS can be triggered, as demonstrated by omitting the final '>' character from an IMG tag.",
"evidence": "osv:CVE-2018-5773",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2018-5773",
"aliases": [
"CVE-2018-5773",
"GHSA-p6h9-gw49-rqm4",
"PYSEC-2018-13"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/trentm/python-markdown2",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"last_affected": "9be8b9c2801e7f7d07b67e00ff51a15f21c61422"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:python-markdown2_project:python-markdown2:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"last_affected": "2.3.5"
}
],
"source": "CPE_RANGE"
}
]
}
}
],
"versions": [
"2.3.5",
"2.3.4",
"2.3.3",
"2.3.2",
"2.3.1",
"2.3.0",
"2.2.3",
"2.2.2",
"2.2.1",
"2.2.0",
"2.1.0",
"2.0.1",
"2.0.0",
"1.4.2",
"1.4.1",
"1.4.0",
"1.3.1",
"1.3.0",
"1.2.0",
"1.1.1",
"1.1.0",
"1.0.1.19",
"1.0.1.18"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2018-5773.json"
}
}
],
"modified": "2026-10-20T10:50:28.963473553Z",
"provider": "osv",
"references": [
"https://github.com/trentm/python-markdown2/issues/285"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2018-5773",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 381749,
"published_at": "2018-01-18T21:29:00.267+00:00"
}