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
- 67% confidence
- Finding
- This query builder applies filters using attribute names taken directly from the caller's filters dictionary without any allowlist. While SQLAlchemy prevents classic SQL injection here, untrusted callers can still probe model structure, trigger exceptions for invalid fields, and query on sensitive columns that the API may not have intended to expose.
