Skip to content

Commit c5618b0

Browse files
committed
escape filterlist values
1 parent f8619d5 commit c5618b0

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

reports/utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@
3434
from patchman.signals import pbar_start, pbar_update
3535
from repos.models import Mirror, MirrorPackage, Repository
3636
from repos.utils import get_or_create_repo
37-
from util.logging import debug_message, error_message, info_message, warning_message
37+
from util.logging import (
38+
debug_message, error_message, info_message, warning_message,
39+
)
3840

3941

4042
def process_repos(report, host):

util/filterspecs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# You should have received a copy of the GNU General Public License
1616
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1717

18+
from html import escape
1819
from operator import itemgetter
1920

2021
from django.db.models.query import QuerySet
@@ -70,7 +71,7 @@ def output(self, qs):
7071
style = 'list-group-item-success'
7172
qs[self.name] = k
7273
output += f'<a href="{get_query_string(qs)}" class='
73-
output += f'"list-group-item {style}">{v}</a>\n'
74+
output += f'"list-group-item {style}">{escape(str(v))}</a>\n'
7475
output += '</div></div></div>'
7576
return output
7677

0 commit comments

Comments
 (0)