ROS 2 Navigation Framework Navigation2 AMCL Heap Out-of-Bounds Write Vulnerability Allowing Denial-of-Service and Potential Remote Code Execution
Vulnerability
A critical heap out-of-bounds write vulnerability has been identified in the ROS 2 Navigation Framework's Navigation2 package, specifically in the AMCL (Adaptive Monte Carlo Localization) component. This vulnerability exists in versions through 1.3.11. The issue arises in the particle filter clustering logic, where extreme covariance values can be injected into the /initialpose topic. An unauthenticated attacker on the same ROS 2 DDS domain can exploit this flaw, triggering a negative index write into heap memory. In release builds, the absence of proper boundary checks allows for unchecked writes, leading to heap corruption. This vulnerability not only disrupts localization and navigation processes but also has the potential for more severe exploitation, such as remote code execution.
Impact
Exploitation of this vulnerability causes a heap-based buffer overflow, leading to a crash of the AMCL node. This disruption destroys the robot's localization and navigation capabilities, causing a complete operational shutdown. Additionally, the heap corruption can be manipulated to achieve remote code execution, with the executed code running under the privileges of the Nav2 process, which is typically as root or a privileged user on robotic platforms.
Reproduction
The vulnerability can be reproduced by publishing a crafted geometry_msgs/PoseWithCovarianceStamped message with extreme covariance values to the /initialpose topic. This can be done using a ROS 2 launch file that sets up the necessary environment and publishes the message. The extreme covariance values should be chosen to trigger the heap out-of-bounds write by causing the particle filter clustering logic to misinterpret the data and write beyond the allocated memory buffer.
Vulnerability Rating
Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.
