Skip to content

Commit ebe4973

Browse files
authored
Merge pull request #157 from zendesk/yfernando/xss-fix
[PEGASUS-934] Escape user input when generating autocompelete list HTML to avoid XSS attacks
2 parents 8e8b89f + f102bd3 commit ebe4973

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
@@ -415,9 +415,9 @@ public function autocompleteAction()
415415
$output = '<ul>';
416416
if($customers->getSize()) {
417417
foreach($customers as $customer) {
418-
$id = $customer->getId();
419-
$name = $customer->getName();
420-
$email = $customer->getEmail();
418+
$id = htmlspecialchars($customer->getId(), ENT_COMPAT, 'UTF-8');
419+
$name = htmlspecialchars($customer->getName(), ENT_COMPAT, 'UTF-8');
420+
$email = htmlspecialchars($customer->getEmail(), ENT_COMPAT, 'UTF-8');
421421
$output .= '<li id="customer-' . $id . '" data-email="' . $email . '" data-name="' . $name . '">' . $name . ' &lt;' . $email . '&gt;</li>';
422422
}
423423
}

0 commit comments

Comments
 (0)