Skip to content

Commit 3341e4e

Browse files
committed
Fix possible XML injecton in expection message (which may contain values passed in the request query)
1 parent 1598038 commit 3341e4e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/feature_info_service.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import traceback
88
from urllib.parse import urljoin
99
from xml.dom.minidom import Document, Element, Text
10+
from xml.sax.saxutils import escape as xml_escape
1011
from geomet import wkt
1112
import locale
1213

@@ -218,7 +219,7 @@ def service_exception(self, code, message):
218219
'<ServiceExceptionReport version="1.3.0">\n'
219220
' <ServiceException code="%s">%s</ServiceException>\n'
220221
'</ServiceExceptionReport>'
221-
% (code, message)
222+
% (code, xml_escape(message))
222223
)
223224

224225
def expand_group_layers(self, requested_layers, requested_styles, group_layers,

0 commit comments

Comments
 (0)