Dynamic attribute access via getattr()
Low
- Category
- Dangerous Code Execution
- Content
if filters: for key, value in filters.items(): query = query.filter(getattr(self.__model__, key) == value) if offset: query = query.offset(offset)- Confidence
- 76% confidence
- Finding
- This method uses attacker-influenced filter keys to dynamically resolve model attributes with getattr(self.__model__, key) and does not validate them against an allowlist. While SQLAlchemy still parameterizes values, untrusted callers can trigger unauthorized field-level querying, unexpected exceptions, or bypass intended business restrictions by probing internal columns.
