PythonSeverity: MediumStatus: Fixed
ROS1 deserializer loops on a short sequence of zero-size nested messages
The ROS1 deserializer accepted a uint32 element count for a nested message type whose minimum wire size was 0. A four-byte count of 0xffffffff for a zero-size element, such as std_msgs/msg/Empty, passed that check, and the loop then ran once per element. The same pattern was in the ROS1-to-CDR path. The reviewed release was 0.11.10. Reported in public issue #142 by ucsurf. Marko Durkovic fixed it in commit 0f781b3. The 0.11.11 changelog says “Prevent denial of service from crafted ROS1 sequences of zero-size messages” and links issue 142. It names no one. Released in 0.11.11.
The issue
In the ROS1 deserializer, a sequence of a nested message type is prefixed with a uint32 element count. The size check uses a minimum of 0 for nested types. A message type that occupies no bytes on the ROS1 wire, such as std_msgs/msg/Empty, can therefore carry a count of 0xffffffff in four bytes. The loop then runs once per element. The same minimum and loop are in the ROS1-to-CDR conversion. The CDR (ROS2) generator uses a minimum of 1 for nested types and is not affected in the same way.
The reviewed tree was release 0.11.10. This path is reached from AnyReader.deserialize and from rosbags-convert when converting ROS1 to rosbag2.
The fix
Reported in public issue 142 by ucsurf. Marko Durkovic fixed it in 0f781b3, “Bound zero-size ROS1 message sequence processing”, on 2026-11-27. The issue was closed the same day.
The 0.11.11 changelog says “Prevent denial of service from crafted ROS1 sequences of zero-size messages” and links issue 142. It names no one. The release is v0.11.11.
Timeline
- Found
- Reported via public issue
- Disclosed publicly
- Entry last updated
Machine-readable: JSON · Markdown · ID security/python/ternaris__rosbags/2026-11-26-ros1-zero-size-sequence-loop
If this work is useful to you, you can support it on Buy Me a Coffee.