Skip to content

Commit 8fb3fdc

Browse files
Prevent command injection in includedir/libdir in configure.ac.
Thanks to NVIDIA Project Vanessa for the report.
1 parent 6ff1f8f commit 8fb3fdc

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

configure.ac

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12489,6 +12489,16 @@ if test "x$WOLFSSL_EXEC_PREFIX_ABS" = "xNONE"; then
1248912489
fi
1249012490
prefix=$WOLFSSL_PREFIX_ABS
1249112491
exec_prefix=$WOLFSSL_EXEC_PREFIX_ABS
12492+
# The eval calls below expand ${prefix}/${exec_prefix} references embedded in
12493+
# the libdir/includedir values. eval would, however, also execute any shell
12494+
# command substitution contained in a --libdir/--includedir value (e.g.
12495+
# --libdir='$(cmd)/lib'), running arbitrary commands during configure.
12496+
# Reject values that contain command substitution before the eval.
12497+
case "$libdir $includedir" in
12498+
*'`'* | *'$('*)
12499+
AC_MSG_ERROR([--libdir and --includedir must not contain shell command substitution])
12500+
;;
12501+
esac
1249212502
eval WOLFSSL_LIBDIR_ABS=\"$libdir\"
1249312503
eval WOLFSSL_INCLUDEDIR_ABS=\"$includedir\"
1249412504
AC_SUBST([WOLFSSL_PREFIX_ABS])

0 commit comments

Comments
 (0)