GHSA-7g7c-qhf3-x59p

Suggest an improvement
Source
https://github.com/advisories/GHSA-7g7c-qhf3-x59p
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2024/05/GHSA-7g7c-qhf3-x59p/GHSA-7g7c-qhf3-x59p.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7g7c-qhf3-x59p
Published
2024-05-20T17:36:28Z
Modified
2024-12-05T05:39:36.081597Z
Severity
  • 9.8 (Critical) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H CVSS Calculator
Summary
propel/propel1 SQL injection possible with limit() on MySQL
Details

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

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

UserQuery::create()->limit('1;DROP TABLE users')->find();

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.

Database specific
{
    "nvd_published_at": null,
    "cwe_ids": [
        "CWE-89"
    ],
    "severity": "CRITICAL",
    "github_reviewed": true,
    "github_reviewed_at": "2024-05-20T17:36:28Z"
}
References

Affected packages

Packagist / propel/propel1

Package

Name
propel/propel1
Purl
pkg:composer/propel/propel1

Affected ranges

Type
ECOSYSTEM
Events
Introduced
1
Fixed
1.7.2

Affected versions

1.*

1.6.2
1.6.3
1.6.4
1.6.5
1.6.6
1.6.7
1.6.8
1.6.9
1.7.0
1.7.1

Database specific

{
    "last_known_affected_version_range": "<= 1.7.1"
}