Skip to content

Commit

Permalink
Fix HTML injection exploit (#682)
Browse files Browse the repository at this point in the history
Escape html special characters from the $fields array to prevent html injection in the generated pdfs.
  • Loading branch information
sanch03 authored Jan 12, 2022
1 parent d303b1a commit e2bb414
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Traits/GeneratesPdfTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,10 @@ public function getFieldsArray()
foreach ($customerCustomFields as $customField) {
$fields['{'.$customField->customField->slug.'}'] = $customField->defaultAnswer;
}

foreach ($fields as $key => $field) {
$fields[$key] = htmlspecialchars($field, ENT_QUOTES, 'UTF-8');
}

return $fields;
}
Expand Down

0 comments on commit e2bb414

Please sign in to comment.