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
The eval viewer's safeJoin allows a sibling directory sharing the runs prefix #3761
The eval viewer's safeJoin allows a sibling directory sharing the runs prefix
Summary
The eval viewer's safeJoin checks only startsWith(path.resolve(root)). A sibling directory whose name begins with the runs root name passes the check. A crafted request can therefore read a JSON run artifact from outside the configured runs directory.
path.resolve(root, '../runs-other/...') produces a path that still starts with the root string (.../runs-other starts with .../runs). startsWith therefore accepts it.
Suggested fix
Append a path separator to the root before comparing, or use path.relative and reject results starting with .. or absolute paths:
Activity
pulpdrew commentedon Nov 23, 2026
Impact: someone who can reach the viewer can read .json files from any folder next to runs/ whose name starts with "runs". In practice:
So there is almost no practical risk or impact. Feel free to raise a PR if there this is actually impacting you.