device_db entry keys ought to be sanitised #1696
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, arbitrary strings are accepted as device_db keys (device names), including e.g. multi-line strings. This should be suitably restricted.
The ARTIQ design heavily suggests using Python identifiers as device names (
setattr_device(), etc.), but this is not in fact enforced anywhere. This e.g. breaks log forwarding via the controller manager, where the device name is used as the log source, and line breaks and colons serve as special delimiters (but are not escaped).It would probably be fine to require the devices names to be valid Python identifiers. Alternatively – to avoid unnecessarily breaking backwards compatibility in case somebody does use non-identifier device names – perhaps we could at least restrict them to be single-line and not contain
:?