Skip to content

Conversation

@stanislavefremov
Copy link

sendMailToUser function gets email body in $post_body variable and unconditionally applies htmlspecialchars to it, which escapes html tags. It maybe unneeded as later sendMailToUser passes email body to $emailService->sendMail method which performs XSS check through sanitizeEmailBody method and applies htmlspecialchars if needed.

sendMailToUser function gets email body in $post_body variable and unconditionally applies htmlspecialchars to it, which escapes html tags. It maybe unneeded as later sendMailToUser passes email body to $emailService->sendMail method which performs XSS check through sanitizeEmailBody method and applies htmlspecialchars if needed.
@stanislavefremov
Copy link
Author

stanislavefremov commented Nov 22, 2024

htmlspecialchars in sendMailToUser function seems to be unnecessary. PR suggested as a solution for ##4482 issue

Copy link
Contributor

@corentin-soriano corentin-soriano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this function is used by mail_me (direct user input). I think wee can add $antiXSS->clean() to clear eventual XSS payload without break the html.

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.

2 participants