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
- 84% confidence
- Finding
- Here, getattr(self.__model__, key) uses keys from the caller-supplied filters dictionary, so an untrusted caller can influence which model attributes are resolved. While SQLAlchemy still parameterizes values and this is not classic SQL injection, it can enable unauthorized querying on unintended columns, trigger exceptions for invalid attributes, and weaken data-access boundaries in a shared DAO used across skills.
