Advisory Database
  • Advisories
  • Dependency Scanning
  1. pypi
  2. ›
  3. soupsieve
  4. ›
  5. CVE-2026-49477

CVE-2026-49477: Soup Sieve: Regular Expression Denial of Service (ReDoS) via Selector Parser

July 9, 2026

The CSS selector parser in soupsieve (the CSS selector engine for Beautiful Soup 4) contains a regular expression vulnerable to catastrophic backtracking. When processing an attribute selector with an unterminated quoted value, the VALUE regex pattern in css_parser.py enters exponential backtracking. A payload of only 300 bytes causes the regex engine to hang for over 3 seconds, enabling a trivial Regular Expression Denial of Service (ReDoS) attack.

To be completely transparent, AI tools helped surface this issue. However, this was independently reproduced and carefully validated.

Any application that passes untrusted CSS selector strings to soupsieve.compile() or Beautiful Soup’s .select() / .select_one() is affected.

References

  • github.com/advisories/GHSA-836r-79rf-4m37
  • github.com/facelessuser/soupsieve/security/advisories/GHSA-836r-79rf-4m37
  • nvd.nist.gov/vuln/detail/CVE-2026-49477

Code Behaviors & Features

Detect and mitigate CVE-2026-49477 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 2.8.4

Fixed versions

  • 2.8.4

Solution

Upgrade to version 2.8.4 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Learn more about CVSS

Weakness

  • CWE-1333: Inefficient Regular Expression Complexity
  • CWE-400: Uncontrolled Resource Consumption

Source file

pypi/soupsieve/CVE-2026-49477.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Sat, 08 Aug 2026 00:18:10 +0000.