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
- 78% confidence
- Finding
- This query builder accepts arbitrary filter keys and passes them to getattr(self.__model__, key) without validation. If untrusted input reaches this method, an attacker can trigger unexpected attribute access, application crashes, or query manipulation against unintended ORM attributes, which is especially risky in a generic DAO reused across the codebase.
