InputSanitizer exists but is never called from controllers #163
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: HIGH
Location
lib/Middleware/InputSanitizer.php, all controllersDescription
The
InputSanitizerclass providessanitizeString(),sanitizeArray(),sanitizeDate(), etc., but no controller or service actually calls these methods. All user input fromgetRequestData()(JSON body) and$this->request->getParam()(query params) flows directly into services and database queries without sanitization.Risk
While the ORM uses parameterized queries (preventing SQL injection), unsanitized strings are stored in the database. These could contain HTML/script payloads that, while currently escaped by Vue on render, could be exploited if data is ever rendered in a non-Vue context (e.g., emails, PDF exports, CalDAV sync).
Recommendation
Wire
InputSanitizerinto theApiControllerTrait.getRequestData()method or apply it in service-layercreate/updatemethods for all string fields.