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
- 80% confidence
- Finding
- This query builder applies filters using attribute names taken directly from the filters dictionary via getattr(self.__model__, key). While it is not classic SQL injection, untrusted callers can select arbitrary model fields for querying, which can bypass intended access restrictions, expose unexpected records, or trigger errors/denial of service through invalid attributes. In this skill, generic database access is already broader than needed for infant cry analysis, which increases the concern.
