You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Tidy up: prevent path traversal via schema ID in the JTD-to-ESM CLI (JtdToEsmCli.java) #201
Sub-issue 22 of 26 from the 2026-11-21 bot-review-comment audit. Parent issue: #179 (Bot review comment tidy up).
Audited origin/main HEAD: 2e5cf37. Audit date: 2026-11-21.
== Finding 22 (verbatim from the audit findings file) ==
PR Port jtd-esm-codegen onto the incubator main #169 — CLI can write generated validators outside the requested output directory.
Author: chatgpt-codex-connector[bot], 2026-08-31. Comment: Port jtd-esm-codegen onto the incubator main #169 (comment)
Source: jtd-esm-codegen/src/main/java/io/github/simbo1905/json/jtd/codegen/JtdToEsmCli.java:50. Current: jtd-esm-codegen/src/main/java/io/github/simbo1905/json/jtd/codegen/JtdToEsmCli.java:49-51 (outDir.resolve(schema.id() + "-" + shaPrefix8 + ".js") then Files.writeString, no sanitization or containment check).
Flagged: "When metadata.id begins with / or contains ../, outDir.resolve(fileName) can resolve outside the requested output directory, and the subsequent Files.writeString truncates an existing file at that location... restrict the ID to a safe filename component and verify the normalized result remains under outDir".
Still applies: unchanged; untrusted schema IDs can overwrite arbitrary process-writable files.
Activity