Skip to content

Commit 5ffb61c

Browse files
committed
Sec: Fix input validation in v-acknowledge-user-notification
'nid' input argument was missing a format validator 'id' must be defined and int
1 parent 3bfd817 commit 5ffb61c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/v-acknowledge-user-notification

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# Argument definition
1313
user=$1
14-
nid=$2
14+
id=$2
1515

1616
# Includes
1717
source $HESTIA/func/main.sh
@@ -23,7 +23,7 @@ source $HESTIA/conf/hestia.conf
2323
#----------------------------------------------------------#
2424

2525
check_args '2' "$#" 'USER NOTIFICATION'
26-
is_format_valid 'user' 'nid'
26+
is_format_valid 'user' 'id'
2727
is_object_valid 'user' 'USER' "$user"
2828

2929
# Perform verification if read-only mode is enabled
@@ -35,7 +35,7 @@ check_hestia_demo_mode
3535
#----------------------------------------------------------#
3636

3737
# Updating notification
38-
update_object_value 'notifications' 'NID' "$nid" '$ACK' 'yes' 2>/dev/null
38+
update_object_value 'notifications' 'NID' "$id" '$ACK' 'yes' 2>/dev/null
3939

4040
# Checking last notification
4141
if [ -e "$USER_DATA/notifications.conf" ]; then

0 commit comments

Comments
 (0)