Fix SQL injection in EventEditor.php via EID parameter#7684
Merged
Conversation
Add InputUtils::filterInt() sanitization to EID parameter from both GET and POST requests. The unsanitized EID was being directly concatenated into SQL queries, allowing SQL injection attacks. Fixes #6854
Sanitize EventCount[] and EventCountNotes POST parameters in the ON DUPLICATE KEY UPDATE clause of eventcounts_evtcnt INSERT statements. The INSERT VALUES were already sanitized but the UPDATE clause used raw unsanitized values, allowing SQL injection via the attendance count fields. Applied InputUtils::legacyFilterInput() consistently to both the INSERT and UPDATE portions of the query.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses a SQL injection vulnerability in EventEditor.php by sanitizing the EID parameter from both GET and POST requests using InputUtils::filterInt(). The unsanitized EID was being directly concatenated into SQL queries at line 231, creating a security risk.
Key Changes
- Applied
InputUtils::filterInt()to$_GET['EID'](line 34) - Applied
InputUtils::filterInt()to$_POST['EID'](line 37)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Changed
Add InputUtils::filterInt() sanitization to EID parameter from both GET and POST requests. The unsanitized EID was being directly concatenated into SQL queries, allowing SQL injection attacks.
Fixes #6854
Type
Testing
Screenshots
Security Check
Code Quality
Pre-Merge