{"id":"CVE-2026-121577","kind":"vulnerability","aliases":["CVE-2026-121577"],"related":[],"title":"whatstk: crafted WhatsApp chat export can hang the parser","description":"Inefficient Regular Expression Complexity (CWE-1333) in generate_regex() (whatstk/whatsapp/parser.py) in whatstk from 0.2.0 before 0.9.0 allows a party that supplies a chat export to consume the CPU of the process that parses it for an unbounded time, because the function builds the header regular expression by replacing each %x code with its named capture group and leaves every other character of the header format in the pattern unescaped. A header whose date separator is a regular expression metacharacter therefore alters the pattern instead of matching itself: a separator of + quantifies the preceding capture group, giving (?P<day>\\d{1,2})+(?P<month>\\d{1,2})+(?P<year>\\d{2,4}), and a run of digits that cannot complete the header then makes the engine try every way of partitioning that run. Header auto detection is enabled by default and derives the format from the text of the file, so the separator is taken from the export itself and no header format has to be passed by the caller. Separators of (, ) and \\ instead raise re.PatternError, separators of *, | and ? raise TypeError, and separators of ^ and $ raise KeyError, none of which the library catches. This results in the parse of a file of a few hundred bytes consuming CPU without completing, or in an uncaught exception in the calling program.","summary":"whatstk is a Python library that parses WhatsApp chat exports. A crafted export with a regex metacharacter in its date separator makes the header regular expression catastrophically backtrack, so parsing consumes CPU without finishing, and some separators raise uncaught exceptions that can crash the calling program.","severity":"medium","cvss":6.7,"epss":null,"exploited":false,"exploited_at":null,"products":[],"ecosystems":[],"tags":["package","python","whatsapp-parsing","whatstk"],"not_affected_if":["explicit-header-format","no-untrusted-exports","version-0.9.0-or-later"],"how_to_check":"- Check the installed version with `pip show whatstk` or the `version` in your `pyproject.toml`/`requirements.txt`; affected range is `0.2.0` up to but not including `0.9.0`.\n- Search your code for calls to whatstk's parser on user-supplied chat exports (for example `whatstk.whatsapp.parser`).","fix":"- whatstk: `0.9.0`","status":"open","published_at":"2026-11-03T20:18:13+00:00","first_seen_at":"2026-11-03T20:49:22+00:00","triaged_at":"2026-11-03T20:50:25+00:00","updated_at":"2026-11-03T20:50:25+00:00","category":"package","confidence":0.7,"triage":{"at":"2026-11-03T20:50:25Z","model":"claude-haiku-5-5","output":{"fix":"- whatstk: `0.9.0`","reach":"unknown","title":"whatstk: crafted WhatsApp chat export can hang the parser","impact":"low","summary":"whatstk is a Python library that parses WhatsApp chat exports. A crafted export with a regex metacharacter in its date separator makes the header regular expression catastrophically backtrack, so parsing consumes CPU without finishing, and some separators raise uncaught exceptions that can crash the calling program.","audience":"developers","category":"package","nicknames":[],"who_cares":["python","whatstk","whatsapp-parsing"],"confidence":0.7,"fix_status":"available","needs_auth":"no","worst_case":"Parser process hangs on CPU or crashes with an uncaught exception","analyst_note":"","how_to_check":"- Check the installed version with `pip show whatstk` or the `version` in your `pyproject.toml`/`requirements.txt`; affected range is `0.2.0` up to but not including `0.9.0`.\n- Search your code for calls to whatstk's parser on user-supplied chat exports (for example `whatstk.whatsapp.parser`).","plain_action":"","needs_analyst":false,"not_affected_if":["version-0.9.0-or-later","no-untrusted-exports","explicit-header-format"],"who_is_affected":"Only programs that parse WhatsApp chat exports supplied by someone else with whatstk from 0.2.0 before 0.9.0, with header auto detection on (the default). The separator is read from the file itself, so an attacker only needs to supply an export file; no account or special setup is described.","user_interaction":"no","needs_special_setup":"no","severity_if_unknown":"unknown"},"cost_usd":0.000744,"input_tokens":4496,"output_tokens":588,"severity_before":"medium"},"analyst_status":null,"analyst_note":null,"search":"'-121577':12A,15A '-1333':73C '-2026':11A,14A '0.2.0':81C '0.9.0':83C '1':166C,170C '2':167C,171C,174C '4':175C 'allow':84C 'alter':148C 'auto':198C 'backtrack':49B 'build':109C 'byte':269C 'call':66B,281C 'caller':233C 'cannot':182C 'captur':122C,161C 'catastroph':48B 'catch':256C 'charact':128C 'chat':4A,30B,90C 'code':118C 'complet':183C,273C 'complex':71C 'consum':52B,93C,270C 'cpu':53B,95C,271C 'craft':2A,33B 'crash':64B 'cve':10A,13A 'cwe':72C 'd':165C,169C,173C 'date':41B,140C 'default':203C 'deriv':205C 'detect':199C 'digit':180C 'enabl':201C 'engin':189C 'everi':126C,191C 'except':61B,278C 'export':5A,31B,34B,91C,221C 'express':47B,70C,113C,145C 'file':213C,264C 'finish':55B 'format':132C,207C,226C 'function':108C 'generat':75C 'give':163C 'group':123C,162C 'hang':7A 'header':45B,111C,131C,138C,185C,197C,225C 'hundr':268C 'ineffici':68C 'instead':151C,237C 'keyerror':250C 'leav':125C 'librari':26B,255C 'make':43B,187C 'match':153C 'metacharact':38B,146C 'name':121C 'none':251C 'p':164C,168C,172C 'packag':16B 'pars':20B,28B,51B,100C,261C 'parser':9A 'parti':86C 'partit':194C 'pass':230C 'pattern':135C,150C 'preced':160C 'process':98C 'program':67B,282C 'python':17B,25B 'quantifi':158C 'rais':59B,238C,243C,249C 're.patternerror':239C 'regex':37B,76C 'regular':46B,69C,112C,144C 'replac':115C 'result':258C 'run':178C,196C 'separ':42B,58B,141C,156C,216C,234C,240C,246C 'suppli':88C 'taken':218C 'text':210C 'therefor':147C 'time':105C 'tri':190C 'typeerror':244C 'unbound':104C 'uncaught':60B,277C 'unescap':136C 'way':192C 'whatsapp':3A,19B,29B 'whatsapp-pars':18B 'whatstk':1A,21B,22B,79C 'whatstk/whatsapp/parser.py':77C 'whose':139C 'without':54B,272C 'x':117C","nicknames":[],"mitigations":[],"who_affected":"Only programs that parse WhatsApp chat exports supplied by someone else with whatstk from 0.2.0 before 0.9.0, with header auto detection on (the default). The separator is read from the file itself, so an attacker only needs to supply an export file; no account or special setup is described.","tier":"C","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"developers","plain_action":null,"pkeys":[],"ptokens":[],"labels":["medium","package","python","whatsappparsing","whatstk"],"campaign_type":null,"first_public_at":"2026-11-03T20:18:13+00:00","kev":null,"cvss_vector":"CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X","cvss_by":"4daa8cea-433a-44bd-9456-53b127fc289a","poc_count":0,"sources":[{"source":"nvd","external_id":"CVE-2026-121577","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-121577","severity":null,"published_at":"2026-11-03T20:18:13+00:00","modified_at":"2026-11-03T20:18:13+00:00","first_seen_at":"2026-11-03T20:49:22+00:00","fetched_at":"2026-11-03T20:49:22+00:00","note":null}],"documents":[{"id":58866,"url":"https://github.com/lucasrodes/whatstk/commit/01d66d8","title":"Patch: github.com","kind":"other","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Patch: github.com"},{"id":58867,"url":"https://github.com/lucasrodes/whatstk/releases/tag/v0.9.0","title":"Release notes: github.com","kind":"release","source":"nvd","publisher":"vendor","text":null,"published_at":null,"relation":"fix","confidence":null,"note":"Release notes: github.com"}],"notice":"Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai"}