C++Severity: LowStatus: Fixed

Cyclic <include><uri> overflows the stack when parsing SDF

A crafted SDF file whose include uri chain loops back on itself makes the parser recurse until the stack overflows and the process crashes. readFileInternal had no cycle check. The public issue records the risk as low. There is no advisory and no CVE. Reported in public issue #1746 by ucsurf; fixed by ucsurf in PR #1745 (merged by @scpeters). The fix detects the cycle and returns a FILE_READ error. It does not cap a long chain of distinct files. Fixed on main; not yet in a release.

The issue

A crafted SDF file whose <include><uri> chain loops back on itself, including a file that includes itself, makes the parser re-enter readFileInternal with no cycle check. Parsing recurses until the stack overflows and the process crashes.

The public issue records the risk as low. There is no advisory and no CVE.

The fix

Reported in public issue 1746 by ucsurf; fixed by ucsurf in PR 1745 (merged by @scpeters). The pull request was merged into main on 2026-12-02 as 6b7edcd4. The fix detects the cycle and returns a FILE_READ error. It does not cap a long chain of distinct files. Fixed on main; not yet in a release.

Timeline

Fixed upstream 2 days after it was found.

  1. Found
  2. Reported via public issue
  3. Disclosed publicly
  4. Fix merged
  5. Entry last updated

Machine-readable: JSON · Markdown · ID security/cpp/gazebosim__sdformat/2026-11-30-cyclic-include-uri-stack-overflow

If this work is useful to you, you can support it on Buy Me a Coffee.