Skip to content

Commit

Permalink
Merge pull request #157 from zendesk/yfernando/xss-fix
Browse files Browse the repository at this point in the history
[PEGASUS-934] Escape user input when generating autocompelete list HTML to avoid XSS attacks
  • Loading branch information
thekindofme authored Jun 25, 2020
2 parents 8e8b89f + f102bd3 commit ebe4973
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,9 @@ public function autocompleteAction()
$output = '<ul>';
if($customers->getSize()) {
foreach($customers as $customer) {
$id = $customer->getId();
$name = $customer->getName();
$email = $customer->getEmail();
$id = htmlspecialchars($customer->getId(), ENT_COMPAT, 'UTF-8');
$name = htmlspecialchars($customer->getName(), ENT_COMPAT, 'UTF-8');
$email = htmlspecialchars($customer->getEmail(), ENT_COMPAT, 'UTF-8');
$output .= '<li id="customer-' . $id . '" data-email="' . $email . '" data-name="' . $name . '">' . $name . ' &lt;' . $email . '&gt;</li>';
}
}
Expand Down

0 comments on commit ebe4973

Please sign in to comment.