Skip to content

Commit 0317136

Browse files
committed
Add buildparam validation
to minimize risk to OBS operations. The pattern for jobs deliberately does not have a * or + to not allow DoS or integer overflows.
1 parent 7427946 commit 0317136

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

build

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1370,7 +1370,15 @@ done
13701370
}
13711371
buildparams=()
13721372
if [ -e _buildparams ] ; then
1373+
local n=0
13731374
while read ARG ; do
1375+
let n++
1376+
if ! [[ $ARG =~ ^--jobs=[1-9]$ ]] &&
1377+
! [[ $ARG =~ ^--vm-custom-opt=-cpu\ [a-zA-Z0-9=,_+-]+$ ]]
1378+
then
1379+
echo "buildparams line $n did not match whitelist in $BASH_SOURCE => skipping"
1380+
continue
1381+
fi
13741382
buildparams+=("$ARG")
13751383
done < _buildparams
13761384
fi

0 commit comments

Comments
 (0)