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
fix(security): validate upload paths to prevent file exfiltration (PMAA-107)
All four file-upload paths (testmanagement uploadFile, applive uploadApp,
appautomate uploadApp, and the shared uploadFileToBrowserStack helper used
by Espresso/XCUITest) previously only checked `fs.existsSync` before
streaming the file to BrowserStack cloud. A prompt-injected LLM turn could
exfiltrate arbitrary user-readable files (SSH keys, .env, credentials).
Adds a shared `validateUploadPath` utility that canonicalizes the path via
`realpathSync`, enforces a per-call extension allowlist, caps file size
(4 GB for apps to match BrowserStack's upload limit, 100 MB for TM
attachments), blocks hidden-directory traversal (`.ssh`, `.aws`, `.env`,
etc.), and optionally enforces containment inside `MCP_UPLOAD_BASE_DIR`
when configured.
Covers CWE-22 / CWE-434 / OWASP A01:2025.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments