-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Add Psalm security checks (has_quotes only) and fix detected issues
#20407
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
Add Psalm security checks (has_quotes only) and fix detected issues
#20407
Conversation
381f91e to
8bbcc3f
Compare
8bbcc3f to
c163ac4
Compare
has_quotes only) and fix detected issues
| // Display extra html if needed | ||
| if (!empty($options['after_display'] ?? "")) { | ||
| echo $options['after_display']; | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was used only by front/problem.form.php and front/ticket.form.php, and was now a security flaw since the request is not anymore autosanitized.
|
|
||
| if (!$compat) { | ||
| echo htmlescape(Plugin::messageIncompatible( | ||
| echo Plugin::messageIncompatible( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This message and the following are caught inside an output buffer that is later escaped (see $error .= "<span class='error'>" . htmlescape(ob_get_contents()) . "</span>"; in src/Glpi/Marketplace/View.php).
The buffer content can also contain messages outputed by plugins, it is safer to escape its whole content.
c163ac4 to
a7b7cb4
Compare
Checklist before requesting a review
Description
I tried again to run a security analysis on our code with Psalm, and now we have fixed many escaping issues, it seems that results are consistents. Also, maybe a few issues have been fixed in Psalm.
For the moment, I silented all errors expect the
TaintedTextWithQuoteserrors.I did not fixed all detected errors yet, this will be done in the next few days.