{"id":"CVE-2026-42048","kind":"vulnerability","aliases":["CVE-2026-42048","GHSA-9whx-c884-c68q"],"related":[],"title":"Langflow Knowledge Bases API is Vulnerable to Path Traversal","description":"## Summary\nLangflow is vulnerable to Path Traversal in the Knowledge Bases API (`DELETE /api/v1/knowledge_bases`). This occurs because user-supplied knowledge base names are concatenated directly into file paths without proper sanitization or boundary validation. An authenticated attacker can exploit this flaw to delete arbitrary directories anywhere on the server's filesystem, leading to data loss and potential service disruption.\n\n## Details\nThe vulnerability exists in the `delete_knowledge_bases_bulk` function within `src/backend/base/langflow/api/v1/knowledge_bases.py`. \n\nThis function constructs file paths directly from the user-supplied `kb_names` parameter. While other knowledge base endpoints safely route through standard path resolution (e.g., `_resolve_kb_path()`), the bulk delete handler bypasses this entirely. It builds the path manually and passes it directly to `shutil.rmtree()` without validating if the resulting path resolves outside the intended user directory.\n\n## PoC (Proof of Concept)\nFor the **Bulk Delete** endpoint, an authenticated attacker can supply a traversal sequence in the `kb_names` parameter:\n`../victim_user/kb_name`\n\nBecause the path is passed directly to `shutil.rmtree()` without containment checks, this payload deletes directories outside the intended scope.\n\n## Impact\nAny Langflow instance exposing this endpoint to authenticated users is vulnerable. This exposes the server to:\n* **Cross-user data compromise:** Deletion of directories within another tenant's knowledge base space.\n* **Arbitrary filesystem manipulation:** Directory deletion at any path on the server where the application has write permissions.\n* **Service disruption & Data Loss:** Deletion of critical application files or unrecoverable data loss if backups are co-located on the same filesystem.\n\n## Fixes\nThe issue was addressed in **PR #12243**, which applies `Path.resolve()` to normalize the supplied path and validates that it starts with the authenticated user's directory before deletion. Subsequent updates (backported from PR #12337) introduced robust containment checks using `Path.is_relative_to()` to prevent prefix-ambiguity bugs.\n\n## Acknowledgements\nThanks to the security researchers who responsibly disclosed this vulnerability:\n* @ddlxstudio\n* @nekros1xx","summary":"Langflow's bulk delete endpoint for Knowledge Bases builds file paths from user-supplied names without checking them, so path traversal sequences are accepted. An authenticated attacker can make the server call a recursive delete on arbitrary directories, including other users' knowledge bases.","severity":"critical","cvss":9.6,"epss":0.04195,"exploited":false,"exploited_at":null,"products":[{"name":"langflow","fixed":["1.9.0"],"affected":"<= 1.8.4","ecosystem":"pypi"},{"name":"langflow","fixed":["1.9.0"],"affected":"< 1.9.0","ecosystem":"vendor"},{"via":"cpe","name":"langflow","fixed":["1.9.0"],"affected":"< 1.9.0","ecosystem":"pypi"}],"ecosystems":["pypi","vendor"],"tags":["ai-apps","ai-tooling","cwe-22","langflow","python","self-hosted"],"not_affected_if":["langflow-1.9.0-or-later","no-multi-user-access"],"how_to_check":"- Check the installed version with `pip show langflow`; versions `1.8.4` and earlier are affected.\n- Check whether the Knowledge Bases API is reachable by users who hold accounts on your instance.","fix":"- `langflow` upgrade to `1.9.0` or later (fixed in PR #12243, with containment checks backported from PR #12337).","status":"open","published_at":"2026-05-05T18:28:59+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","triaged_at":"2026-11-16T15:19:20+00:00","updated_at":"2026-11-16T15:37:59+00:00","category":"ai-tooling","confidence":0.85,"triage":{"at":"2026-11-16T15:19:20Z","model":"claude-haiku-5-5","output":{"fix":"- `langflow` upgrade to `1.9.0` or later (fixed in PR #12243, with containment checks backported from PR #12337).","reach":"internet","title":"Langflow: authenticated users can delete directories anywhere on server","impact":"high","summary":"Langflow's bulk delete endpoint for Knowledge Bases builds file paths from user-supplied names without checking them, so path traversal sequences are accepted. An authenticated attacker can make the server call a recursive delete on arbitrary directories, including other users' knowledge bases.","audience":"businesses","category":"ai-tooling","nicknames":[],"who_cares":["langflow","python","self-hosted","ai-apps"],"confidence":0.85,"fix_status":"available","needs_auth":"yes","worst_case":"Attacker deletes arbitrary server directories, causing data loss and service disruption","analyst_note":"","how_to_check":"- Check the installed version with `pip show langflow`; versions `1.8.4` and earlier are affected.\n- Check whether the Knowledge Bases API is reachable by users who hold accounts on your instance.","plain_action":"","product_name":"","needs_analyst":false,"not_affected_if":["no-multi-user-access","langflow-1.9.0-or-later"],"who_is_affected":"Any Langflow instance that exposes the Knowledge Bases API to authenticated users is exposed through the bulk delete endpoint (DELETE /api/v1/knowledge_bases). Instances where only trusted operators can log in, or that do not run Langflow, can skip it.","user_interaction":"no","product_ecosystem":"","needs_special_setup":"unknown","severity_if_unknown":"critical"},"cost_usd":0.000819,"input_tokens":5336,"output_tokens":570,"severity_before":"critical"},"analyst_status":null,"analyst_note":null,"search":"'-2026':11A,19A '-22':31B '-42048':12A,20A '/api/v1/knowledge_bases':94C '/victim_user/kb_name':235C '12243':334C '12337':361C '9whx':15A 'accept':61B 'acknowledg':376C 'address':331C 'ai':25B,28B 'ai-app':24B 'ai-tool':27B 'ambigu':374C 'anoth':281C 'anywher':127C 'api':4A,92C 'app':26B 'appli':336C 'applic':300C,311C 'arbitrari':74B,125C,287C 'attack':64B,118C,224C 'authent':63B,117C,223C,263C,350C 'backport':358C 'backup':318C 'base':3A,44B,80B,91C,102C,149C,171C,285C 'boundari':114C 'bug':375C 'build':45B,191C 'bulk':39B,150C,184C,219C 'bypass':187C 'c68q':17A 'c884':16A 'call':69B 'check':54B,246C,365C 'co':321C 'co-loc':320C 'compromis':276C 'concaten':105C 'concept':216C 'construct':156C 'contain':245C,364C 'critic':310C 'cross':273C 'cross-us':272C 'cve':10A,18A 'cwe':30B 'data':135C,275C,306C,315C 'ddlxstudio':387C 'delet':40B,72B,93C,124C,147C,185C,220C,249C,277C,291C,308C,355C 'detail':141C 'direct':106C,159C,198C,241C 'directori':75B,126C,212C,250C,279C,290C,353C 'disclos':384C 'disrupt':140C,305C 'e.g':179C 'endpoint':41B,172C,221C,261C 'entir':189C 'exist':144C 'exploit':120C 'expos':259C,268C 'file':46B,108C,157C,312C 'filesystem':132C,288C,326C 'fix':327C 'flaw':122C 'function':151C,155C 'ghsa':14A 'ghsa-9whx-c884-c68q':13A 'handler':186C 'host':36B 'impact':255C 'includ':76B 'instanc':258C 'intend':210C,253C 'introduc':362C 'issu':329C 'kb':165C,181C,232C 'knowledg':2A,43B,79B,90C,101C,148C,170C,284C 'langflow':1A,21A,22A,23A,32B,37B,82C,257C 'lead':133C 'locat':322C 'loss':136C,307C,316C 'make':66B 'manipul':289C 'manual':194C 'name':52B,103C,166C,233C 'nekros1xx':388C 'normal':339C 'occur':96C 'outsid':208C,251C 'paramet':167C,234C 'pass':196C,240C 'path':8A,47B,57B,86C,109C,158C,177C,182C,193C,206C,238C,294C,342C 'path.is':367C 'path.resolve':337C 'payload':248C 'permiss':303C 'poc':213C 'potenti':138C 'pr':333C,360C 'prefix':373C 'prefix-ambigu':372C 'prevent':371C 'proof':214C 'proper':111C 'python':33B 'recurs':71B 'relat':368C 'research':381C 'resolut':178C 'resolv':180C,207C 'respons':383C 'result':205C 'robust':363C 'rout':174C 'safe':173C 'sanit':112C 'scope':254C 'secur':380C 'self':35B 'self-host':34B 'sequenc':59B,229C 'server':68B,130C,270C,297C 'servic':139C,304C 'shutil.rmtree':200C,243C 'space':286C 'src/backend/base/langflow/api/v1/knowledge_bases.py':153C 'standard':176C 'start':347C 'subsequ':356C 'summari':81C 'suppli':51B,100C,164C,226C,341C 'tenant':282C 'thank':377C 'tool':29B 'travers':9A,58B,87C,228C 'unrecover':314C 'updat':357C 'use':366C 'user':50B,78B,99C,163C,211C,264C,274C,351C 'user-suppli':49B,98C,162C 'valid':115C,202C,344C 'vulner':6A,84C,143C,266C,386C 'within':152C,280C 'without':53B,110C,201C,244C 'write':302C","nicknames":[],"mitigations":[],"who_affected":"Any Langflow instance that exposes the Knowledge Bases API to authenticated users is exposed through the bulk delete endpoint (DELETE /api/v1/knowledge_bases). Instances where only trusted operators can log in, or that do not run Langflow, can skip it.","tier":"B","verified":{},"analyst_revisit_at":null,"fix_status":"available","audience":"businesses","plain_action":null,"pkeys":["langflow"],"ptokens":["langflow"],"labels":["aiapps","aitooling","critical","cwe22","langflow","pypi","python","selfhosted","vendor"],"campaign_type":null,"search_a":"'-2026':11A,19A '-42048':12A,20A '9whx':15A 'api':4A 'base':3A 'c68q':17A 'c884':16A 'cve':10A,18A 'ghsa':14A 'ghsa-9whx-c884-c68q':13A 'knowledg':2A 'langflow':1A,21A,22A,23A 'path':8A 'travers':9A 'vulner':6A","search_b":"'-22':31B 'accept':61B 'ai':25B,28B 'ai-app':24B 'ai-tool':27B 'app':26B 'arbitrari':74B 'attack':64B 'authent':63B 'base':44B,80B 'build':45B 'bulk':39B 'call':69B 'check':54B 'cwe':30B 'delet':40B,72B 'directori':75B 'endpoint':41B 'file':46B 'host':36B 'includ':76B 'knowledg':43B,79B 'langflow':32B,37B 'make':66B 'name':52B 'path':47B,57B 'python':33B 'recurs':71B 'self':35B 'self-host':34B 'sequenc':59B 'server':68B 'suppli':51B 'tool':29B 'travers':58B 'user':50B,78B 'user-suppli':49B 'without':53B","search_c":"'/api/v1/knowledge_bases':94C '/victim_user/kb_name':235C '12243':334C '12337':361C 'acknowledg':376C 'address':331C 'ambigu':374C 'anoth':281C 'anywher':127C 'api':92C 'appli':336C 'applic':300C,311C 'arbitrari':125C,287C 'attack':118C,224C 'authent':117C,223C,263C,350C 'backport':358C 'backup':318C 'base':91C,102C,149C,171C,285C 'boundari':114C 'bug':375C 'build':191C 'bulk':150C,184C,219C 'bypass':187C 'check':246C,365C 'co':321C 'co-loc':320C 'compromis':276C 'concaten':105C 'concept':216C 'construct':156C 'contain':245C,364C 'critic':310C 'cross':273C 'cross-us':272C 'data':135C,275C,306C,315C 'ddlxstudio':387C 'delet':93C,124C,147C,185C,220C,249C,277C,291C,308C,355C 'detail':141C 'direct':106C,159C,198C,241C 'directori':126C,212C,250C,279C,290C,353C 'disclos':384C 'disrupt':140C,305C 'e.g':179C 'endpoint':172C,221C,261C 'entir':189C 'exist':144C 'exploit':120C 'expos':259C,268C 'file':108C,157C,312C 'filesystem':132C,288C,326C 'fix':327C 'flaw':122C 'function':151C,155C 'handler':186C 'impact':255C 'instanc':258C 'intend':210C,253C 'introduc':362C 'issu':329C 'kb':165C,181C,232C 'knowledg':90C,101C,148C,170C,284C 'langflow':82C,257C 'lead':133C 'locat':322C 'loss':136C,307C,316C 'manipul':289C 'manual':194C 'name':103C,166C,233C 'nekros1xx':388C 'normal':339C 'occur':96C 'outsid':208C,251C 'paramet':167C,234C 'pass':196C,240C 'path':86C,109C,158C,177C,182C,193C,206C,238C,294C,342C 'path.is':367C 'path.resolve':337C 'payload':248C 'permiss':303C 'poc':213C 'potenti':138C 'pr':333C,360C 'prefix':373C 'prefix-ambigu':372C 'prevent':371C 'proof':214C 'proper':111C 'relat':368C 'research':381C 'resolut':178C 'resolv':180C,207C 'respons':383C 'result':205C 'robust':363C 'rout':174C 'safe':173C 'sanit':112C 'scope':254C 'secur':380C 'sequenc':229C 'server':130C,270C,297C 'servic':139C,304C 'shutil.rmtree':200C,243C 'space':286C 'src/backend/base/langflow/api/v1/knowledge_bases.py':153C 'standard':176C 'start':347C 'subsequ':356C 'summari':81C 'suppli':100C,164C,226C,341C 'tenant':282C 'thank':377C 'travers':87C,228C 'unrecover':314C 'updat':357C 'use':366C 'user':99C,163C,211C,264C,274C,351C 'user-suppli':98C,162C 'valid':115C,202C,344C 'vulner':84C,143C,266C,386C 'within':152C,280C 'without':110C,201C,244C 'write':302C","cause_entry":null,"cause_path":null,"disclosures_checked_at":null,"first_public_at":"2026-04-27T10:45:50+00:00","kev":null,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:N/I:H/A:H","cvss_by":"GitHub","poc_count":0,"sources":[{"source":"ghsa","external_id":"GHSA-9whx-c884-c68q","url":"https://github.com/advisories/GHSA-9whx-c884-c68q","severity":"critical","published_at":"2026-05-05T18:28:59+00:00","modified_at":"2026-11-16T15:16:51+00:00","first_seen_at":"2026-11-16T15:17:21+00:00","fetched_at":"2026-11-16T15:26:32+00:00","note":null},{"source":"nvd","external_id":"CVE-2026-42048","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42048","severity":null,"published_at":"2026-05-12T18:17:23+00:00","modified_at":"2026-11-11T20:10:00+00:00","first_seen_at":"2026-11-16T15:37:59+00:00","fetched_at":"2026-11-16T15:37:59+00:00","note":null}],"documents":[{"id":170357,"url":"https://api.github.com/repos/langflow-ai/langflow/security-advisories/GHSA-9whx-c884-c68q","title":"Maintainer's advisory: api.github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":null,"relation":"advisory","confidence":null,"note":"Maintainer's advisory: api.github.com"},{"id":170358,"url":"https://github.com/langflow-ai/langflow/security/advisories/GHSA-9whx-c884-c68q","title":"Maintainer's advisory: github.com","kind":"vendor","source":"ghsa","publisher":"vendor","text":null,"published_at":"2026-04-27T10:45:50+00:00","relation":"advisory","confidence":null,"note":"Maintainer's advisory: github.com"}],"disclosures":[],"exploit_sources":[{"type":"epss","score":0.04195,"url":"https://api.first.org/data/v1/epss?cve=CVE-2026-42048"}],"notice":"Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai"}