diegosouzapw/OmniRoute · error · Error

Video runtime requires a local path

Error message

Video runtime requires a local path

What it means

Security guard assertLocalPath in videoBridgeRuntime: the given file path is not an absolute local filesystem path — it is relative, contains a NUL byte, or embeds a URL scheme (contains '://'). ffprobe/ffmpeg are only ever invoked on local files, so remote or malformed paths are refused before any execFile call.

Solutions

  1. Download remote videos to a temp file before invoking the local runtime
  2. Resolve relative paths to absolute ones at the caller boundary
  3. Keep the NUL-byte and '://' checks; they prevent command/scheme injection into execFile
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/guardrails/videoBridgeRuntime.ts:148 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/a4e6d16d55a5cf32. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/guardrails/videoBridgeRuntime.ts:148

  "mov",
  "mp4",
  "ogg",
  "webm",
]);
const SAFE_FORMAT_WHITELIST = [...SAFE_FORMATS].join(",");
const defaultRunner: VideoCommandRunner = async (executable, args, options) => {
  const result = await execFileAsync(executable, [...args], {
    encoding: "utf8",
    maxBuffer: 1024 * 1024,
    signal: options.signal,
    timeout: options.timeoutMs,
    windowsHide: true,
  });
  return { stdout: String(result.stdout), stderr: String(result.stderr) };
};
function assertLocalPath(filePath: string): void {
  if (!isAbsolute(filePath) || filePath.includes("\0") || filePath.includes("://")) {
    throw new Error("Video runtime requires a local path");
  }
}

function parseVersion(output: string): string | null {
  const version = /\bversion\s+([^\s]+)/i.exec(output)?.[1];
  return version ? version.slice(0, 80).replace(/[^A-Za-z0-9._+-]/g, "_") : null;
}

let runtimeProbeCache: { expiresAt: number; value: VideoRuntimeStatus } | null = null;

export function resetVideoRuntimeProbeCacheForTests(): void {
  runtimeProbeCache = null;
}

export async function probeVideoRuntime(
  options: {
    cacheTtlMs?: number;
    runner?: VideoCommandRunner;

View on GitHub (pinned to a179ffed5b)