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

Emulated Hue: Limited to RFC1918 IPv4 addresses #30701

Closed
breti opened this issue Jan 12, 2020 · 41 comments
Closed

Emulated Hue: Limited to RFC1918 IPv4 addresses #30701

breti opened this issue Jan 12, 2020 · 41 comments

Comments

@breti
Copy link

breti commented Jan 12, 2020

Home Assistant release with the issue:

Home Assistant 0.103.6

Last working Home Assistant release (if known):
n/a

Operating environment (Hass.io/Docker/Windows/etc.):

HASS.IO on Synology NAS (.SPK)

Integration:

/components/emulated_hue/

Description of problem:
The Hue Emulation is limited to RFC1918 IPv4 adresses; if running in a network with e.g. RFC 3927 addresses or with public IPv4 addresses (as in my setup), which is perfectly fine and valid, access to e.g. /api/pi/lights is denied with message:

{"message": "Only local IPs allowed"}

This is not mentioned anywhere in the docs.

There seems to be no option to work around this issue. The list of allowed IPv4 addresses seems to be hardcoded (see https://community.home-assistant.io/t/emulated-hue-only-local-ips-allowed/109852/4).

Please disable this check (I don't know what it is good for) or provide a setting to override this check.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):

emulated_hue:

Traceback (if applicable):


Additional information:

@stale
Copy link

stale bot commented Apr 12, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 12, 2020
@breti
Copy link
Author

breti commented Apr 12, 2020

Nothing has changed. Public IPs are still not allowed (in homeassistant/components/emulated_hue/hue_api.py).

@stale stale bot removed the stale label Apr 12, 2020
@stale
Copy link

stale bot commented Jul 11, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jul 11, 2020
@breti
Copy link
Author

breti commented Jul 11, 2020

Nothing has changed. Public IPs are still not allowed (in homeassistant/components/emulated_hue/hue_api.py).

@stale stale bot removed the stale label Jul 11, 2020
@stale
Copy link

stale bot commented Oct 12, 2020

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue now has been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 12, 2020
@breti
Copy link
Author

breti commented Oct 12, 2020

Nothing has changed. Public IPs are still not allowed (in homeassistant/components/emulated_hue/hue_api.py).

@stale stale bot removed the stale label Oct 12, 2020
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 26, 2021
@breti
Copy link
Author

breti commented Jan 26, 2021

Nothing has changed. Public IPs are still not allowed (in homeassistant/components/emulated_hue/hue_api.py).

@github-actions github-actions bot removed the stale label Jan 26, 2021
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 26, 2021
@breti
Copy link
Author

breti commented Apr 26, 2021

Nothing has changed. Public IPs are still not allowed (in homeassistant/components/emulated_hue/hue_api.py).

@github-actions github-actions bot removed the stale label Apr 26, 2021
@raskitoma
Copy link

raskitoma commented Aug 3, 2021

I would like to keep this topic/issue open. I have the same problem using a local network with different ip schema. The thing is, I want to use this schema on my own-private-network, so I don't know why this have to be enforced via hard coding it instead of using a config parameter to allow non RFC1918 addresses.

Also I don't want to edit the py to remove any reference to this enforcing jail, because with new updates, all changes will be removed as well. This could not be turning into a cat-mouse game.

@github-actions
Copy link

github-actions bot commented Nov 1, 2021

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 1, 2021
@raskitoma
Copy link

Well it seems that maybe changing the code is the only way and keeping doing it every update...

@github-actions github-actions bot removed the stale label Nov 1, 2021
@breti
Copy link
Author

breti commented Nov 2, 2021

Yes, that's right. That's what I do :-/

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 31, 2022
@bdraco
Copy link
Member

bdraco commented Jan 31, 2022

This was blocked intentionally in #17248

@breti
Copy link
Author

breti commented May 7, 2023

Nothing has changed. Limiting access to RFC1918 addresses is still a very bad idea.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@breti
Copy link
Author

breti commented Aug 5, 2023

Nothing has changed. Limiting access to RFC1918 addresses is still a very bad idea.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@breti
Copy link
Author

breti commented Nov 5, 2023

Nothing has changed. Limiting access to RFC1918 addresses is still a very bad idea.

@peterbokunet
Copy link

+1 that thinking your app is secure because you're requiring RFC1918 is just irresponsible and immature. If it's desired to be a flag, that's fine but address space is address space.

I'd encourage the fix for this be merged.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@breti
Copy link
Author

breti commented May 1, 2024

Nothing has changed. Limiting access to RFC1918 addresses is still a very bad idea.

@peterbokunet
Copy link

It would be great to be able to use the service in my LAN.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@peterbokunet
Copy link

Would the current maintainers be interested in handing over this repo to people interested in supporting it?

@github-actions github-actions bot removed the stale label Jul 31, 2024
@Acgua
Copy link

Acgua commented Oct 14, 2024

+1

Please remove this RFC1918 IPv4 address verification via is_local in file hue_api.py or provide an option to disable it.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@breti
Copy link
Author

breti commented Jan 14, 2025

Not stale.

@github-actions github-actions bot removed the stale label Jan 14, 2025
@peterbokunet
Copy link

peterbokunet commented Jan 17, 2025

is not stale
is shortsighted. Hypothetically, say the emulated_hue device is on 172.16.14.23/28 and the home-assistant is on 192.168.34.11/24. The call to is_local() will return true even though there is a router between the resources.

A proper solution of is_local() would compare the local address(es) of home-assistant with the address of emulated_hue and return false as they are on different networks.

Any comparison of hard-coded addresses as this is doing is insecure.

@frenck
Copy link
Member

frenck commented Mar 28, 2025

I've just reviewed this one and I am going to close this issue.

Looking at our history and codebase, this change was made intentionally in: #17248

The reason is that this endpoint doesn't require authentication, and thus not something we want to every accidentally expose to the public. You could consider working around it using a VPN or other tunnels if you really want to work around that.

If you want to suggest a feature, you should try our Community Forum: Feature Requests.

If you have additional questions, feel free to join our Discord chat server.

Thanks! 👍

../Frenck

@frenck frenck closed this as not planned Won't fix, can't repro, duplicate, stale Mar 28, 2025
@breti
Copy link
Author

breti commented Mar 28, 2025

Thanks for the suggestion with the VPN, but if you use a local network completely with public IPv4 addresses, no tunnel or VPN will help. All devices in the LAN then have public addresses, the LAN can still be secure. NAPT should never be seen as a firewall, it is a deceptive security.

The solution implemented in #17248 is a big mistake and should never have been implemented in this way. It is a great pity that such design flaws are not corrected.

@peterbokunet
Copy link

peterbokunet commented Mar 31, 2025

@frenck - would there be opposition for adopting a branch of the Hue integration as the current maintainers are not interested in correcting the errors in the current code? I am happy to demonstrate how the current implementation has flaws.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants