Skip to contentSkip to conversation

security fix CVE-2019-13122

PATCH New Armin Kuster 1 participant 2 messages Jul 8, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 security fix CVE-2019-13122

This is an untested backported patch from stable/2.0 patchwork for the OE version. It is a function already being used in the file so I have high confidence it wont introduce any new issues.

Andrew Donnellan (1):
filters: Escape State names when generating selector HTML

 patchwork/filters.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Signature · 1 line
2.7.4
#1 lore raw

PATCH 1/1 filters: Escape State names when generating selector HTML

From: Andrew Donnellan <[email protected]>

States with names containing special characters are not correctly escaped when generating the select list. Use escape() to fix this.

(cherry picked from commit b3fa0c402e060622a5ed539a465d2fa98b1d2e13)
[Fixup for 1.16 context, CVE-2019-13122 ]
---
 patchwork/filters.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
patchwork/filters.py +1 -1
index 87c904f..b734207 100644
@@ -212,7 +212,7 @@ class StateFilter(Filter):
                 selected = ' selected="true"'
 
             str += '<option value="%d" %s>%s</option>' % (
-                state.id, selected, state.name)
+                state.id, selected, escape(state.name))
         str += '</select>'
         return mark_safe(str)
 
Signature · 1 line
2.7.4