Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

using defusedxml ElementTree for safer parsing of untrusted XML data #9934

Merged
merged 3 commits into from
Oct 18, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
move from core dependency to platform specific dependency
  • Loading branch information
danielwelch committed Oct 18, 2017
commit 5dda563392038ed414bd4770dd3a21c80aedc3d1
5 changes: 4 additions & 1 deletion homeassistant/components/device_tracker/upc_connect.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"""
import asyncio
import logging
import defusedxml.ElementTree as ET

import aiohttp
import async_timeout
Expand All @@ -19,6 +18,8 @@
from homeassistant.helpers.aiohttp_client import async_get_clientsession


REQUIREMENTS = ['defusedxml==0.5.0']

_LOGGER = logging.getLogger(__name__)

DEFAULT_IP = '192.168.0.1'
Expand Down Expand Up @@ -63,6 +64,8 @@ def __init__(self, hass, config):
@asyncio.coroutine
def async_scan_devices(self):
"""Scan for new devices and return a list with found device IDs."""
import defusedxml.ElementTree as ET

if self.token is None:
token_initialized = yield from self.async_initialize_token()
if not token_initialized:
Expand Down
1 change: 0 additions & 1 deletion homeassistant/package_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ aiohttp==2.2.5
async_timeout==1.4.0
chardet==3.0.4
astral==1.4
defusedxml==0.5.0

# Breaks Python 3.6 and is not needed for our supported Pythons
enum34==1000000000.0.0
4 changes: 3 additions & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ aiohttp==2.2.5
async_timeout==1.4.0
chardet==3.0.4
astral==1.4
defusedxml==0.5.0

# homeassistant.components.nuimo_controller
--only-binary=all https://github.com/getSenic/nuimo-linux-python/archive/29fc42987f74d8090d0e2382e8f248ff5990b8c9.zip#nuimo==1.0.0
Expand Down Expand Up @@ -178,6 +177,9 @@ datapoint==0.4.3
# homeassistant.components.light.decora_wifi
# decora_wifi==1.3

# homeassistant.components.device_tracker.upc_connect
defusedxml==0.5.0

# homeassistant.components.media_player.denonavr
denonavr==0.5.4

Expand Down
3 changes: 3 additions & 0 deletions requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ aiohttp_cors==0.5.3
# homeassistant.components.notify.apns
apns2==0.1.1

# homeassistant.components.device_tracker.upc_connect
defusedxml==0.5.0

# homeassistant.components.sensor.dsmr
dsmr_parser==0.11

Expand Down
1 change: 1 addition & 0 deletions script/gen_requirements_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
'aioautomatic',
'aiohttp_cors',
'apns2',
'defusedxml',
'dsmr_parser',
'ephem',
'evohomeclient',
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@
'aiohttp==2.2.5',
'async_timeout==1.4.0',
'chardet==3.0.4',
'astral==1.4',
'defusedxml==0.5.0'
'astral==1.4'
]

setup(
Expand Down