diff --git a/modules/consentAdmin/templates/consentadmin.php b/modules/consentAdmin/templates/consentadmin.php
index af77298a93dd3c11ce59a2e8e38567b1c7df7646..13829af83594ed964f9596785f4dfa5f57c2f097 100644
--- a/modules/consentAdmin/templates/consentadmin.php
+++ b/modules/consentAdmin/templates/consentadmin.php
@@ -127,6 +127,6 @@ TRSTART;
 
         <h2>Logout</h2>
 
-            <p><a href="<?php echo \SimpleSAML\Utils\HTTP::getSelfURL() . '?logout'; ?>">Logout</a></p>
+            <p><a href="<?php echo htmlentities(\SimpleSAML\Utils\HTTP::getSelfURL()) . '?logout'; ?>">Logout</a></p>
 
 <?php $this->includeAtTemplateBase('includes/footer.php');