CriticalGHSA-v42g-7q2x-cw32

Zendframework1 potential SQL injection vector using null byte for PDO (MsSql, SQLite)

Published 7 Jun 2024 · Updated 4 Dec 2024

Affected package

Affected
>=1.12.0 <1.12.16
Fixed in
1.12.16
Update to the fixed version for your release line, for example:composer require zendframework/zendframework1:^1.12.16

Details

The PDO adapters of Zend Framework 1 do not filter null bytes values in SQL statements. A PDO adapter can treat null bytes in a query as a string terminator, allowing an attacker to add arbitrary SQL following a null byte, and thus create a SQL injection.

We tested and verified the null byte injection using pdo_dblib (FreeTDS) on a Linux environment to access a remote Microsoft SQL Server, and also tested against and noted the vector against pdo_sqlite.

Is GHSA-v42g-7q2x-cw32 in any of your client repos?

Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected zendframework/zendframework1, and gives you the command that fixes it.

References

Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.