GilaCMS / gila

A lightweight and fast CMS system built with PHP
http://gilacms.com
BSD 3-Clause "New" or "Revised" License
45 stars 12 forks source link

XSS+CSRF Exploit chain & Source Code disclosure (gila v1.15.3) #106

Closed we08guyy closed 4 years ago

we08guyy commented 4 years ago

(Please forgive my poor English.) Hello, I found XSS+CSRF exploit chain in gila version v1.15.3. I tried to submit the security issus by Email, but it seems your recipient Email System is down. I tried to reduce my Email size but it still been returned. I'm sorry for reporting security vuln in issues. Here is the security vuln's details:

Vuln 1: Stored Cross-Site Script

The premise: Your site open the "New Users Can Register" option in Administration's Settings.

The influence: Hacker can do anything that XSS can do without get Admin's GSESSIONID if he only use the stored XSS payload1. Hacker can't do anything very terrible because of the limit of username's length in the stored XSS payload2.

Vuln 2: Potential Cross-Site Request Forgery

I found Gila only regenerate formToken of Admin's pages when admin logging in, and every form use the same formToken. That's terrible, it's a potential threaten. CSRF token should regenerate everytime user visit the form. I advise Gila use the mature CSRF token solution rather than developing a simple token generating function.

The influence: The formToken acutually disturb the hacker, but it's not enough. If hacker get the token in some way (like the Exploit chain below), he might can exploit the vuln successfully.

XSS+CSRF Exploit chain

Here is the example of exploit the two vulns above to create a new Admin User for Hacker. (http://mycms.com/gila is the GilaCMS's URL, and http://10.0.17.249:3000orhttp://evil.com is the hacker's URL.)