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

Public methods in system/Controller #1849

Closed
MGatner opened this issue Mar 21, 2019 · 4 comments
Closed

Public methods in system/Controller #1849

MGatner opened this issue Mar 21, 2019 · 4 comments

Comments

@MGatner
Copy link
Member

MGatner commented Mar 21, 2019

I noticed that a number of methods in system/Controller.php are public (initController, forceHTTPS, cachePage, validate). I'm not sure if they need to be for internal purposes, but this makes them routable endpoints on any controller. E.g. https://example.com/home/cachePage/1, or https://example.com/home/initController. This should definitely be addressed as it is borderline a security issue - let me know if you want help with that.

@lonnieezell
Copy link
Member

Good catch.

initController has to be public but the others should be protected. If you have time to do a PR that would be awesome. I'm just now getting to a place where I can start catching up again.

@MGatner
Copy link
Member Author

MGatner commented Mar 21, 2019

I can make a PR.
Would adding a 404 route (similar to https://github.com/MGatner/CodeIgniter4/blob/basecontroller/system/Config/Routes.php#L55) for initController be appropriate?

@lonnieezell
Copy link
Member

I think so, yes.

@jim-parry jim-parry added this to the 4.0.0-beta.3 milestone Mar 25, 2019
@atishhamte
Copy link
Contributor

I guess this is merged. Please close

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

4 participants