CVE-2026-87016: Sqlalchemy Json Contains Wildcard Matching

Using `.contains()` with a dictionary or list on a SQLAlchemy JSON column compiles to a `LIKE '%...%'` substring match on SQLite and MySQL. This allows SQL wildcards (`%`, `_`) in user inputs to match unintended records, potentially leading to identity spoofing or authentication bypass. Use JSON subscripting with exact comparison (e.g., `Column[key].as_strin

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0Python
greprules fetch cve-2026-87016-sqlalchemy-json-contains-wildcard-matching --engine opengrep

Description

Using `.contains()` with a dictionary or list on a SQLAlchemy JSON column compiles to a `LIKE '%...%'` substring match on SQLite and MySQL. This allows SQL wildcards (`%`, `_`) in user inputs to match unintended records, potentially leading to identity spoofing or authentication bypass. Use JSON subscripting with exact comparison (e.g., `Column[key].as_strin