Skip to content

Commit 3849992

Browse files
committed
patch 7.4.1777
Problem: Newly added features can escape the sandbox. Solution: Add checks for restricted and secure. (Yasuhiro Matsumoto)
1 parent a1c487e commit 3849992

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/eval.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10408,6 +10408,8 @@ f_ch_logfile(typval_T *argvars, typval_T *rettv UNUSED)
1040810408
f_ch_open(typval_T *argvars, typval_T *rettv)
1040910409
{
1041010410
rettv->v_type = VAR_CHANNEL;
10411+
if (check_restricted() || check_secure())
10412+
return;
1041110413
rettv->vval.v_channel = channel_open_func(argvars);
1041210414
}
1041310415

@@ -15078,6 +15080,8 @@ f_job_setoptions(typval_T *argvars, typval_T *rettv UNUSED)
1507815080
f_job_start(typval_T *argvars, typval_T *rettv)
1507915081
{
1508015082
rettv->v_type = VAR_JOB;
15083+
if (check_restricted() || check_secure())
15084+
return;
1508115085
rettv->vval.v_job = job_start(argvars);
1508215086
}
1508315087

@@ -16821,8 +16825,6 @@ check_connection(void)
1682116825
#endif
1682216826

1682316827
#ifdef FEAT_CLIENTSERVER
16824-
static void remote_common(typval_T *argvars, typval_T *rettv, int expr);
16825-
1682616828
static void
1682716829
remote_common(typval_T *argvars, typval_T *rettv, int expr)
1682816830
{
@@ -20683,6 +20685,8 @@ f_timer_start(typval_T *argvars, typval_T *rettv)
2068320685
char_u *callback;
2068420686
dict_T *dict;
2068520687

20688+
if (check_secure())
20689+
return;
2068620690
if (argvars[2].v_type != VAR_UNKNOWN)
2068720691
{
2068820692
if (argvars[2].v_type != VAR_DICT

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,6 +753,8 @@ static char *(features[]) =
753753

754754
static int included_patches[] =
755755
{ /* Add new patch number below this line */
756+
/**/
757+
1777,
756758
/**/
757759
1776,
758760
/**/

0 commit comments

Comments
 (0)