Skip to content

Commit 349a4bf

Browse files
authored
Prevent Saxon URL access, avoids XXE vulnerabilities (#16)
1 parent e4d4b2b commit 349a4bf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/peppol_py/validation.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ def validate_peppol_document(
2828
# only works with XSLT 1.0, and the Schematron is written in XSLT
2929
# 2.0
3030
with PySaxonProcessor(license=False) as proc:
31+
# Prevent XXE: disallow access to any type of URL
32+
proc.set_configuration_property("http://saxon.sf.net/feature/allowedProtocols", "")
3133
for validation_xsl_file in schematron_xsls:
3234
if not os.path.exists(validation_xsl_file):
3335
# Resolve internal files

0 commit comments

Comments
 (0)