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

Update Exceptions.php #6113

Open
wants to merge 1 commit into
base: 3.1-stable
Choose a base branch
from

Conversation

SynacktivCerv
Copy link

In some cases, error messages could lead to Cross-Site Scripting vulnerability. This small fix sanitize potential user input from GET/POST parameters that could be returned into error messages.

For example with this kind of code:
if (isset($_GET['page'])) { $this->load->view($_GET['page']); }

If the page is load with /?page=<script>PAYLOAD</script> the JavaScript will be executed.

In some cases, error messages could lead to Cross-Site Scripting vulnerability. This small fix sanitize potential user input from GET/POST parameters that could be returned into error messages.
@gxgpet
Copy link
Contributor

gxgpet commented Mar 27, 2022

Why would you pass $_GET['page'] raw variable? We have a dedicated library for fetching GET parameters.

@SynacktivCerv
Copy link
Author

The example is not my code but something I saw during a security review.

Furthermore, by using the dedicated library, the injection on error page seems to still be possible. Indeed, the documentation from your link is saying that " XSS escaping should be performed on output, not input!".

@SynacktivCerv
Copy link
Author

Hi,

Any update on this issue?

Regards,

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

Successfully merging this pull request may close these issues.

None yet

2 participants