security(pty,sftp): fix PTY cwd injection/recording/crashes & harden + upgrade SFTP manager
This commit is contained in:
parent
716627afdd
commit
838e69ba4e
6 changed files with 605 additions and 94 deletions
|
|
@ -567,9 +567,10 @@ export class MockSshServer {
|
|||
rawCommand: string,
|
||||
): { stdout: Buffer; stderr?: string; exitCode: number } | null {
|
||||
// Support streamed SFTP folder archive command in integration tests
|
||||
const tarMatch = /tar -C ('(?:[^']|'\\'')*'|\S+) -cf - ('(?:[^']|'\\'')*'|\S+) \| gzip -c/.exec(
|
||||
rawCommand,
|
||||
);
|
||||
const tarMatch =
|
||||
/tar (?:--one-file-system )?-C ('(?:[^']|'\\'')*'|\S+) -cf - (?:-- )?('(?:[^']|'\\'')*'|\S+) \| gzip -c/.exec(
|
||||
rawCommand,
|
||||
);
|
||||
if (tarMatch) {
|
||||
try {
|
||||
const virtualParent = unquoteSinglePosix(tarMatch[1]!);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue