Security Advisories (1)
CVE-2026-94140 (2026-10-21)

Rex versions through 1.16.1 for Perl accept an unknown SSH host key for remote rsync transfers because sync hardcodes StrictHostKeyChecking=no. Every remote branch of sync builds its ssh command with that option, for password authentication, for private-key authentication and for the fallback. The ssh options a caller sets through set_openssh_opt reach the OpenSSH transport but not this command, so there is no configuration that restores host key checking for the transfer. An attacker who can redirect the connection before the real host key is known presents their own and the transfer proceeds: under password authentication sync sends the connection password to that server, an upload writes the selected local files to it, and a download writes what it returns to the local destination.

NAME

Rex::Commands::Upload - Upload a local file to a remote server

DESCRIPTION

With this module you can upload a local file via sftp to a remote host.

SYNOPSIS

task "upload", "remoteserver", sub {
  upload "localfile", "/remote/file";
};

EXPORTED FUNCTIONS

upload($local, $remote)

Perform an upload. If $remote is a directory the file will be uploaded to that directory.

task "upload", "remoteserver", sub {
  upload "localfile", "/path";
};

This function supports the following hooks:

before

This gets executed before anything is done. All original parameters are passed to it.

The return value of this hook overwrites the original parameters of the function-call.

before_change

This gets executed right before the new file is written. The local file name, and the remote file name are passed as parameters.

after_change

This gets executed right after the file was written. On top of the local file name, and the remote file name, any returned results are passed as parameters.

after

This gets executed right before the upload() function returns. All original parameters, and any results returned are passed to it.