Understanding
WordPress Security
Yes, WordPress is Secure
Shawn Hooper, Director of IT 

Actionable.co
Blog - shawnhooper.ca

Twitter - @shawnhooper
Director of IT at Actionable.

WordPress Developer.
WordPress Core Contributor & Plugin
Author
WordCamp Ottawa Lead Organizer
Spoken at WordPress events in Canada,
the United States and Australia
Web Developer Since mid-1990s
Hello!
Blog - shawnhooper.ca

Twitter - @shawnhooper
What is WordPress?
Blog - shawnhooper.ca

Twitter - @shawnhooper
What is WordPress?
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress is the world’s most popular
Content Management System (CMS)
It’s Open Source.
What is WordPress?
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress started out as a blogging platform.
It is now a Content Management System
and an Application Framework
with a full REST API.
What is WordPress?
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress (the software) should not be confused
with WordPress.com, a WordPress web hosting
service run by Automattic.
Automattic was founded by WordPress 

co-founder Matt Mullenweg.
The open source project can be found at
WordPress.org
What is WordPress?
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress is developed primarily in PHP
Although JavaScript is becoming a larger part of
the front-end codebase with every release.
It’s database is a MySQL relational database.
Extensibility
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress’ real power is in its extensibility. It’s API
allows for the development of third party themes
and plugins.
5,389 Themes
54,218 Plugins
* Only in the free repo. (Feb 2018)
Market Share
Blog - shawnhooper.ca

Twitter - @shawnhooper
https://w3techs.com/technologies/overview/content_management/all
WordPress’ Core is
Secure
Blog - shawnhooper.ca

Twitter - @shawnhooper
Blog - shawnhooper.ca

Twitter - @shawnhooper
but….
This market share makes it a huge target for hackers!
So What Can We Do ?
Blog - shawnhooper.ca

Twitter - @shawnhooper
So What Can We Do ?
Blog - shawnhooper.ca

Twitter - @shawnhooper
Let’s look at how to secure WordPress as:
A User
A System/Server Administrator
A Developer
An Information Security Professional
A User’s Perspective
Blog - shawnhooper.ca

Twitter - @shawnhooper
Choose Wisely
Blog - shawnhooper.ca

Twitter - @shawnhooper
The largest source of problems in WordPress
Security come from the Plugin Ecosystem.
Choose your themes & plugins wisely!
Choose Wisely
Blog - shawnhooper.ca

Twitter - @shawnhooper
Are they regularly maintained?
Does the author(s) respond to support questions
promptly?
Are they popular?
Introduction to WordPress Security
Keep It Updated!
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress Core ( w/ Automatic Updates!)
WordPress Plugins


WordPress Themes
Introduction to WordPress Security
Backups
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress Core
WordPress Plugins


WordPress Themes
Media Library (“Uploads”)
MySQL Database
Backups
Blog - shawnhooper.ca

Twitter - @shawnhooper
Backup Buddy by iThemes (Paid)
UpdraftPlus (Freemium)
VaultPress (starting @ $39 a year)
Backups
Blog - shawnhooper.ca

Twitter - @shawnhooper
Some Managed Hosts include daily backups. My
favourites include:




WP Engine
Pantheon
Admin Login
Blog - shawnhooper.ca

Twitter - @shawnhooper
Older versions of WordPress came with an
“admin” login by default.
This became a default target for attacks. Use a
different username.
Passwords
Blog - shawnhooper.ca

Twitter - @shawnhooper
Of course, please use secure passwords.


password123 is not secure.
2 Factor Auth
Blog - shawnhooper.ca

Twitter - @shawnhooper
Use Email As Login
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress defaults to a username login
Usernames are fairly discoverable in WordPress
The Email Login plugin forces login using an
email address instead.



https://wordpress.org/plugins/wp-email-login/
Least Privilege
Blog - shawnhooper.ca

Twitter - @shawnhooper
Only gives users the permissions they need to do
their jobs.
Subscriber - Can Read
Contributor - Can Write, but not publish
Author - Can Publish their own Posts

Editor - Can Publish Anyone’s Posts & Pages

Administrator - Can modify site configuration
Security Plugins
Blog - shawnhooper.ca

Twitter - @shawnhooper
SiteLock
iThemes Security



WordFence



Sucuri Security

Security Plugins
Blog - shawnhooper.ca

Twitter - @shawnhooper
Limit Login Attempts

File Monitoring

Security Auditing

Malware Scanning
Change Default URLs

404 Detection

Strong Password Enforcement

Temporary Site Lockout (“Away Mode”)

Permissions Monitoring

WordPress Version Hiding

System/Server
Administrator’s
Perspective
Blog - shawnhooper.ca

Twitter - @shawnhooper
Server Configuration
Blog - shawnhooper.ca

Twitter - @shawnhooper
Some of these recommendations can be done by
users too. But they’re not things you do IN
WordPress.
Enable HTTPS
Blog - shawnhooper.ca

Twitter - @shawnhooper
There’s no reason these days for your website not
to be secured by SSL. LetsEncrypt offers free
certificates, and many web hosts have this as a
one-click install option.
Enable SFTP
Blog - shawnhooper.ca

Twitter - @shawnhooper
Secure File Transfer Protocol (SFTP) is FTP over
SSH.
If you’re going to give users FTP access to their
sites, this is the best way to do it.
File & Folder Permissions
Blog - shawnhooper.ca

Twitter - @shawnhooper
Directories - 755
Files - 644



Block Some PHP Execution
Blog - shawnhooper.ca

Twitter - @shawnhooper
No PHP Execution in Uploads Folder:
No Execution of Config File:
Disable File Editor
Blog - shawnhooper.ca

Twitter - @shawnhooper
Disable File Editor
Blog - shawnhooper.ca

Twitter - @shawnhooper
Add to wp-config.php:
Disable XML-RPC
Blog - shawnhooper.ca

Twitter - @shawnhooper
There are also plugins to do this, 

but doing so at the server side is recommended.
Keep Sites Isolated
Blog - shawnhooper.ca

Twitter - @shawnhooper
If you’re running multiple sites on the same server,
keep them in separate home directories
running as separate users
This helps prevent cross-contamination of sites
in the event of a hack.
Checksum Validation
Blog - shawnhooper.ca

Twitter - @shawnhooper
Using WP-CLI, see if files have been modified:
wp core verify-checksums



wp plugin verify-checksums --all
Developer’s
Perspective
Blog - shawnhooper.ca

Twitter - @shawnhooper
Sanitization & Validation
Blog - shawnhooper.ca

Twitter - @shawnhooper
Sanitization & Validation
Blog - shawnhooper.ca

Twitter - @shawnhooper
There are a pile of functions to do input sanitization:
sanitize_title()
sanitize_user()
balance_tags()
tag_escape()
is_email()
sanitize_html_class()
array_map()
sanitize_email()
sanitize_file_name()
sanitize_term()
sanitize_term_field()
sanitize_html_class()
sanitize_key()
sanitize_mime_type()
sanitize_option()
sanitize_sql_orderby()
sanitize_text_field()
sanitize_title_for_query()
sanitize_title_with_dashes()
sanitize_user()
sanitize_meta()
Validation
Blog - shawnhooper.ca

Twitter - @shawnhooper
Are values of the correct type? Do they have the expected
values? 



$quantity = intval( $_POST[‘quantity’] );

or

$quantity = absint( $_POST[‘quantity’] ); 



if ( $quantity > 10 ) {

die(‘Quantity Out of Range’);

} 



Escaping Text
Blog - shawnhooper.ca

Twitter - @shawnhooper
esc_html( $string );
esc_html__( $string, $domain );
ex:



Hello <?php echo esc_html( $string ); ?> !
Escaping Text
Blog - shawnhooper.ca

Twitter - @shawnhooper
esc_attr( $text );
esc_attr__( $text, $domain );



Escaping a string for use in an HTML attribute tag.



<div data-value=“<?php echo esc_attr( $value ); ?>”>
Escaping Text
Blog - shawnhooper.ca

Twitter - @shawnhooper
$allowed_html = array(

'a' => array(

'href' => array(),

'title' => array() 

),
'br' => array(),

'em' => array(),

'strong' => array()

);
wp_kses( $fragment, $allowed_html, $protocols);
Escaping HTML
Blog - shawnhooper.ca

Twitter - @shawnhooper
wp_rel_nofollow( $html );



Adds rel=“nofollow” to every link in the HTML fragment.
Sanitization & Escaping
Blog - shawnhooper.ca

Twitter - @shawnhooper
For the official documentation on WordPress’ Validation &
Sanitization Functions, see:



https://codex.wordpress.org/
Validating_Sanitizing_and_Escaping_User_Data
Working with the Database
Blog - shawnhooper.ca

Twitter - @shawnhooper
Use $wpdb
Working with the Database
Blog - shawnhooper.ca

Twitter - @shawnhooper
$wpdb->insert(
‘table_name’,
array(
'column1' => 'value1',
'column2' => 123
),
array(
'%s',
'%d'
)
);
Working with the Database
Blog - shawnhooper.ca

Twitter - @shawnhooper
$wpdb->update(
'table',
array(
'column1' => 'value1', 


 'column2' => 'value2'
),
array( 'ID' => 1 ),
array(
'%s', // value1
'%d' // value2
),
array( '%d' )
);
Working with the Database
Blog - shawnhooper.ca

Twitter - @shawnhooper
Custom Queries should be written using the $wpdb->prepare() function.
$safeSQL = $wpdb->prepare(“SELECT * FROM {$wpdb->prefix}tablename 



WHERE col1 = ‘%s’AND col2 = %d”, $sParam, $iParam);
$wpdb->query($safeSQL);
WordPress Coding
Standards
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress has documented coding standards that apply to its PHP,
JavaScript, HTML, CSS and Accessibility components. 



Although on it’s own this doesn’t necessarily improve security, it will
make code more readable, and more testable, which minimizes the
chance for errors!
https://codex.wordpress.org/WordPress_Coding_Standards
IT Security
Professional’s
Perspective
Blog - shawnhooper.ca

Twitter - @shawnhooper
Responsible Disclosure
Blog - shawnhooper.ca

Twitter - @shawnhooper
Don’t bring more attention to security vulnerabilities in public
forums, blog posts, chats, or issue trackers without giving
developers a reasonable chance to patch it first.
Responsible Disclosure
Blog - shawnhooper.ca

Twitter - @shawnhooper
Automattic participates in HackerOne, a platform for secure
reporting vulnerabilities. And yes, they offer bounties!
WordPress.com Hosted Sites:
https://hackerone.com/automattic
Responsible Disclosure
Blog - shawnhooper.ca

Twitter - @shawnhooper
WordPress participates in HackerOne, a platform for secure
reporting vulnerabilities. And yes, they offer bounties!
The WordPress Open-Source Core Code
https://hackerone.com/wordpress/
Responsible Disclosure
Blog - shawnhooper.ca

Twitter - @shawnhooper
Find a problem with a theme or plugin? Try contacting the
authors directory. If you can’t, email:
Plugins & Themes
plugins@wordpress.org
Responsible Disclosure
Blog - shawnhooper.ca

Twitter - @shawnhooper
Since it’s launch with HackerOne in May 2017
52
WordPress bugs have have been resolved through
reporting by 46 hacked on the platform.
December 2017 (State of the Word Keynote)
What do Hacked
WordPress Sites Look
Like?
Blog - shawnhooper.ca

Twitter - @shawnhooper
What If I Get Hacked?
Blog - shawnhooper.ca

Twitter - @shawnhooper
Shameless Promo:
WordCamp Ottawa
2018
Blog - shawnhooper.ca

Twitter - @shawnhooper
ShawnHooper.ca


Twitter:
@ShawnHooper
THANK YOU!
Blog - shawnhooper.ca

Twitter - @shawnhooper

More Related Content

PDF
WordPress Security Presentation
PDF
DNS hijacking using cloud providers – No verification needed
PPTX
DNS Record
PDF
Frans Rosén Keynote at BSides Ahmedabad
PPTX
Introduction to google hacking database
DOCX
Ansible ex407 and EX 294
PPTX
7 Pila globosa.pptx
PPTX
Docker Networking
WordPress Security Presentation
DNS hijacking using cloud providers – No verification needed
DNS Record
Frans Rosén Keynote at BSides Ahmedabad
Introduction to google hacking database
Ansible ex407 and EX 294
7 Pila globosa.pptx
Docker Networking

What's hot (20)

PPT
Linux command ppt
PPTX
(Ab)Using GPOs for Active Directory Pwnage
PPTX
Types of larva
PPTX
Linux startup
PPT
Domain Name System
PPTX
[112]rest에서 graph ql과 relay로 갈아타기 이정우
PPTX
A2 - broken authentication and session management(OWASP thailand chapter Apri...
PDF
HCL Domino V12 - TOTP
PPT
Linux monitoring and Troubleshooting for DBA's
PDF
Linux directory structure by jitu mistry
PPT
PDF
使用 Controller
PPTX
DNS Security
PPTX
SSRF For Bug Bounties
PPTX
NGINX: Basics and Best Practices
PDF
Installing Cognos 10: Tips and Tricks from the Trenches – Questions & Answers
PDF
PPTX
CodeIgniter & MVC
Linux command ppt
(Ab)Using GPOs for Active Directory Pwnage
Types of larva
Linux startup
Domain Name System
[112]rest에서 graph ql과 relay로 갈아타기 이정우
A2 - broken authentication and session management(OWASP thailand chapter Apri...
HCL Domino V12 - TOTP
Linux monitoring and Troubleshooting for DBA's
Linux directory structure by jitu mistry
使用 Controller
DNS Security
SSRF For Bug Bounties
NGINX: Basics and Best Practices
Installing Cognos 10: Tips and Tricks from the Trenches – Questions & Answers
CodeIgniter & MVC
Ad

Similar to Introduction to WordPress Security (20)

PDF
Securing WordPress
PDF
Writing Secure Code for WordPress
PPT
WordPress End-User Security - WordCamp Las Vegas 2011
PPTX
Protect Your WordPress From The Inside Out
PPTX
Word camp pune 2013 security
PPT
Is your Wordpress safe enough?
PPT
Secure All The Things!
PPTX
WordPress Security - WordPress Meetup Copenhagen 2013
PDF
Top Ten WordPress Security Tips for 2012
KEY
Higher Order WordPress Security
PPTX
WordPress Plugins and Security
PPT
WordCamp Philly WordPress End-User Security
PPT
WordCamp Chicago 2011 - WordPress End User Security - Dre Armeda
PDF
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
PPTX
WordPress End-User Security - Orange County WordCamp 2011
PDF
Security, more important than ever!
PDF
WordPress security & performance a beginners guide
PDF
Intro to Security (Beginner's Edition) WordCamp St. Louis 2015
PPTX
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
PDF
WordPress Security Best Practices 2019 Update
Securing WordPress
Writing Secure Code for WordPress
WordPress End-User Security - WordCamp Las Vegas 2011
Protect Your WordPress From The Inside Out
Word camp pune 2013 security
Is your Wordpress safe enough?
Secure All The Things!
WordPress Security - WordPress Meetup Copenhagen 2013
Top Ten WordPress Security Tips for 2012
Higher Order WordPress Security
WordPress Plugins and Security
WordCamp Philly WordPress End-User Security
WordCamp Chicago 2011 - WordPress End User Security - Dre Armeda
WordCamp Milwaukee 2012 - Aaron Saray - Secure Wordpress Coding
WordPress End-User Security - Orange County WordCamp 2011
Security, more important than ever!
WordPress security & performance a beginners guide
Intro to Security (Beginner's Edition) WordCamp St. Louis 2015
Neo word press meetup ehermits - how to keep your blog from being hacked 2012
WordPress Security Best Practices 2019 Update
Ad

More from Shawn Hooper (15)

PDF
WP REST API: Actionable.co
PDF
Database Considerations for SaaS Products
PDF
Payments Made Easy with Stripe
PDF
WordPress Coding Standards & Best Practices
PDF
Save Time By Manging WordPress from the Command Line
PDF
Writing Clean, Standards Compliant, Testable Code for WordPress
PPTX
Creating Multilingual WordPress Websites
PDF
Creating Multilingual WordPress Websites
PDF
WP-CLI Presentation from WordCamp NYC 2015
PDF
Manage WordPress From the Command Line with WP-CLI
PDF
Hooked on WordPress: WordCamp Columbus
PDF
WP-CLI Talk from WordCamp Montreal
PDF
WP-CLI - WordCamp Miami 2015
PDF
Save Time by Managing WordPress from the Command Line
PDF
Time Code: Automating Tasks in WordPress with WP-Cron
WP REST API: Actionable.co
Database Considerations for SaaS Products
Payments Made Easy with Stripe
WordPress Coding Standards & Best Practices
Save Time By Manging WordPress from the Command Line
Writing Clean, Standards Compliant, Testable Code for WordPress
Creating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
WP-CLI Presentation from WordCamp NYC 2015
Manage WordPress From the Command Line with WP-CLI
Hooked on WordPress: WordCamp Columbus
WP-CLI Talk from WordCamp Montreal
WP-CLI - WordCamp Miami 2015
Save Time by Managing WordPress from the Command Line
Time Code: Automating Tasks in WordPress with WP-Cron

Recently uploaded (20)

PPT
12 Things That Make People Trust a Website Instantly
PPT
250152213-Excitation-SystemWERRT (1).ppt
PPTX
Internet Safety for Seniors presentation
PDF
Containerization lab dddddddddddddddmanual.pdf
PDF
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
PPTX
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
PDF
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
PDF
Alethe Consulting Corporate Profile and Solution Aproach
PPT
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
PPTX
TITLE DEFENSE entitle the impact of social media on education
PPTX
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
PPTX
Mathew Digital SEO Checklist Guidlines 2025
PPTX
t_and_OpenAI_Combined_two_pressentations
DOCX
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PPTX
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
PPTX
Database Information System - Management Information System
PDF
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
PDF
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
PPTX
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes
12 Things That Make People Trust a Website Instantly
250152213-Excitation-SystemWERRT (1).ppt
Internet Safety for Seniors presentation
Containerization lab dddddddddddddddmanual.pdf
Lean-Manufacturing-Tools-Techniques-and-How-To-Use-Them.pdf
module 1-Part 1.pptxdddddddddddddddddddddddddddddddddddd
SlidesGDGoCxRAIS about Google Dialogflow and NotebookLM.pdf
Alethe Consulting Corporate Profile and Solution Aproach
415456121-Jiwratrwecdtwfdsfwgdwedvwe dbwsdjsadca-EVN.ppt
TITLE DEFENSE entitle the impact of social media on education
IPCNA VIRTUAL CLASSES INTERMEDIATE 6 PROJECT.pptx
Mathew Digital SEO Checklist Guidlines 2025
t_and_OpenAI_Combined_two_pressentations
Powerful Ways AIRCONNECT INFOSYSTEMS Pvt Ltd Enhances IT Infrastructure in In...
artificialintelligenceai1-copy-210604123353.pptx
KSS ON CYBERSECURITY INCIDENT RESPONSE AND PLANNING MANAGEMENT.pptx
Database Information System - Management Information System
Session 1 (Week 1)fghjmgfdsfgthyjkhfdsadfghjkhgfdsa
BIOCHEM CH2 OVERVIEW OF MICROBIOLOGY.pdf
Top Website Bugs That Hurt User Experience – And How Expert Web Design Fixes

Introduction to WordPress Security

  • 1. Understanding WordPress Security Yes, WordPress is Secure Shawn Hooper, Director of IT 
 Actionable.co Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 2. Director of IT at Actionable.
 WordPress Developer. WordPress Core Contributor & Plugin Author WordCamp Ottawa Lead Organizer Spoken at WordPress events in Canada, the United States and Australia Web Developer Since mid-1990s Hello! Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 3. What is WordPress? Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 4. What is WordPress? Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress is the world’s most popular Content Management System (CMS) It’s Open Source.
  • 5. What is WordPress? Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress started out as a blogging platform. It is now a Content Management System and an Application Framework with a full REST API.
  • 6. What is WordPress? Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress (the software) should not be confused with WordPress.com, a WordPress web hosting service run by Automattic. Automattic was founded by WordPress 
 co-founder Matt Mullenweg. The open source project can be found at WordPress.org
  • 7. What is WordPress? Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress is developed primarily in PHP Although JavaScript is becoming a larger part of the front-end codebase with every release. It’s database is a MySQL relational database.
  • 8. Extensibility Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress’ real power is in its extensibility. It’s API allows for the development of third party themes and plugins. 5,389 Themes 54,218 Plugins * Only in the free repo. (Feb 2018)
  • 9. Market Share Blog - shawnhooper.ca
 Twitter - @shawnhooper https://w3techs.com/technologies/overview/content_management/all
  • 10. WordPress’ Core is Secure Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 11. Blog - shawnhooper.ca
 Twitter - @shawnhooper but…. This market share makes it a huge target for hackers!
  • 12. So What Can We Do ? Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 13. So What Can We Do ? Blog - shawnhooper.ca
 Twitter - @shawnhooper Let’s look at how to secure WordPress as: A User A System/Server Administrator A Developer An Information Security Professional
  • 14. A User’s Perspective Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 15. Choose Wisely Blog - shawnhooper.ca
 Twitter - @shawnhooper The largest source of problems in WordPress Security come from the Plugin Ecosystem. Choose your themes & plugins wisely!
  • 16. Choose Wisely Blog - shawnhooper.ca
 Twitter - @shawnhooper Are they regularly maintained? Does the author(s) respond to support questions promptly? Are they popular?
  • 18. Keep It Updated! Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress Core ( w/ Automatic Updates!) WordPress Plugins 
 WordPress Themes
  • 20. Backups Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress Core WordPress Plugins 
 WordPress Themes Media Library (“Uploads”) MySQL Database
  • 21. Backups Blog - shawnhooper.ca
 Twitter - @shawnhooper Backup Buddy by iThemes (Paid) UpdraftPlus (Freemium) VaultPress (starting @ $39 a year)
  • 22. Backups Blog - shawnhooper.ca
 Twitter - @shawnhooper Some Managed Hosts include daily backups. My favourites include: 
 
 WP Engine Pantheon
  • 23. Admin Login Blog - shawnhooper.ca
 Twitter - @shawnhooper Older versions of WordPress came with an “admin” login by default. This became a default target for attacks. Use a different username.
  • 24. Passwords Blog - shawnhooper.ca
 Twitter - @shawnhooper Of course, please use secure passwords. 
 password123 is not secure.
  • 25. 2 Factor Auth Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 26. Use Email As Login Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress defaults to a username login Usernames are fairly discoverable in WordPress The Email Login plugin forces login using an email address instead.
 
 https://wordpress.org/plugins/wp-email-login/
  • 27. Least Privilege Blog - shawnhooper.ca
 Twitter - @shawnhooper Only gives users the permissions they need to do their jobs. Subscriber - Can Read Contributor - Can Write, but not publish Author - Can Publish their own Posts
 Editor - Can Publish Anyone’s Posts & Pages
 Administrator - Can modify site configuration
  • 28. Security Plugins Blog - shawnhooper.ca
 Twitter - @shawnhooper SiteLock iThemes Security
 
 WordFence
 
 Sucuri Security

  • 29. Security Plugins Blog - shawnhooper.ca
 Twitter - @shawnhooper Limit Login Attempts
 File Monitoring
 Security Auditing
 Malware Scanning Change Default URLs
 404 Detection
 Strong Password Enforcement
 Temporary Site Lockout (“Away Mode”)
 Permissions Monitoring
 WordPress Version Hiding

  • 31. Server Configuration Blog - shawnhooper.ca
 Twitter - @shawnhooper Some of these recommendations can be done by users too. But they’re not things you do IN WordPress.
  • 32. Enable HTTPS Blog - shawnhooper.ca
 Twitter - @shawnhooper There’s no reason these days for your website not to be secured by SSL. LetsEncrypt offers free certificates, and many web hosts have this as a one-click install option.
  • 33. Enable SFTP Blog - shawnhooper.ca
 Twitter - @shawnhooper Secure File Transfer Protocol (SFTP) is FTP over SSH. If you’re going to give users FTP access to their sites, this is the best way to do it.
  • 34. File & Folder Permissions Blog - shawnhooper.ca
 Twitter - @shawnhooper Directories - 755 Files - 644
 

  • 35. Block Some PHP Execution Blog - shawnhooper.ca
 Twitter - @shawnhooper No PHP Execution in Uploads Folder: No Execution of Config File:
  • 36. Disable File Editor Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 37. Disable File Editor Blog - shawnhooper.ca
 Twitter - @shawnhooper Add to wp-config.php:
  • 38. Disable XML-RPC Blog - shawnhooper.ca
 Twitter - @shawnhooper There are also plugins to do this, 
 but doing so at the server side is recommended.
  • 39. Keep Sites Isolated Blog - shawnhooper.ca
 Twitter - @shawnhooper If you’re running multiple sites on the same server, keep them in separate home directories running as separate users This helps prevent cross-contamination of sites in the event of a hack.
  • 40. Checksum Validation Blog - shawnhooper.ca
 Twitter - @shawnhooper Using WP-CLI, see if files have been modified: wp core verify-checksums
 
 wp plugin verify-checksums --all
  • 42. Sanitization & Validation Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 43. Sanitization & Validation Blog - shawnhooper.ca
 Twitter - @shawnhooper There are a pile of functions to do input sanitization: sanitize_title() sanitize_user() balance_tags() tag_escape() is_email() sanitize_html_class() array_map() sanitize_email() sanitize_file_name() sanitize_term() sanitize_term_field() sanitize_html_class() sanitize_key() sanitize_mime_type() sanitize_option() sanitize_sql_orderby() sanitize_text_field() sanitize_title_for_query() sanitize_title_with_dashes() sanitize_user() sanitize_meta()
  • 44. Validation Blog - shawnhooper.ca
 Twitter - @shawnhooper Are values of the correct type? Do they have the expected values? 
 
 $quantity = intval( $_POST[‘quantity’] );
 or
 $quantity = absint( $_POST[‘quantity’] ); 
 
 if ( $quantity > 10 ) {
 die(‘Quantity Out of Range’);
 } 
 

  • 45. Escaping Text Blog - shawnhooper.ca
 Twitter - @shawnhooper esc_html( $string ); esc_html__( $string, $domain ); ex:
 
 Hello <?php echo esc_html( $string ); ?> !
  • 46. Escaping Text Blog - shawnhooper.ca
 Twitter - @shawnhooper esc_attr( $text ); esc_attr__( $text, $domain );
 
 Escaping a string for use in an HTML attribute tag.
 
 <div data-value=“<?php echo esc_attr( $value ); ?>”>
  • 47. Escaping Text Blog - shawnhooper.ca
 Twitter - @shawnhooper $allowed_html = array(
 'a' => array(
 'href' => array(),
 'title' => array() 
 ), 'br' => array(),
 'em' => array(),
 'strong' => array()
 ); wp_kses( $fragment, $allowed_html, $protocols);
  • 48. Escaping HTML Blog - shawnhooper.ca
 Twitter - @shawnhooper wp_rel_nofollow( $html );
 
 Adds rel=“nofollow” to every link in the HTML fragment.
  • 49. Sanitization & Escaping Blog - shawnhooper.ca
 Twitter - @shawnhooper For the official documentation on WordPress’ Validation & Sanitization Functions, see:
 
 https://codex.wordpress.org/ Validating_Sanitizing_and_Escaping_User_Data
  • 50. Working with the Database Blog - shawnhooper.ca
 Twitter - @shawnhooper Use $wpdb
  • 51. Working with the Database Blog - shawnhooper.ca
 Twitter - @shawnhooper $wpdb->insert( ‘table_name’, array( 'column1' => 'value1', 'column2' => 123 ), array( '%s', '%d' ) );
  • 52. Working with the Database Blog - shawnhooper.ca
 Twitter - @shawnhooper $wpdb->update( 'table', array( 'column1' => 'value1', 


 'column2' => 'value2' ), array( 'ID' => 1 ), array( '%s', // value1 '%d' // value2 ), array( '%d' ) );
  • 53. Working with the Database Blog - shawnhooper.ca
 Twitter - @shawnhooper Custom Queries should be written using the $wpdb->prepare() function. $safeSQL = $wpdb->prepare(“SELECT * FROM {$wpdb->prefix}tablename 



WHERE col1 = ‘%s’AND col2 = %d”, $sParam, $iParam); $wpdb->query($safeSQL);
  • 54. WordPress Coding Standards Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress has documented coding standards that apply to its PHP, JavaScript, HTML, CSS and Accessibility components. 
 
 Although on it’s own this doesn’t necessarily improve security, it will make code more readable, and more testable, which minimizes the chance for errors! https://codex.wordpress.org/WordPress_Coding_Standards
  • 55. IT Security Professional’s Perspective Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 56. Responsible Disclosure Blog - shawnhooper.ca
 Twitter - @shawnhooper Don’t bring more attention to security vulnerabilities in public forums, blog posts, chats, or issue trackers without giving developers a reasonable chance to patch it first.
  • 57. Responsible Disclosure Blog - shawnhooper.ca
 Twitter - @shawnhooper Automattic participates in HackerOne, a platform for secure reporting vulnerabilities. And yes, they offer bounties! WordPress.com Hosted Sites: https://hackerone.com/automattic
  • 58. Responsible Disclosure Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress participates in HackerOne, a platform for secure reporting vulnerabilities. And yes, they offer bounties! The WordPress Open-Source Core Code https://hackerone.com/wordpress/
  • 59. Responsible Disclosure Blog - shawnhooper.ca
 Twitter - @shawnhooper Find a problem with a theme or plugin? Try contacting the authors directory. If you can’t, email: Plugins & Themes [email protected]
  • 60. Responsible Disclosure Blog - shawnhooper.ca
 Twitter - @shawnhooper Since it’s launch with HackerOne in May 2017 52 WordPress bugs have have been resolved through reporting by 46 hacked on the platform. December 2017 (State of the Word Keynote)
  • 61. What do Hacked WordPress Sites Look Like? Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 62. What If I Get Hacked? Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 63. Shameless Promo: WordCamp Ottawa 2018 Blog - shawnhooper.ca
 Twitter - @shawnhooper
  • 64. ShawnHooper.ca 
 Twitter: @ShawnHooper THANK YOU! Blog - shawnhooper.ca
 Twitter - @shawnhooper