Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-side request forgery (SSRF) vulnerability #805

Open
LioTree opened this issue Feb 13, 2021 · 0 comments
Open

Server-side request forgery (SSRF) vulnerability #805

LioTree opened this issue Feb 13, 2021 · 0 comments

Comments

@LioTree
Copy link

LioTree commented Feb 13, 2021

https://gleezcms.org/http%3A%2F%2Fwww.google.com
https://gleezcms.org/gopher%3A%2F%2F127%2E0%2E0%2E1%3A9000%2F%5Ftest

if :// is in the path of url, gleezcms will use curl library to send request.

This vulnerability is far more dangerous than it looks like because curl supports gopher protocol, which is always used to attack php-fpm, redis, memecached and so on. If these application exists, this ssrf may cause remote code execution.

It seems that this vulnerability is caused by different version of kohana farmwork.

In classes/Kohana/Request.php of kohana core 3.2, it checks Request::$initial first, which prevents the default index.php from being able to proxy external pages.

https://github.com/kohana/core/blob/3.2/master/classes/kohana/request.php#L801

But in kohana core 3.3, it deletes the check of Request::$initial but uses $allow_external to prevents the default index.php from being able to proxy external pages.$alow_external is set to FALSE in index.php.

https://github.com/kohana/core/blob/3.3/master/classes/Kohana/Request.php#L678
https://github.com/kohana/kohana/blob/3.3/master/index.php#L117

The problem is gleezcms's index.php is similar with kohana 3.2, but the modules/gleez/classes/request.php is based on kohana 3.3 after d68b9c9, which means $allow_external is TRUE and index.php can be used to proxy external pages.

@LioTree LioTree changed the title There is a server-side request forgery(ssrf) that may cause remote code execution Server-side request forgery (SSRF) vulnerability Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant