{"id":"CVE-2024-58340","aliases":["PYSEC-2026-75","WID-SEC-W-2026-0103"],"summary":"LangChain <= 0.3.1 MRKLOutputParser ReDoS","published_at":"2026-01-12T23:05:00.801Z","modified_at":"2026-07-14T22:54:52.807Z","products":[],"rating":{"severity":"high","score":8.7,"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","attack_path":"internet_unauthenticated","user_interaction":false,"malicious":false,"red_hat":"Moderate","vendor_ratings":[{"source":"BSI","rating":"mittel"},{"source":"Red Hat","rating":"Moderate"}]},"fix_available":false,"kev":{"listed":false,"ransomware":false},"public_exploit":false,"exploits":[],"epss":{"score":0.004809999838471413,"percentile":0.4224500060081482,"date":"2026-11-19T00:00:00Z"},"priority":10.7,"details":"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.","affected_stack":[],"affected_other":[{"ecosystem":"CVE","package":"LangChain AI/LangChain","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.3.1"}]}],"provider":"cvelistv5","source":"CVE-2024-58340","relation":"self"},{"ecosystem":"NVD","package":"langchain:langchain","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.3.1"}]}],"provider":"nvd","source":"CVE-2024-58340","relation":"self"},{"ecosystem":"PyPI","package":"langchain-exa","purl":"pkg:pypi/langchain-exa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.0a1"}]}],"versions":["0.0.1","0.1.0","0.2.0","0.2.1","0.3.0","0.3.1"],"fixed":["1.0.0a1"],"provider":"osv","source":"PYSEC-2026-75","relation":"self"}],"product_status":[{"vendor":"BSI","product":"Open Source LangChain <=0.3.1","status":"affected","packages":[],"package_count":0,"fixed":[],"advisories":[],"provider":"csaf-bsi","source":"WID-SEC-W-2026-0103"},{"vendor":"Red Hat","product":"OpenShift Lightspeed","cpe":"cpe:/a:redhat:openshift_lightspeed:1","status":"not_affected","packages":["openshift-lightspeed/lightspeed-service-api-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"not_affected","packages":["ansible-automation-platform-24/de-minimal-rhel8","ansible-automation-platform-24/de-minimal-rhel9","ansible-automation-platform-24/de-supported-rhel8","ansible-automation-platform-24/de-supported-rhel9","ansible-automation-platform-24/ee-dellemc-openmanage-rhel8","ansible-automation-platform-24/ee-minimal-rhel8","ansible-automation-platform-24/ee-minimal-rhel9","ansible-automation-platform-24/ee-supported-rhel8","ansible-automation-platform-24/ee-supported-rhel9","ansible-automation-platform-24/lightspeed-rhel8","ansible-automation-platform-24/platform-resource-runner-rhel8","ansible-automation-platform-25/aap-cloud-metrics-collector-rhel8","ansible-automation-platform-25/ansible-dev-tools-rhel8","ansible-automation-platform-25/de-minimal-rhel8","ansible-automation-platform-25/de-minimal-rhel9","ansible-automation-platform-25/de-supported-rhel8","ansible-automation-platform-25/de-supported-rhel9","ansible-automation-platform-25/ee-cloud-services-rhel9","ansible-automation-platform-25/ee-minimal-rhel8","ansible-automation-platform-25/ee-minimal-rhel9","ansible-automation-platform-25/ee-supported-rhel8","ansible-automation-platform-25/ee-supported-rhel9","ansible-automation-platform-25/lightspeed-chatbot-rhel8","ansible-automation-platform-25/lightspeed-rhel8","ansible-automation-platform-25/platform-resource-runner-rhel8"],"package_count":37,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI (RHEL AI) 3","cpe":"cpe:/a:redhat:enterprise_linux_ai:3","status":"affected","packages":["rhelai3/bootc-cuda-rhel9","rhelai3/disk-image-cuda-rhel9"],"package_count":2,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-trustyai-ragas-lls-provider-dsp-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"not_affected","packages":["rhoai/odh-llama-stack-core-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"}],"records":[{"provider":"cvelistv5","source_id":"CVE-2024-58340","relation":"self","url":"https://www.cve.org/CVERecord?id=CVE-2024-58340","license":"CC-BY-4.0","published_at":"2026-01-12T23:05:00.801Z","modified_at":"2026-07-14T22:54:52.807Z","summary":"LangChain <= 0.3.1 MRKLOutputParser ReDoS","details":"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.","severity":[{"type":"CVSS_V4","score":"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","source":"CVE-2024-58340"}],"affected":[{"ecosystem":"CVE","package":"LangChain AI/LangChain","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.3.1"}]}],"provider":"cvelistv5","source":"CVE-2024-58340","relation":"self"}],"product_status":[],"references":[{"type":"EXPLOIT","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb"},{"type":"WEB","url":"https://www.langchain.com/"},{"type":"WEB","url":"https://github.com/langchain-ai/langchain"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos"}]},{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-0103","relation":"self","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-0103","license":"TLP:CLEAR, mirroring permitted","published_at":"2026-01-13T23:00:00Z","modified_at":"2026-01-13T23:00:00Z","summary":"LangChain (MRKLOutputParser): Schwachstelle ermöglicht Denial of Service","details":"Ein entfernter, anonymer Angreifer kann eine Schwachstelle in LangChain ausnutzen, um einen Denial of Service Angriff durchzuführen.\n\nLangChain ist ein Open-Source-Framework, das die Entwicklung von Anwendungen mit großen Sprachmodellen (LLMs) erleichtert","severity":[{"type":"BSI","score":"mittel","source":"WID-SEC-W-2026-0103"}],"affected":[],"product_status":[{"vendor":"BSI","product":"Open Source LangChain <=0.3.1","status":"affected","packages":[],"package_count":0,"fixed":[],"advisories":[],"provider":"csaf-bsi","source":"WID-SEC-W-2026-0103"}],"references":[{"type":"WEB","url":"https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-0103.json"},{"type":"WEB","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-0103"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2428827"},{"type":"WEB","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb"}]},{"provider":"nvd","source_id":"CVE-2024-58340","relation":"self","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58340","severity":[],"affected":[{"ecosystem":"NVD","package":"langchain:langchain","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"0.3.1"}]}],"provider":"nvd","source":"CVE-2024-58340","relation":"self"}],"product_status":[],"references":[]},{"provider":"osv","source_id":"PYSEC-2026-75","relation":"self","url":"https://osv.dev/vulnerability/PYSEC-2026-75","license":"CC-BY-4.0","published_at":"2026-01-12T23:15:51.78Z","modified_at":"2026-05-20T09:19:04.132922Z","details":"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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","source":"PYSEC-2026-75"}],"affected":[{"ecosystem":"PyPI","package":"langchain-exa","purl":"pkg:pypi/langchain-exa","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.0.0a1"}]}],"versions":["0.0.1","0.1.0","0.2.0","0.2.1","0.3.0","0.3.1"],"fixed":["1.0.0a1"],"provider":"osv","source":"PYSEC-2026-75","relation":"self"}],"product_status":[],"references":[{"type":"WEB","url":"https://www.langchain.com/"},{"type":"ADVISORY","url":"https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos"},{"type":"REPORT","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb"},{"type":"PACKAGE","url":"https://github.com/langchain-ai/langchain"}]},{"provider":"redhat-vex","source_id":"CVE-2024-58340","relation":"self","url":"https://access.redhat.com/security/cve/CVE-2024-58340","license":"CC-BY-4.0","published_at":"2026-01-12T23:05:00.801Z","modified_at":"2026-03-16T08:31:19Z","summary":"langchain: LangChain MRKLOutputParser ReDoS","details":"A regular expression denial of service (redos) flaw has been discovered in LangChain. 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.","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","source":"CVE-2024-58340"},{"type":"Red Hat","score":"Moderate","source":"CVE-2024-58340"}],"affected":[],"product_status":[{"vendor":"Red Hat","product":"OpenShift Lightspeed","cpe":"cpe:/a:redhat:openshift_lightspeed:1","status":"not_affected","packages":["openshift-lightspeed/lightspeed-service-api-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat Ansible Automation Platform 2","cpe":"cpe:/a:redhat:ansible_automation_platform:2","status":"not_affected","packages":["ansible-automation-platform-24/de-minimal-rhel8","ansible-automation-platform-24/de-minimal-rhel9","ansible-automation-platform-24/de-supported-rhel8","ansible-automation-platform-24/de-supported-rhel9","ansible-automation-platform-24/ee-dellemc-openmanage-rhel8","ansible-automation-platform-24/ee-minimal-rhel8","ansible-automation-platform-24/ee-minimal-rhel9","ansible-automation-platform-24/ee-supported-rhel8","ansible-automation-platform-24/ee-supported-rhel9","ansible-automation-platform-24/lightspeed-rhel8","ansible-automation-platform-24/platform-resource-runner-rhel8","ansible-automation-platform-25/aap-cloud-metrics-collector-rhel8","ansible-automation-platform-25/ansible-dev-tools-rhel8","ansible-automation-platform-25/de-minimal-rhel8","ansible-automation-platform-25/de-minimal-rhel9","ansible-automation-platform-25/de-supported-rhel8","ansible-automation-platform-25/de-supported-rhel9","ansible-automation-platform-25/ee-cloud-services-rhel9","ansible-automation-platform-25/ee-minimal-rhel8","ansible-automation-platform-25/ee-minimal-rhel9","ansible-automation-platform-25/ee-supported-rhel8","ansible-automation-platform-25/ee-supported-rhel9","ansible-automation-platform-25/lightspeed-chatbot-rhel8","ansible-automation-platform-25/lightspeed-rhel8","ansible-automation-platform-25/platform-resource-runner-rhel8"],"package_count":37,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat Enterprise Linux AI (RHEL AI) 3","cpe":"cpe:/a:redhat:enterprise_linux_ai:3","status":"affected","packages":["rhelai3/bootc-cuda-rhel9","rhelai3/disk-image-cuda-rhel9"],"package_count":2,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"affected","packages":["rhoai/odh-trustyai-ragas-lls-provider-dsp-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"Will not fix","provider":"redhat-vex","source":"CVE-2024-58340"},{"vendor":"Red Hat","product":"Red Hat OpenShift AI (RHOAI)","cpe":"cpe:/a:redhat:openshift_ai","status":"not_affected","packages":["rhoai/odh-llama-stack-core-rhel9"],"package_count":1,"fixed":[],"advisories":[],"note":"vulnerable_code_not_present","provider":"redhat-vex","source":"CVE-2024-58340"}],"references":[{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-58340.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2024-58340"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2428827"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2024-58340"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58340"},{"type":"WEB","url":"https://github.com/langchain-ai/langchain"},{"type":"WEB","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb"},{"type":"WEB","url":"https://www.langchain.com/"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos"}]}],"references":[{"type":"EXPLOIT","url":"https://huntr.com/bounties/e7ece02c-d4bb-4166-8e08-6baf4f8845bb"},{"type":"WEB","url":"https://www.langchain.com/"},{"type":"WEB","url":"https://github.com/langchain-ai/langchain"},{"type":"WEB","url":"https://www.vulncheck.com/advisories/langchain-mrkloutputparser-redos"},{"type":"WEB","url":"https://wid.cert-bund.de/.well-known/csaf/white/2026/wid-sec-w-2026-0103.json"},{"type":"WEB","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-0103"},{"type":"WEB","url":"https://bugzilla.redhat.com/show_bug.cgi?id=2428827"},{"type":"WEB","url":"https://security.access.redhat.com/data/csaf/v2/vex/2024/cve-2024-58340.json"},{"type":"WEB","url":"https://access.redhat.com/security/cve/CVE-2024-58340"},{"type":"WEB","url":"https://www.cve.org/CVERecord?id=CVE-2024-58340"},{"type":"WEB","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58340"}],"sources":[{"provider":"cvelistv5","source_id":"CVE-2024-58340","url":"https://www.cve.org/CVERecord?id=CVE-2024-58340","license":"CC-BY-4.0","modified_at":"2026-07-14T22:54:52.807Z","relation":"self"},{"provider":"csaf-bsi","source_id":"WID-SEC-W-2026-0103","url":"https://wid.cert-bund.de/portal/wid/securityadvisory?name=WID-SEC-2026-0103","license":"TLP:CLEAR, mirroring permitted","modified_at":"2026-01-13T23:00:00Z","relation":"self"},{"provider":"nvd","source_id":"CVE-2024-58340","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-58340","relation":"self"},{"provider":"osv","source_id":"PYSEC-2026-75","url":"https://osv.dev/vulnerability/PYSEC-2026-75","license":"CC-BY-4.0","modified_at":"2026-05-20T09:19:04.132922Z","relation":"self"},{"provider":"redhat-vex","source_id":"CVE-2024-58340","url":"https://access.redhat.com/security/cve/CVE-2024-58340","license":"CC-BY-4.0","modified_at":"2026-03-16T08:31:19Z","relation":"self"}]}
