Skip to content

Commit 5459890

Browse files
Copilotbbartels
andauthored
fix: validate RVM_INSTALL_MIRROR input for safe bootstrap
Agent-Logs-Url: https://github.com/bbartels/features/sessions/47fca3d3-4eb7-487d-9af5-e4b462552066 Co-authored-by: bbartels <[email protected]>
1 parent 8ae2156 commit 5459890

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/ruby/install.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,11 @@ validate_mirror_url() {
340340
run_rvm_installer() {
341341
local install_args="$1"
342342
if [ -n "${RVM_INSTALL_MIRROR:-}" ]; then
343+
if [[ "${RVM_INSTALL_MIRROR}" == *$'\n'* ]]; then
344+
echo "(!) RVM_INSTALL_MIRROR must not contain newlines."
345+
exit 1
346+
fi
347+
validate_mirror_url "RVM_INSTALL_MIRROR" "${RVM_INSTALL_MIRROR}"
343348
local rvm_tmp_dir
344349
rvm_tmp_dir="$(mktemp -d)"
345350
git clone --depth=1 "${RVM_INSTALL_MIRROR}/rvm/rvm.git" "${rvm_tmp_dir}/rvm"

0 commit comments

Comments
 (0)