-
Notifications
You must be signed in to change notification settings - Fork 179
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
bug: update-server bricked after POST /server/name
with input that Avahi doesn't like
#9960
Comments
Investigation
What, precisely, counts as an "invalid name"?We set the Avahi service name over Avahi's D-Bus API. I'm assuming Avahi's D-Bus API follows its C API, which says:
But I think this wrong in a few ways. As mentioned above, I think the Avahi service name corresponds to the DNS-SD instance name. If I'm correct, then:
These rules appear entirely separate from what we're allowed to encode in Implementation suggestionI don't think we should attempt to duplicate Avahi's validation rules. Instead, we should either:
|
This ticket explicitly covers fatal update-server breakage. Ticket can be closed when:
|
POST /server/name
accepts invalid namesPOST /server/name
with a long name will brick update-server
POST /server/name
with a long name will brick update-serverPOST /server/name
certain names will brick update-server
POST /server/name
certain names will brick update-serverPOST /server/name
with certain input will brick update-server
POST /server/name
with certain input will brick update-serverPOST /server/name
with input that Avahi doesn't like
[Note: This ticket has been heavily edited since it was written to scope it down.]
Summary
If you rename the robot to certain strings,
update-server
will fail to start up.Steps to reproduce
Ensure you have SSH access to your robot. You will need this to recover from the error after testing.
Send an HTTP request to set the robot's name to something longer than 63-ish characters. For example, here's 70 characters:
The request may return a 500 error.
Reboot the robot.
Current behavior
After the reboot,
update-server
will never come back online.Expected behavior
update-server
should not accept input that can brick it. It should sanitize or reject harmful input throughPOST /server/name
.Recovery
/etc/machine-info
, e.g. withvi
.PRETTY_HOSTNAME=<very long string>
. Replace<very long string>
with something small, likehello
.The text was updated successfully, but these errors were encountered: