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.
Can I be a part of your development team as a Pen Tester?
Good day,
My name is William Eduard Chua. I am a 3rd year Computer Science student from PUP - Sta. Mesa. I found out about kabsu.me from my friends studying at CVSU. And, I think it is a great project. I want to add this bug bounty and application vulnerability assessment work to my portfolio.
Your project looks amazing, but I found a security issue with your application. And, here is my proof of concept:
The image below is a flask application that will serve as my server to receive the cookies.
The next image is the malicious web extension that talks with the flask app; sending the cookies with fetch POST. I used ngrok as a tunneling service to have an HTTPS to HTTPS connection with the command
ngrok http 5000
. This is for testing only, ngrok is only available for 1 hour, but a malicious actor can make a permanent tunnel with Cloudflare.Likelihood:
The attack would be possible if the attacker convinced the victim to install the web extension. Essentially, the malicious actor can make a trojan horse, e.g. the attacker can create a web extension that themes your student portal to convince people to install it. The image below shows the manifest of the web extension. The"matches" can be modified to work with other endpoints like "https://myportal.cvsu.edu.ph/*" to implement the theme extension.
Solution:
Ensure that the cookies have HttpOnly and Secure flags checked.
Purpose of HttpOnly:
HttpOnly prevents the javascript execution of the command
document.cookie
. This is the root cause of why my proof of concept was successful.Purpose of Secure:
This ensures the cookie is sent through HTTPS which is encrypted and not readable.
Code Security:
I am not certain if this would work or if this is the right way to set the cookie options in Superbase. Please test this out first before pushing.
The desired result should be after logging in, check the cookies from developer options > application > cookies > https://kabsu.me. Check if the two cookies sb-mcquriygnthreskhulbh-auth-token.0 and sb-mcquriygnthreskhulbh-auth-token.1 have HttpOnly and Secure checked.
I am hoping for your swift response and consideration. Have a great day ahead.
Sincerely,
William Eduard Chua