there are two possible injection vectors, server side and client side
-
server side – Just don’t write your own SQL and use the more high level DB access APIs, in your case probably
update_option
. If you must to access the DB at lower level make sure the API use wpdb::prepare while generating the SQL, which is true forinsert
but not true forquery
which requires the use ofprepare
if you use placeholders in the query. -
client side – You should never let anyone that is not the admin of the site to admin the plugin. This means it is not suitable to use in a network unless you will restrict the access there to only the super admin. Any other configuration will enable the site’s users to do XSS attacks against other users of the site.
Related Posts:
- Who is responsible for data sanitization in WordPress development?
- What is the proper way to validate and sanitize JSON response from REST API?
- Is sanitize_text_field() is enough to save to DB?
- Default WordPress settings API data sanitization
- How to display data from custom table in wordpress database?
- How does WordPress store data?
- Permit Login if table row exists
- data (html) migration to posts
- What’s the proper way to sanitize checkbox value sent to the database
- Using $wpdb | checking entered email against existing emails in db
- Where is the HTML-handler part in the wpdb class?
- How to resolve ORA-011033: ORACLE initialization or shutdown in progress
- Oracle SQL query for Date format
- Failed to connect to mysql at 127.0.0.1:3306 with user root access denied for user ‘root’@’localhost'(using password:YES)
- Can I have multiple primary keys in a single table?
- Using wpdb to connect to a separate database
- is_email() VS sanitize_email()
- Database connection close
- How to create bulk page and content? [closed]
- Importing posts from old website to new conflicting post ID’s?
- Exporting revisions
- WP_Options ID high
- Transient RSS feeds in wp_options not removed automatically?
- Best way to move live site local
- The revisions table in my database is at 70% capacity and growing. What should I do?
- WordPress for a very large website
- How to use multiple database in wordpress?
- Database location in WordPress
- WooCommerce with thousands of products – site is very slow – optimize db queries? [closed]
- WP_list_table bulk_action get edit and delete
- Is removing orphaned wp_postmeta records safe?
- Change SQL get_results to search for posts with custom term in custom taxonomy
- Add search Value to wp_list_table pagination
- stdObject stored in database. How does one convert it to usable format?
- I have a table I created, how do I make a form for a user to filter the data?
- What ALL can cause “Another update is currently in progress.”? [closed]
- Error connecting to DB in /wp-includes/wp-db.php on line 1538 [closed]
- Set Display Name to first and last name (phpmyadmin SQL Query)
- Trigger Plugin database update after git pull
- Does WordPress ever need multiple databases?
- Why are no posts showing despite my apparently correct DB restoration?
- How to query the WordPress database to get posts of a certain custom post type, taxonomy and field?
- Cannot update custom database table row
- Best Practice for Validating and Sanitizing Data
- SQL Error wp_commentmeta – incorrect table definition
- Change WordPress prefix for only one table?
- Two websites one database, administrator not working on second website
- Select two sums with single get_var statement
- How to get the SQL of the changes made to the database from an update or upgrade?
- How can i add custom fields into the contact form 7 [closed]
- Why does importing copies of the database dump and the document root make WordPress data inconsistent?
- Make an Items attribute searchable (taxonomy using existing attribute)
- Store partial database to an archive database time to time
- Move out of sync posts from one database to another
- Migration: Copying database content to a different server
- Remove empty rows from the database
- Check if post id exist in table than only update instead of inserting new row
- Detail explanation of wordpress database fields and metatag list [closed]
- CreateOrUpdate in WordPress
- $wpdb->get_results($wpdb->prepare(… You have an error in your SQL syntax;
- How to convert srcset links from https to http?
- How to get a list of WordPress default database tables?
- Can local WordPress installs share /wp-content/ folder and database?
- How do I sanitize the str_replace function in javascript variables
- How to transfer from localHost to live but use the already existing database on the server?
- Backing up WordPress database and files
- Image link issues after importing a database backup to my local web server
- multiple wordpress installs w/shared user database but separate content databases
- A change in URL slug in database returns 404, how can I do auto-redirect?
- Updating seperate database when post attachment is changed
- add featured image dialog box disappear
- Displaying table data on a page
- muliple wordpress installs (network) on different databases
- WordPress Database – wp_usermeta and the correct number of session_tokens rows
- Continuous SQL query errors from outside source
- How to get a list of articles related to a particular category from my other WordPress website?
- Whats the best practise on how to store json data from a custom settings page?
- Recovery – Restore Database after moving folder location locally
- /wp-admin not accessible after migrating to local host (no plugin issue)
- Job and Employee Performance Tracking with Product Safety
- set_transient fails if the value has more than 60.000 characters
- How do I cleanup my database with data that is no longer being used?
- Set SQL_BIG_SELECTS and MAX_JOIN_SIZE on a WP_Query
- How to optimize wp_option table?
- How do I update a WordPress wp_postmeta meta_value that contains many options
- How can I get $wpdb to show MySQL warnings?
- About wp database hooks (error establishing connection)
- Database for JQuery Autocomplete field
- Create Tables in WordPress
- Catchable fatal error in formatting.php
- Wrong url for the images while using same database for two WordPress installations
- WordPress Failed to Login (DB Error)
- Sending WordPress database information to cross domain the safe way?
- Share WordPress Database
- DB access blocked when initializing WP externally
- ERROR: “Table Prefix” must not be empty
- How do you build a database-centric site in WP?
- WordPress: Interact with Database Query Data and Login
- Attach posts based on category and position
- Getting an error when trying to migrate to DV server from Grid with Media Temple [closed]