CVE-2018-19787 · mitre
CVE-2018-19787
An issue was discovered in lxml before 4.2.5. lxml/html/clean.py in the lxml.html.clean module does not remove javascript: URLs that use escaping, allowing a remote attacker to conduct XSS attacks, as demonstrated by "j a v a s c r i p t:" in Internet Explorer. This is a similar issue to CVE-2014-3146.
Published 2018-12-02, last changed 2026-06-17. Weakness: CWE-79.
How to fix
Upgrade to a fixed version: lxml 4.2.5 (PyPI). For the version that clears every advisory for your installed version, ask an agent for get_remediation.
Where the flaw is in the code
Fixed in lxml/lxml by 6be1d081b4, 1dee355e83. Functions changed by the fix: _remove_javascript_link, pygments_directive. Regression tests: src/lxml/html/tests/test_clean.txt. Confidence: verified (a record names this commit as the fix, and it changed these functions).
Timeline
| 2018-12-02 | Published |
| 2018-12-02 | Package advisory PYSEC-2018-12 |
| 2022-05-13 | Package advisory GHSA-xp26-p53h-6h2p |
| 2026-06-17 | Record last changed |
| 2026-11-30 | EPSS when our history starts: 2.43% |
| 2026-12-02 | Code-level analysis added |
Affected packages
| Advisory | Package | Fixed in |
|---|---|---|
| GHSA-xp26-p53h-6h2p | lxml (PyPI) | 4.2.5 |
| PYSEC-2018-12 | lxml (PyPI) | 4.2.5 |
Also known as: GHSA-xp26-p53h-6h2p, PYSEC-2018-12
Related
| CVE | Published | CVSS | Summary |
|---|---|---|---|
| CVE-2026-41066 | 2026-04-24 | 7.5 | lxml: Default configuration of iterparse() and ETCompatXMLParser() allows XXE to local files |
| CVE-2022-2309 | 2022-07-05 | 7.5 | NULL Pointer Dereference in lxml/lxml |
| CVE-2021-43818 | 2021-12-13 | 7.1 | HTML Cleaner allows crafted and SVG embedded scripts to pass through |
| CVE-2021-28957 | 2021-03-21 | 6.1 | same package: lxml (PyPI) |
| CVE-2020-27783 | 2020-12-03 | 6.1 | same package: lxml (PyPI) |
| CVE-2014-3146 | 2014-05-14 | 4.3 | same package: lxml (PyPI) |
| CVE-2026-137713 | 2026-11-27 | 6.4 | same weakness (CWE-79) from the same CNA (mitre) |
| CVE-2026-128666 | 2026-11-18 | 6.1 | same weakness (CWE-79) from the same CNA (mitre) |
Add it to your agent
One command for Claude Code; setup for Claude Desktop, Cursor and others. No signup or key.
claude mcp add --transport http keygraph-cve https://cve-mcp.keygraph.io/mcp
Then ask for triage_cve CVE-2018-19787, or call /api/v1/vulnerabilities/CVE-2018-19787. To prove whether it is exploitable in your running app, run Shannon, Keygraph's open-source AI pentester.