$ git clone https://thingshare.ion.nu/thingshare.git
commit 8f2ba2ce0bd6a8712b25b56279597c274f41aed7
Author: Alicia <...>
Date: Mon Aug 1 21:16:59 2022 +0200
Fixed an HTML injection vulnerability reported by Pablo Matias/xav0 (https://www.openbugbounty.org/researchers/xav0/)
diff --git a/search.php b/search.php
index eefadd2..03fc1df 100644
--- a/search.php
+++ b/search.php
@@ -2,7 +2,7 @@
/*
This file is part of Thingshare, a federated system for sharing data for home manufacturing (e.g. 3D models to 3D print)
https://thingshare.ion.nu/
- Copyright (C) 2020-2021 Alicia <...>
+ Copyright (C) 2020-2022 Alicia <...>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
@@ -102,7 +102,7 @@ foreach($results as $thing)
?>
<div class="sidebar">
<form action="<?=BASEURL?>/search">
- <input type="hidden" name="q" value="<?=(isset($_GET['q'])?$_GET['q']:'')?>" />
+ <input type="hidden" name="q" value="<?=htmlentities(isset($_GET['q'])?$_GET['q']:'')?>" />
<?=_('Results per page (approximately):')?> <input type="number" name="perpage" value="<?=$perpage?>" /><br />
<?=_('Sort by:')?> <select name="sort">
<option value="new"<?=($sortby=='new'?' selected':'')?>><?=_('New')?></option>