{"schemaVersion":3,"id":"CVE-2024-58340","aliases":["PYSEC-2026-75"],"status":"published","duplicateOf":null,"title":null,"description":"LangChain versions up to and including 0.3.1 contain a regular expression denial-of-service (ReDoS) vulnerability in the MRKLOutputParser.parse() method (libs/langchain/langchain/agents/mrkl/output_parser.py). The parser applies a backtracking-prone regular expression when extracting tool actions from model output. An attacker who can supply or influence the parsed text (for example via prompt injection in downstream applications that pass LLM output directly into MRKLOutputParser.parse()) can trigger excessive CPU consumption by providing a crafted payload, causing significant parsing delays and a denial-of-service condition.","dates":{"published":"2026-01-12T23:05:00.801Z","modified":"2026-07-14T22:54:52.807Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":8.7,"severity":"high","version":"4.0","versionLabel":"v4.0","source":"CVE.org","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","computed":false,"selection":"backend-summary"},"metrics":[{"version":"4.0","versionLabel":"v4.0","source":"CVE.org","score":8.7,"severity":"high","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"OSV · Pypi","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":10,"impact":6,"computed":true},{"version":"4.0","versionLabel":"v4.0","source":"NVD","score":8.7,"severity":"high","vector":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/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","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.5,"severity":"high","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00481,"percentile":0.40134,"severity":"low","asOf":"2026-10-19T00:00:00.000Z","change":{"pp":0.010999999999999985,"baselineDate":"2026-09-19T00:00:00.000Z","baselineScore":0.0047},"history":[{"date":"2026-09-14T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-15T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-16T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-17T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-18T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-19T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00481,"percentile":0.40134}],"last30":[{"date":"2026-09-19T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-20T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-21T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-22T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-23T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-24T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-25T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-26T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-27T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-28T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-29T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-09-30T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-01T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-02T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-03T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-04T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-05T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-06T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-07T00:00:00.000Z","score":0.0047,"percentile":null},{"date":"2026-10-08T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-09T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-10T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-11T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-12T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-13T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-14T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-15T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-16T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-17T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-18T00:00:00.000Z","score":0.00481,"percentile":null},{"date":"2026-10-19T00:00:00.000Z","score":0.00481,"percentile":0.40134}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[{"id":"REF_00F5A11F8B4041D0","name":"Exploit Reference (huntr.com)","source":"reference","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb","maturity":"unknown","reliabilityScore":0.2,"verified":false,"type":null,"platforms":[],"requiresAuth":null,"exploitdb":null,"metasploit":null}],"exploitCount":1,"weaknesses":[{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity","description":"The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.","type":"weakness","status":"Draft","abstraction":"Base","likelihoodOfExploit":"High","url":"https://cwe.mitre.org/data/definitions/1333.html"}],"affected":[{"vendor":"langchain ai","product":"langchain","name":"LangChain","label":"langchain","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 0.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 0.3.1","eol":null,"hubHref":"/vendor/langchain_ai/langchain"},{"vendor":"langchain","product":"langchain","name":"langchain","label":"langchain","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≤ 0.3.1","noFixRecorded":false,"fixedIn":null}],"versionsText":"≤ 0.3.1","eol":null,"hubHref":"/vendor/langchain/langchain"},{"vendor":"PyPI","product":"langchain-exa","name":"langchain-exa","label":"langchain-exa","ecosystem":"PyPI","cpePart":null,"purl":"pkg:pypi/langchain-exa","purlType":"pypi","versions":[{"text":"< 1.0.0a1","noFixRecorded":false,"fixedIn":null}],"versionsText":"< 1.0.0a1","eol":null,"hubHref":null}],"affectedCount":3,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb","label":"huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb","hostname":"huntr.com","tags":["Technical Description","Exploit","REPORT","Issue Tracking","Third Party Advisory"]},{"url":"https://www.langchain.com/","label":"www.langchain.com","hostname":"www.langchain.com","tags":["Product","WEB"]},{"url":"https://github.com/langchain-ai/langchain","label":"github.com/langchain-ai/langchain","hostname":"github.com","tags":["Product","PACKAGE"]},{"url":"https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos","label":"www.vulncheck.com/advisories/langchain-mrkloutputparser-redos","hostname":"www.vulncheck.com","tags":["Third Party Advisory","Advisory"]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2026-01-12T23:05:00.801Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-07-14T22:54:52.807Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"risk":{"score":45,"level":"medium","profile":"Default","thresholds":{"critical":75,"high":50,"medium":25,"low":10}},"meta":{"dataAsOf":"2026-10-20T06:07:52.442Z","stale":false,"partial":false}}