generated from host-uk/core-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
lang:phpPHP/LaravelPHP/Laravel
Description
Description
The ActivityLog component uses user input in LIKE queries without sanitizing SQL wildcards.
Location
- File: src/View/Modal/Admin/ActivityLog.php
- Lines: 58-62
Issue
The search term is used directly in a LIKE clause:
->where('description', 'like', '%'.$this->searchTerm.'%')
->orWhere('subject_type', 'like', '%'.$this->searchTerm.'%')
If a user enters % or _ characters, they are interpreted as SQL wildcards:
- % matches any sequence of characters
- _ matches any single character
This allows:
- Broader searches than intended
- Potential performance issues with leading wildcards
- Information disclosure through wildcard enumeration
Recommendation
- Escape SQL wildcards in user input: str_replace(['%', '_'], ['%', '_'], $searchTerm)
- Consider using full-text search for better performance and security
- Add input validation/sanitization for search terms
- Limit search result count to prevent enumeration
Severity
Low - Information disclosure limited to data user already has access to
Metadata
Metadata
Assignees
Labels
lang:phpPHP/LaravelPHP/Laravel