Skip to content

Commit f102bd3

Browse files
committed
Escape user input when generating autocompelete list HTML to avoid XSS attacks
1 parent 7fa3245 commit f102bd3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/app/code/community/Zendesk/Zendesk/controllers/Adminhtml/ZendeskController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,9 +417,9 @@ public function autocompleteAction()
417417
$output = '<ul>';
418418
if($customers->getSize()) {
419419
foreach($customers as $customer) {
420-
$id = $customer->getId();
421-
$name = $customer->getName();
422-
$email = $customer->getEmail();
420+
$id = htmlspecialchars($customer->getId(), ENT_COMPAT, 'UTF-8');
421+
$name = htmlspecialchars($customer->getName(), ENT_COMPAT, 'UTF-8');
422+
$email = htmlspecialchars($customer->getEmail(), ENT_COMPAT, 'UTF-8');
423423
$output .= '<li id="customer-' . $id . '" data-email="' . $email . '" data-name="' . $name . '">' . $name . ' &lt;' . $email . '&gt;</li>';
424424
}
425425
}

0 commit comments

Comments
 (0)