Skip to content

fix : escape HTML in send-review API route email body - #23

Open
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:fix/send-review-html-escaping
Open

fix : escape HTML in send-review API route email body#23
tmdeveloper007 wants to merge 1 commit into
syedahmedkhaderi:mainfrom
tmdeveloper007:fix/send-review-html-escaping

Conversation

@tmdeveloper007

Copy link
Copy Markdown

Summary of What Has Been Done:
Added an escapeHtml() helper and applied it to the name, email, and review fields in the HTML email template of the send-review route. The rating stars and to recipient remain unchanged as they are server-controlled.

Changes Made:

  • app/api/send-review/route.js: added escapeHtml() function, applied to interpolated fields in mailOptions.html

Impact it Made:
Prevents XSS via crafted review text containing HTML tags or script content. Lint remains green.

Apply HTML entity encoding to name, email, and review fields before
inserting them into the HTML email body to prevent XSS in mail clients.
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.

1 participant