CVE-2018-5773
MEDIUM 6.1CVSS 3.0markdown2 is vulnerable to cross-site scripting
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.
- Published
- 18 Jan 2018
- Last modified
- 17 Jun 2026
- Assigned by
- cve@mitre.org
- NVD status
- Modified
- Weakness
- CWE-79
- Also known as
- GHSA-p6h9-gw49-rqm4PYSEC-2018-13
- Sources
- NVDJSONOSV GHSA-p6h9-gw49-rqm4JSONOSV PYSEC-2018-13JSON
Scores
| Source | Scored by | Version | Score | Vector / decision |
|---|---|---|---|---|
| OSV | GitHub | CVSS 4.0 | CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N | |
| NVD | nvd@nist.gov (Primary) | CVSS 3.0 | MEDIUM 6.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| OSV | GitHub | CVSS 3.0 | MEDIUM 6.1 | CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | nvd@nist.gov (Primary) | CVSS 2.0 | MEDIUM 4.3 | AV:N/AC:M/Au:N/C:N/I:P/A:N |
Affected
| Source | Vendor / ecosystem | Product / package | Affected versions | Fixed in |
|---|---|---|---|---|
| NVD | python-markdown2_project | python-markdown2cpe:2.3:a:python-markdown2_project:python-markdown2:*:*:*:*:*:*:*:* |
<= 2.3.5 | |
| OSV | PyPI | markdown2 | < 2.3.6 | 2.3.6 |
References
- https://github.com/trentm/python-markdown2/issues/285 · Third Party Advisory, WEB, REPORT
- https://nvd.nist.gov/vuln/detail/CVE-2018-5773 · ADVISORY
- https://github.com/google/osv/issues/430 · WEB
- https://github.com/trentm/python-markdown2/pull/303 · WEB
- https://github.com/trentm/python-markdown2/commit/1b1dcdd727c0ef03453b9f5ef5ae3679f1d72323 · WEB
- https://github.com/advisories/GHSA-p6h9-gw49-rqm4 · ADVISORY
- https://github.com/pypa/advisory-database/tree/main/vulns/markdown2/PYSEC-2018-13.yaml · WEB
- https://github.com/trentm/python-markdown2 · PACKAGE
- https://github.com/trentm/python-markdown2/blob/master/CHANGES.md#python-markdown2-236 · WEB
History
- 25 Nov 2026 20:20 UTC · NVD: first stored (published 18 Jan 2018)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 18 Jan 2018)
- 25 Nov 2026 20:12 UTC · OSV: first stored (published 12 Jul 2018)