trentm/python-markdown2 · Security
markdown2 is vulnerable to cross-site scripting
- GHSA ID
- GHSA-p6h9-gw49-rqm4
- CVE ID
- CVE-2018-5773
- Severity
- medium
- Published
- Updated
- CVSS
- 6.1 · CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CVSS v3
- 6.1 · CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
- CVSS v4
- 5.3 · 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
Description
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.
CWEs
- CWE-79 · Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
References
- https://nvd.nist.gov/vuln/detail/CVE-2018-5773 ↗
- https://github.com/trentm/python-markdown2/issues/285 ↗
- https://github.com/advisories/GHSA-p6h9-gw49-rqm4 ↗
- https://github.com/google/osv/issues/430 ↗
- https://github.com/trentm/python-markdown2/pull/303 ↗
- https://github.com/trentm/python-markdown2/blob/master/CHANGES.md#python-markdown2-236 ↗
- https://github.com/trentm/python-markdown2/commit/1b1dcdd727c0ef03453b9f5ef5ae3679f1d72323 ↗
- https://github.com/pypa/advisory-database/tree/main/vulns/markdown2/PYSEC-2018-13.yaml ↗