How to correct this error Input Validation Not Performed

Discussions on developing plugins for the Cacti Plugin Architecture

Moderators: Developers, Moderators

Post Reply
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

How to correct this error Input Validation Not Performed

Post by Rno »

Hello,
How can I solve this issue: (not harming at least)
14/05/2020 12:48:49 - CMDPHP Input Validation Not Performed for 'page' Backtrace: (/plugins/ciscotools/ciscotools_tab.php[63]:ciscotools_displaybackup(), /plugins/ciscotools/display_backup.php[30]:get_request_var(), /lib/html_utility.php[369]:html_log_input_error(), /lib/html_validate.php[44]:cacti_debug_backtrace())

it's when I do a call to this:
input_validate_input_number(get_request_var("page"));

When I display a page of value!
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
User avatar
TheWitness
Developer
Posts: 17047
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Re: How to correct this error Input Validation Not Performed

Post by TheWitness »

If the value is numeric, then simply get the variable using this function

$page = get_filter_request_var('page');

There are several 'FILTERS' that you can pass as secondary and tertiary options to the function, but the default is VALIDATE_INT. Once you have called that once, the remainder of the calls on that page can be made using 'get_request_var() function since the variable has already been validated and set in the $CACTI super global for tracking request variables.
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Rno
Cacti Pro User
Posts: 704
Joined: Wed Dec 07, 2011 9:19 am

Re: How to correct this error Input Validation Not Performed

Post by Rno »

Thanks for the answer, I did find those options, so I was able to solve this warning message,
Test
Almalinux
php 8.2.14
mariadb 10.6.16
Cacti 1.2.27
Spine 1.2.27
RRD 1.7.2
thold 1.8
monitor 2.5
syslog 3.2
flowview: 3.3
weathermap 1.0 Beta
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest