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::Shared::Var - Share variables across Rex tasks

DESCRIPTION

Share variables across Rex tasks with the help of Storable, using a vars.db.$PID file in the local directory, where $PID is the PID of the parent process.

SYNOPSIS

BEGIN {                           # put share in a BEGIN block
  use Rex::Shared::Var;
  share qw($scalar @array %hash); # share the listed variables
}

LIMITATIONS

Currently nesting data structures works only if the assignment is made on the top level of the structure, or when the nested structures are also shared variables. For example:

BEGIN {
  use Rex::Shared::Var;
  share qw(%hash %nested);
}

# this doesn't work as expected
$hash{key} = { nested_key => 42 };
$hash{key}->{nested_key} = -1; # $hash{key}->{nested_key} still returns 42

# workaround 1 - top level assignments
$hash{key} = { nested_key => 42 };
$hash{key} = { nested_key => -1 };

# workaround 2 - nesting shared variables
$nested{nested_key}      = 42;
$hash{key}               = \%nested;
$hash{key}->{nested_key} = -1;

METHODS

share

Share the passed list of variables across Rex tasks. Should be used in a BEGIN block.

BEGIN {
  use Rex::Shared::Var;
  share qw($error_count);
}

task 'count', sub {
  $error_count += run 'wc -l /var/log/syslog';
};

after_task_finished 'count', sub {
  say "Total number of errors: $error_count";
};