Backport 0.9.41 / 0.9.44 fixes for possible path traversal issues

Source: Fedora 44 rubygem-yard High Path Traversal Fix Vuln 2026-acefc1fe48