Skip to content

Commit

Permalink
Security fix: Location event field XSS
Browse files Browse the repository at this point in the history
- CWE-79: Cross-site Scripting (XSS) - Stored
- The location field was not being properly escaped when presented in
  a number of views, allowing malicious script to run on the user's
  browser.
  • Loading branch information
craigk5n committed Jan 13, 2023
1 parent b3c4f4f commit 7906b49
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion includes/functions.php
Expand Up @@ -6220,7 +6220,7 @@ function build_entry_popup ( $popupid, $user, $description, $time,
. ( strlen ( $time )
? '<dt>' . translate ( 'Time' ) . ":</dt>\n<dd>$time</dd>\n" : '' )
. ( ! empty ( $location ) && $details
? '<dt>' . translate ( 'Location' ) . ":</dt>\n<dd> $location</dd>\n" : '' )
? '<dt>' . translate ( 'Location' ) . ":</dt>\n<dd>" . htmlspecialchars($location) . "</dd>\n" : '' )
. ( ! empty ( $reminder ) && $details
? '<dt>' . translate ( 'Send Reminder' ) . ":</dt>\n<dd> $reminder</dd>\n" : '' );

Expand Down
4 changes: 2 additions & 2 deletions view_entry.php
Expand Up @@ -419,8 +419,8 @@
echo '</div><div class="w-100"></div></div>' . "\n";

if ($DISABLE_LOCATION_FIELD != 'Y' && !empty($location)) {
echo '<div class="row"><div class="col-3">' . translate('Description') . "</div>\n";
echo '<div class="col-9">' . $location . "</div>\n";
echo '<div class="row"><div class="col-3">' . translate('Location') . "</div>\n";
echo '<div class="col-9">' . htmlentities($location) . "</div>\n";
echo '<div class="w-100"></div></div>' . "\n";
}

Expand Down

0 comments on commit 7906b49

Please sign in to comment.