Security Digest · Critical advisory (no CVE assigned)

GHSA-7g7c-qhf3-x59p: propel/propel1 SQL injection possible with limit() on MySQL

The limit() query method is susceptible to catastrophic SQL injection with MySQL.

CVSS 9.8 Critical GitHub-reviewed · critical

Should you act?

  • Only if you depend on one of the packages below, directly or transitively, in a vulnerable version. Check your lockfile with composer audit.
  • No CVE has been assigned, so it will not appear in CVE-based scanners that ignore GitHub advisories. npm audit, pip-audit and Dependabot do read GitHub advisories.

Affected packages

EcosystemPackageVulnerableFirst fixed
Composer (PHP)propel/propel1>= 1, <= 1.7.11.7.2

Details

The limit() query method is susceptible to catastrophic SQL injection with MySQL.

For example, given a model User for a table users:

This will drop the users table!

The cause appears to be a lack of integer casting of the limit input in either Criteria::setLimit() or in DBMySQL::applyLimit(). The code comments there seem to imply that casting was avoided due to overflow issues with 32-bit integers.

This is surprising behavior since one of the primary purposes of an ORM is to prevent basic SQL injection.

This affects all versions of Propel: 1.x, 2.x, and 3.

CVSS: 9.8 (v3.1) CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Sources and references

  1. GitHub Advisory GHSA-7g7c-qhf3-x59p github.com
  2. github.com github.com
  3. github.com github.com
  4. github.com github.com
  5. github.com github.com

Critical Composer (PHP) advisories · Today’s Security Digest