mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-08 08:20:28 +03:00
use defusedxml to avoid DoS attacks while loading XML
This commit is contained in:
parent
cc94ebca30
commit
4d13a904f3
4 changed files with 10 additions and 4 deletions
|
|
@ -28,6 +28,7 @@
|
|||
|
||||
|
||||
import collections
|
||||
import defusedxml.minidom
|
||||
import git
|
||||
import glob
|
||||
import os
|
||||
|
|
@ -36,7 +37,6 @@ import logging
|
|||
import requests
|
||||
import shutil
|
||||
import tempfile
|
||||
import xml.dom.minidom
|
||||
import zipfile
|
||||
from argparse import ArgumentParser
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ For more info on this idea:
|
|||
continue
|
||||
dest = os.path.join(cpdir, f)
|
||||
if f.endswith('.xml'):
|
||||
doc = xml.dom.minidom.parse(repof)
|
||||
doc = defusedxml.minidom.parse(repof)
|
||||
output = doc.toprettyxml(encoding='utf-8')
|
||||
with open(dest, 'wb') as f:
|
||||
f.write(output)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue