SIGN IN SIGN UP

fix: Deno sandbox file path shell injection (#664)

## Summary

Fixes the Deno sandbox file-operation shell injection findings from
Corridor category 2:

- `67480dc4-15f8-48fc-925d-4b0e144832c1` — `DenoSandbox.uploadFiles()`
interpolated `parentDir` into `mkdir -p "${parentDir}"` through
`/bin/bash -c`
- `7d707e16-90a6-4231-974f-d2831971687b` — `DenoSandbox.downloadFiles()`
interpolated `path` into `cat "${path}"` through `/bin/bash -c`

## Changes

- Replace shell-interpreted `mkdir -p` with direct argv execution:
`/bin/mkdir`, `args: ["-p", parentDir]`
- Replace shell-interpreted `cat` with direct argv execution:
`/bin/cat`, `args: [path]`
- Add regression tests covering paths containing `$()` to ensure
file-operation paths are passed as literal argv values and not routed
through `/bin/bash`

## Security notes

This removes command substitution / shell metacharacter interpretation
from Deno `uploadFiles()` and `downloadFiles()` paths. It does not
attempt to solve broader path containment findings in the filesystem
category; those should remain a separate hardening patch.

## Test plan

- `git diff --check` ✅
- Verified the vulnerable Deno patterns are removed from
`libs/providers/deno/src` ✅
- `pnpm --dir /tmp/deepagentsjs --filter "@langchain/deno" test:unit` ⚠️
could not run locally because this sandbox has no `node_modules`;
dependency install was blocked by Socket Firewall failing to fetch its
GitHub release binary with HTTP 502. The repo also requires Node >=22.13
for the pinned pnpm, so I used a temporary Node 22.13.1 binary for the
attempted test run.

CI should run the full Deno provider unit tests.

Co-authored-by: Langster <john@langchain.dev>
L
langsmith-fleet[bot] committed
2d1b39bd297c31e3e2327637f0f78ce75e5395cd
Parent: 1b8528b
Committed by GitHub <noreply@github.com> on 7/9/2026, 4:07:26 AM