Back to Intelligence

ZDI-26-1019: Unpatched XXE Flaw in ROS 2 sros2 load_policy — Detection and Hardening Guide for Robotics Environments

SA
Security Arsenal Team
November 19, 2026
13 min read

The Zero Day Initiative has published ZDI-26-1019, an unpatched XML External Entity (XXE) processing vulnerability in Open Robotics ROS 2 (Robot Operating System 2), specifically in the sros2 security tooling's load_policy function. The flaw carries a CVSS score of 5.5 and allows a remote attacker to disclose sensitive information from affected installations — but only if a user or automated process loads a malicious policy file.

At first glance, a 5.5 Medium with a user-interaction requirement sounds like a low-priority ticket. That reading is dangerous in robotics environments. ROS 2 is not a desktop productivity app — it is the middleware backbone of autonomous vehicles, industrial robot arms, warehouse AMRs, drones, and medical robotics. The sros2 keystore and policy artifacts govern DDS (Data Distribution Service) security: identity certificates, permissions, and governance documents. A successful XXE against load_policy can exfiltrate files readable by the ROS process — private keys from the sros2 keystore, environment configs, credentials in plain-text launch files, or /etc/passwd — straight to an attacker-controlled host.

Worse, there is no vendor fix available at the time of this writing. ZDI published this as a zero-day after the coordinated disclosure timeline expired. That means your only protection right now is compensating controls, detection, and disciplined policy-file hygiene. This post gives you all three.

Technical Analysis

Affected Component

  • Product: Open Robotics ROS 2, sros2 package (the security utilities for ROS 2: ros2 security CLI, keystore generation, policy/permission management)
  • Vulnerable function: load_policy — the XML policy file parser used when loading permissions and governance documents for SROS2-enabled (secure DDS) deployments
  • Platforms: All platforms where ROS 2 runs — Ubuntu Linux (primary), RHEL, Windows, and macOS; including embedded/ARM targets common in deployed robots
  • Advisory: ZDI-26-1019 (http://www.zerodayinitiative.com/advisories/ZDI-26-1019/)
  • CVSS: 5.5 (Medium) — reflecting local attack vector mechanics, user interaction, high confidentiality impact, no integrity/availability impact
  • Patch status: None. This is an unpatched zero-day.

How the Vulnerability Works

sros2 defines access control for ROS 2 nodes through XML policy documents (profiles, permissions, grants, subject names). The load_policy function parses these XML files — and the underlying parser processes external entities without restriction.

XXE is a well-understood class (CWE-611): when an XML parser resolves external entities or external DTDs declared in a document, an attacker can craft a payload like a <!DOCTYPE> block containing <!ENTITY xxe SYSTEM "file:///path/to/sensitive/file"> and then reference &xxe; inside an element the application later reflects, logs, errors on, or transmits. Variants using external DTDs over HTTP enable out-of-band exfiltration, which works even when the parsed content is never echoed back to the attacker — the parser itself makes the outbound connection carrying the file contents.

The attack chain looks like this:

  1. Attacker delivers a malicious .policy.xml (or similarly named permissions/governance XML) to the victim — via a malicious page, a poisoned artifact repository, a compromised CI pipeline, phishing, or a shared robotics development workspace.
  2. An engineer, operator, or automation job loads the file through sros2 tooling (e.g., generating permissions, configuring a keystore, or launching a secured ROS 2 graph with that policy).
  3. load_policy parses the XML, resolves the external entity, reads a local file (keystore private key, cert, environment file), and — in out-of-band variants — the parser fetches an external DTD from the attacker's server with the file contents embedded in the request.
  4. The attacker now holds material that can break the entire SROS2 trust model: stolen CA or identity keys mean the attacker can sign malicious permissions, impersonate legitimate nodes on the DDS bus, and pivot from information disclosure to full command injection into robot behavior.

That last point is why a "5.5 Medium" deserves your attention. In SROS2 architectures, confidentiality of the keystore is the root of all integrity. Losing ca.key.pem or an identity key doesn't just leak data — it compromises the authentication fabric of every node in the secured graph.

Exploitation Status

  • In-the-wild exploitation: None confirmed publicly as of this writing.
  • Public PoC: No weaponized PoC has been observed, but ZDI's advisory documents the vulnerable code path, and XXE exploitation is textbook — expect working payloads to surface quickly in CTF and research circles.
  • CISA KEV: Not listed (not exploitable at scale remotely without user interaction, so unlikely to be added unless chained).
  • Patch: None. Treat this as an active exposure requiring compensating controls.

Detection & Response

Since there is no patch, detection is your primary defense. The observable behaviors are: (1) sros2/ros2 security tooling loading policy files from unusual locations, (2) XML policy artifacts containing DOCTYPE/ENTITY declarations — which have no legitimate reason to exist in sros2 policy files, and (3) Python processes belonging to ROS tooling making unexpected outbound network connections (external DTD/entity retrieval).

Sigma Rules

YAML
---
title: ROS 2 sros2 Policy Loaded From Untrusted Location
id: 3f8a2c71-9d4e-4b6a-a1f2-7c5e9d0b3a81
status: experimental
description: Detects ROS 2 sros2 security tooling loading policy or permission XML files from user-writable or temporary directories, consistent with exploitation of ZDI-26-1019 (XXE in sros2 load_policy).
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1019/
  - https://attack.mitre.org/techniques/T1059/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.execution
  - attack.t1059
logsource:
  category: process_creation
  product: linux
detection:
  selection_tool:
    CommandLine|contains:
      - 'ros2 security'
      - 'sros2'
      - 'load_policy'
  selection_policy_path:
    CommandLine|contains:
      - '.policy.xml'
      - 'permissions.xml'
      - 'governance.xml'
  selection_untrusted:
    CommandLine|contains:
      - '/tmp/'
      - '/var/tmp/'
      - '/dev/shm/'
      - '/Downloads/'
      - '/uploads/'
  condition: selection_tool and selection_policy_path and selection_untrusted
falsepositives:
  - Developers testing policy files in scratch directories during legitimate SROS2 configuration
level: high
---
title: Suspicious External Entity Markup in ROS 2 Policy XML File Creation
id: 8b1d4e62-2c7a-4f39-b6d4-1a9e3c7f52b0
status: experimental
description: Detects creation of ROS 2 policy/permissions XML files in temp or download locations. Legitimate sros2 policy files are generated by the tooling itself and never distributed through temp directories; files there may carry XXE payloads targeting ZDI-26-1019.
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1019/
  - https://attack.mitre.org/techniques/T1204/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.initial_access
  - attack.t1204.002
logsource:
  category: file_event
  product: linux
detection:
  selection_filename:
    TargetFilename|endswith:
      - '.policy.xml'
      - 'permissions.xml'
      - 'governance.xml'
  selection_paths:
    TargetFilename|contains:
      - '/tmp/'
      - '/var/tmp/'
      - '/dev/shm/'
      - '/Downloads/'
  condition: selection_filename and selection_paths
falsepositives:
  - Rare; policy files legitimately land in keystores under dedicated directories, not temp paths
level: medium
---
title: ROS 2 Python Process Outbound Connection - Possible XXE Exfiltration
id: 5c2e7f48-1b3d-4a95-8e6c-2d4f8a1b63c9
status: experimental
description: Detects Python processes associated with ROS 2 tooling initiating outbound HTTP/HTTPS connections to non-loopback destinations, consistent with external DTD/entity retrieval during XXE exploitation of sros2 load_policy (ZDI-26-1019).
references:
  - http://www.zerodayinitiative.com/advisories/ZDI-26-1019/
  - https://attack.mitre.org/techniques/T1048/
author: Security Arsenal
date: 2026/02/09
tags:
  - attack.exfiltration
  - attack.t1048
logsource:
  category: network_connection
  product: linux
detection:
  selection_image:
    Image|contains:
      - '/python'
  selection_ros_context:
    CommandLine|contains:
      - 'ros2 security'
      - 'sros2'
  selection_dst:
    DestinationPort:
      - 80
      - 443
      - 8080
      - 8443
  filter_loopback:
    DestinationIp|startswith:
      - '127.'
      - '10.'
      - '172.16.'
      - '192.168.'
  condition: selection_image and selection_ros_context and selection_dst and not filter_loopback
falsepositives:
  - Package index access if pip is invoked in the same interpreter context; tune per environment
level: high

KQL — Microsoft Sentinel / Defender

ROS 2 hosts are predominantly Linux, so this query runs against Syslog ingested into Sentinel (via the Syslog/CEF connector or AMA), with a Defender variant for any Windows-based ROS 2 development workstations.

KQL — Microsoft Sentinel / Defender
// Hunt for sros2 tooling loading policy files from untrusted paths, and
// ROS/python processes making outbound connections (possible XXE external DTD fetch)
let Lookback = 14d;
let SuspiciousPaths = dynamic(["/tmp/", "/var/tmp/", "/dev/shm/", "/Downloads/", "/uploads/"]);
let PolicyArtifacts = dynamic([".policy.xml", "permissions.xml", "governance.xml"]);
union isfuzzy=true
(
    Syslog
    | where TimeGenerated > ago(Lookback)
    | where ProcessName has_any ("python", "ros2")
    | where SyslogMessage has_any ("sros2", "ros2 security", "load_policy")
    | where SyslogMessage has_any (PolicyArtifacts)
    | where SyslogMessage has_any (SuspiciousPaths)
    | extend SuspiciousPathMatch = extract(@"(/tmp/[^\s]+|/var/tmp/[^\s]+|/dev/shm/[^\s]+|/home/[^\s]+/Downloads/[^\s]+)", 1, SyslogMessage)
    | project TimeGenerated, Computer, ProcessName, SyslogMessage, SuspiciousPathMatch
),
(
    DeviceProcessEvents
    | where TimeGenerated > ago(Lookback)
    | where ProcessCommandLine has_any ("ros2 security", "sros2", "load_policy")
    | where ProcessCommandLine has_any (SuspiciousPaths)
    | project TimeGenerated, DeviceName, FileName, ProcessCommandLine, AccountName, InitiatingProcessFileName
)
| sort by TimeGenerated desc;
// Companion hunt: outbound web connections from python interpreters on ROS hosts
// (correlate with the hosts identified above)
DeviceNetworkEvents
| where TimeGenerated > ago(Lookback)
| where InitiatingProcessFileName has "python"
| where InitiatingProcessCommandLine has_any ("ros2 security", "sros2")
| where RemotePort in (80, 443, 8080, 8443)
| where RemoteIPType == "Public"
| summarize Connections = count(), RemoteIPs = make_set(RemoteUrl), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
    by DeviceName, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Connections desc;

Velociraptor VQL — Hunt for XXE Payloads in Policy Files

This artifact recursively locates sros2 policy XML files on endpoints and inspects their content for DOCTYPE/ENTITY declarations — the smoking gun of an XXE payload. Legitimate sros2 policy files contain neither.

VQL — Velociraptor
-- Hunt for XXE constructs in ROS 2 sros2 policy files (ZDI-26-1019)
-- Any DOCTYPE, ENTITY, or SYSTEM reference in a policy file is malicious until proven otherwise
LET policy_files = SELECT FullPath, Size, Mtime
FROM glob(globs=['/**/*.policy.xml', '/**/permissions.xml', '/**/governance.xml'],
          root='/', accessor='file')
WHERE NOT FullPath =~ '/proc/|/sys/'

SELECT FullPath, Size, Mtime,
       read_file(filename=FullPath, length=65536) AS Content,
       if(condition=read_file(filename=FullPath, length=65536) =~ '<!DOCTYPE|<!ENTITY|SYSTEM\s+"(file|http|https|ftp):',
          then='SUSPICIOUS - XXE CONSTRUCT PRESENT',
          else='clean') AS Verdict
FROM policy_files
WHERE Content =~ '<!DOCTYPE|<!ENTITY|SYSTEM\s+"(file|http|https|ftp):'

Also hunt live process state on robot hosts for in-flight policy loads:

VQL — Velociraptor
-- Enumerate running ROS 2 security tooling with policy file arguments
SELECT Pid, Name, CommandLine, Exe, Username, CreateTime
FROM pslist()
WHERE CommandLine =~ 'ros2 security|sros2|load_policy'
  AND CommandLine =~ '/tmp/|/var/tmp/|/dev/shm/|Downloads'

Remediation & Hardening Script

The following Bash script audits ROS 2 hosts: it inventories sros2 policy files, flags any containing XXE constructs, reports the installed sros2 version, checks for the availability of a hardened XML parser, and optionally applies an egress restriction to blunt out-of-band exfiltration while a patch is pending.

Bash / Shell
#!/usr/bin/env bash
# ZDI-26-1019 - ROS 2 sros2 load_policy XXE audit & hardening
# Run as root on ROS 2 workstations, build servers, and deployed robot hosts.
set -euo pipefail

echo "=== [1] Installed sros2 version ==="
if command -v ros2 >/dev/null 2>&1; then
  ros2 pkg xml sros2 2>/dev/null | grep -oP '<version>\K[^<]+' || echo "sros2 package XML not readable"
  pip3 show sros2 2>/dev/null | grep -E '^(Name|Version|Location)' || true
else
  echo "ros2 CLI not found on PATH"
fi

echo ""
echo "=== [2] Scanning for policy/permissions/governance XML with XXE constructs ==="
FOUND=0
while IFS= read -r -d '' f; do
  if grep -qE '<!DOCTYPE|<!ENTITY|SYSTEM[[:space:]]+"(file|http|https|ftp):' "$f" 2>/dev/null; then
    echo "[!] SUSPICIOUS XXE MARKUP: $f"
    grep -nE '<!DOCTYPE|<!ENTITY|SYSTEM[[:space:]]+"' "$f" | head -5
    FOUND=1
  fi
done < <(find /home /opt /srv /tmp /var/tmp /root -xdev \
  \( -name '*.policy.xml' -o -name 'permissions.xml' -o -name 'governance.xml' \) \
  -type f -print0 2>/dev/null)
[ "$FOUND" -eq 0 ] && echo "OK - no DOCTYPE/ENTITY constructs found in policy files."

echo ""
echo "=== [3] Keystore exposure check (private keys must be 0600, root or service account owned) ==="
find /home /opt /srv -xdev -name '*.key.pem' -o -name 'ca.key.pem' 2>/dev/null | while read -r k; do
  stat -c '%a %U:%G %n' "$k"
done | awk '$1 != "600" {print "[!] WEAK PERMISSIONS: "$0; next} {print "OK: "$0}'

echo ""
echo "=== [4] Check whether defusedxml is available (hardened parser) ==="
python3 -c "import defusedxml; print('defusedxml', defusedxml.__version__, 'available')" 2>/dev/null \
  || { echo "defusedxml MISSING - install it: pip3 install defusedxml"; }

echo ""
echo "=== [5] Optional: egress control for ROS service account (blunts OOB exfiltration) ==="
cat <<'EOF'
# Example: block outbound HTTP/HTTPS for the robot service account until patched.
# Review before applying - may break legitimate telemetry/cloud integration.
#   sudo iptables -A OUTPUT -m owner --uid-owner ros -p tcp -m multiport --dports 80,443 -j REJECT
#   sudo ip6tables -A OUTPUT -m owner --uid-owner ros -p tcp -m multiport --dports 80,443 -j REJECT
EOF

echo ""
echo "=== Audit complete. Any [SUSPICIOUS] file above must be quarantined and the host triaged for keystore compromise. ==="

If any policy file is flagged, assume the worst: treat the host's keystore as compromised, rotate the SROS2 CA and all identity certificates, and reissue permissions from a clean governance document.

Remediation

There is no patch. Until Open Robotics ships a fixed sros2 release, implement the following in order of priority:

  1. Enforce trusted provenance for policy files. Establish an allowlist: sros2 policy, permissions, and governance XML may only be loaded from controlled paths (e.g., a configuration-management-deployed directory with root-only write). Never load policy files received via email, chat, web download, or third-party artifact feeds. Verify signatures or hashes on policy artifacts before load.
  2. Pre-parse validation gate. Add a CI/CD or pre-deployment step that rejects any XML containing <!DOCTYPE, <!ENTITY, or SYSTEM URIs. Legitimate sros2 policy files never use these constructs, so this check has zero false-positive cost. The Bash script above can be dropped into pipelines directly.
  3. Harden the parser layer. If your organization vendors or wraps sros2 tooling, route parsing through defusedxml (which disables entity resolution and DTDs by default) or set equivalent flags on the underlying lxml/ElementTree parser (resolve_entities=False, no_network=True). Do not monkey-patch blindly on production robots — test in staging first.
  4. Restrict egress from robot hosts and ROS workstations. Out-of-band XXE exfiltration requires outbound HTTP/HTTPS from the parsing host. Robotics fleets should already be egress-restricted; if yours aren't, deny outbound web traffic for ROS service accounts now. This single control neuters the exfiltration channel even if a malicious file is loaded.
  5. Protect the keystore as Tier-0 material. Ensure ca.key.pem and identity keys are mode 0600, owned by the service account, and — where feasible — moved to hardware-backed storage (TPM/HSM) so file-read primitives like XXE cannot reach them. Audit current permissions using the script above.
  6. Isolate DDS security administration. Policy generation and keystore operations should happen on a hardened, network-restricted admin host — never on deployed robots and never from an engineer's daily-driver workstation that browses the web.
  7. Monitor upstream. Track the ZDI-26-1019 advisory, the ros2/sros2 GitHub repository, and Open Robotics security announcements (discourse.ros.org) for the fix. When a patched sros2 lands, prioritize deployment to internet-reachable development infrastructure and any fleet that ingests third-party configuration. Subscribe your vulnerability-management pipeline to the ROS security advisories feed so the patch triggers an SLA'd remediation ticket automatically.
  8. If compromise is suspected: rotate the entire SROS2 keystore — CA, all identity certs, and permissions — on affected segments. Partial rotation leaves impersonation paths open on the DDS bus.

Conclusion

ZDI-26-1019 is a reminder that robotics security debt looks different from enterprise IT debt. A Medium-severity XXE in a policy loader becomes a fleet-wide trust compromise the moment a keystore key walks out the door. With no patch available, your defense is procedural and detective: strict policy-file provenance, content validation that rejects DOCTYPE/ENTITY constructs, egress restriction, keystore hardening, and the detection content above deployed today — not after the fix ships.

Related Resources

Security Arsenal Penetration Testing Services AlertMonitor Platform Book a SOC Assessment vulnerability-management Intel Hub

Is your security operations ready?

Get a free SOC assessment or see how AlertMonitor cuts through alert noise with automated triage.