SlideShare a Scribd company logo
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?
Keep It Updated!
Blog - shawnhooper.ca

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


WordPress Themes
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

What's hot

Introduction to Haproxy
Introduction to HaproxyIntroduction to Haproxy
Introduction to Haproxy
Shaopeng He
 
BTRisk Adli Bilişim Eğitimi Sunumu
BTRisk Adli Bilişim Eğitimi SunumuBTRisk Adli Bilişim Eğitimi Sunumu
BTRisk Adli Bilişim Eğitimi Sunumu
BTRisk Bilgi Güvenliği ve BT Yönetişim Hizmetleri
 
Moodle api tutorial
Moodle api   tutorialMoodle api   tutorial
Moodle api tutorial
Piercarlo Fermino Soares
 
Ateliers d’une application Web vulnérable
Ateliers d’une application Web vulnérable Ateliers d’une application Web vulnérable
Ateliers d’une application Web vulnérable
Ayoub Rouzi
 
Web Application Firewall
Web Application FirewallWeb Application Firewall
Web Application Firewall
Chandrapal Badshah
 
Windows İşletim Sistemi Yetki Yükseltme Çalışmaları
Windows İşletim Sistemi Yetki Yükseltme ÇalışmalarıWindows İşletim Sistemi Yetki Yükseltme Çalışmaları
Windows İşletim Sistemi Yetki Yükseltme Çalışmaları
BGA Cyber Security
 
Vault
VaultVault
Vault
dawnlua
 
Les principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuellesLes principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuelles
Xavier Kress
 
Ansible ex407 and EX 294
Ansible ex407 and EX 294Ansible ex407 and EX 294
Ansible ex407 and EX 294
IkiArif1
 
HAProxy
HAProxy HAProxy
HAProxy
Arindam Nayak
 
AZ-104 Microsoft Azure cloud Administration
AZ-104 Microsoft Azure cloud AdministrationAZ-104 Microsoft Azure cloud Administration
AZ-104 Microsoft Azure cloud Administration
AbdulalimBhnsawy
 
Jenkins api
Jenkins apiJenkins api
Jenkins api
Arie Bregman
 
超簡単!Apache httpサーバをWindows Serverにインストール
超簡単!Apache httpサーバをWindows Serverにインストール超簡単!Apache httpサーバをWindows Serverにインストール
超簡単!Apache httpサーバをWindows Serverにインストール
Shin Tanigawa
 
Rapport DVWA: CSRF
Rapport DVWA: CSRFRapport DVWA: CSRF
Rapport DVWA: CSRF
Ayoub Rouzi
 
Web Socket ASM support lior rotkovitch
Web Socket ASM support   lior rotkovitchWeb Socket ASM support   lior rotkovitch
Web Socket ASM support lior rotkovitch
Lior Rotkovitch
 
Owasp top-10-2013-french
Owasp top-10-2013-frenchOwasp top-10-2013-french
Owasp top-10-2013-french
vangogue
 
Webinaire : sécurité informatique sur le web - Jérôme Thémée
Webinaire : sécurité informatique sur le web - Jérôme ThéméeWebinaire : sécurité informatique sur le web - Jérôme Thémée
Webinaire : sécurité informatique sur le web - Jérôme Thémée
Marie Tapia
 
Web application-security
Web application-securityWeb application-security
Web application-security
Visla Team
 
Web Application firewall-Mod security
Web Application firewall-Mod securityWeb Application firewall-Mod security
Web Application firewall-Mod security
Romansh Yadav
 
Web Application Firewall intro
Web Application Firewall introWeb Application Firewall intro
Web Application Firewall introRich Helton
 

What's hot (20)

Introduction to Haproxy
Introduction to HaproxyIntroduction to Haproxy
Introduction to Haproxy
 
BTRisk Adli Bilişim Eğitimi Sunumu
BTRisk Adli Bilişim Eğitimi SunumuBTRisk Adli Bilişim Eğitimi Sunumu
BTRisk Adli Bilişim Eğitimi Sunumu
 
Moodle api tutorial
Moodle api   tutorialMoodle api   tutorial
Moodle api tutorial
 
Ateliers d’une application Web vulnérable
Ateliers d’une application Web vulnérable Ateliers d’une application Web vulnérable
Ateliers d’une application Web vulnérable
 
Web Application Firewall
Web Application FirewallWeb Application Firewall
Web Application Firewall
 
Windows İşletim Sistemi Yetki Yükseltme Çalışmaları
Windows İşletim Sistemi Yetki Yükseltme ÇalışmalarıWindows İşletim Sistemi Yetki Yükseltme Çalışmaları
Windows İşletim Sistemi Yetki Yükseltme Çalışmaları
 
Vault
VaultVault
Vault
 
Les principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuellesLes principales failles de sécurité des applications Web actuelles
Les principales failles de sécurité des applications Web actuelles
 
Ansible ex407 and EX 294
Ansible ex407 and EX 294Ansible ex407 and EX 294
Ansible ex407 and EX 294
 
HAProxy
HAProxy HAProxy
HAProxy
 
AZ-104 Microsoft Azure cloud Administration
AZ-104 Microsoft Azure cloud AdministrationAZ-104 Microsoft Azure cloud Administration
AZ-104 Microsoft Azure cloud Administration
 
Jenkins api
Jenkins apiJenkins api
Jenkins api
 
超簡単!Apache httpサーバをWindows Serverにインストール
超簡単!Apache httpサーバをWindows Serverにインストール超簡単!Apache httpサーバをWindows Serverにインストール
超簡単!Apache httpサーバをWindows Serverにインストール
 
Rapport DVWA: CSRF
Rapport DVWA: CSRFRapport DVWA: CSRF
Rapport DVWA: CSRF
 
Web Socket ASM support lior rotkovitch
Web Socket ASM support   lior rotkovitchWeb Socket ASM support   lior rotkovitch
Web Socket ASM support lior rotkovitch
 
Owasp top-10-2013-french
Owasp top-10-2013-frenchOwasp top-10-2013-french
Owasp top-10-2013-french
 
Webinaire : sécurité informatique sur le web - Jérôme Thémée
Webinaire : sécurité informatique sur le web - Jérôme ThéméeWebinaire : sécurité informatique sur le web - Jérôme Thémée
Webinaire : sécurité informatique sur le web - Jérôme Thémée
 
Web application-security
Web application-securityWeb application-security
Web application-security
 
Web Application firewall-Mod security
Web Application firewall-Mod securityWeb Application firewall-Mod security
Web Application firewall-Mod security
 
Web Application Firewall intro
Web Application Firewall introWeb Application Firewall intro
Web Application Firewall intro
 

Similar to Introduction to WordPress Security

Save Time By Manging WordPress from the Command Line
Save Time By Manging WordPress from the Command LineSave Time By Manging WordPress from the Command Line
Save Time By Manging WordPress from the Command Line
Shawn Hooper
 
WordPress End-User Security
WordPress End-User SecurityWordPress End-User Security
WordPress End-User Security
Dre Armeda
 
A Beginner's Guide to WordPress - WordCamp Toronto 2012
A Beginner's Guide to WordPress - WordCamp Toronto 2012A Beginner's Guide to WordPress - WordCamp Toronto 2012
A Beginner's Guide to WordPress - WordCamp Toronto 2012
Kathryn Presner
 
Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27
Shannon Smith
 
Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Think Media Inc.
 
Beginners' Guide to WordPress
Beginners' Guide to WordPressBeginners' Guide to WordPress
Beginners' Guide to WordPress
Shannon Smith
 
A Beginner's Guide to WordPress - WordCamp Montreal 2012
A Beginner's Guide to WordPress - WordCamp Montreal 2012A Beginner's Guide to WordPress - WordCamp Montreal 2012
A Beginner's Guide to WordPress - WordCamp Montreal 2012
Kathryn Presner
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
Brad Williams
 
WordPress Security Updated - NYC Meetup 2009
WordPress Security Updated - NYC Meetup 2009WordPress Security Updated - NYC Meetup 2009
WordPress Security Updated - NYC Meetup 2009
Brad Williams
 
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
Kathryn Presner
 
WordPress Essentials for Beginners - YES Montreal December 2014
WordPress Essentials for Beginners - YES Montreal December 2014WordPress Essentials for Beginners - YES Montreal December 2014
WordPress Essentials for Beginners - YES Montreal December 2014
Kathryn Presner
 
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
A Beginner's Guide to Wordpress - WordCamp Montreal 2011A Beginner's Guide to Wordpress - WordCamp Montreal 2011
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
Kathryn Presner
 
WordPress Security
WordPress SecurityWordPress Security
WordPress Security
Brad Williams
 
WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010
Brad Williams
 
WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009
Brad Williams
 
WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013Thor Kristiansen
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
randyhoyt
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute Workshop
Brendan Sera-Shriar
 
WordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress SecurityWordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress Security
Brad Williams
 
Wordpress: A Tool for online Earning
Wordpress: A Tool for online EarningWordpress: A Tool for online Earning
Wordpress: A Tool for online Earning
marpasha
 

Similar to Introduction to WordPress Security (20)

Save Time By Manging WordPress from the Command Line
Save Time By Manging WordPress from the Command LineSave Time By Manging WordPress from the Command Line
Save Time By Manging WordPress from the Command Line
 
WordPress End-User Security
WordPress End-User SecurityWordPress End-User Security
WordPress End-User Security
 
A Beginner's Guide to WordPress - WordCamp Toronto 2012
A Beginner's Guide to WordPress - WordCamp Toronto 2012A Beginner's Guide to WordPress - WordCamp Toronto 2012
A Beginner's Guide to WordPress - WordCamp Toronto 2012
 
Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27Wordpress for Newbies 2010-03-27
Wordpress for Newbies 2010-03-27
 
Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013Presentation to SAIT Students - Dec 2013
Presentation to SAIT Students - Dec 2013
 
Beginners' Guide to WordPress
Beginners' Guide to WordPressBeginners' Guide to WordPress
Beginners' Guide to WordPress
 
A Beginner's Guide to WordPress - WordCamp Montreal 2012
A Beginner's Guide to WordPress - WordCamp Montreal 2012A Beginner's Guide to WordPress - WordCamp Montreal 2012
A Beginner's Guide to WordPress - WordCamp Montreal 2012
 
Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010Now That's What I Call WordPress Security 2010
Now That's What I Call WordPress Security 2010
 
WordPress Security Updated - NYC Meetup 2009
WordPress Security Updated - NYC Meetup 2009WordPress Security Updated - NYC Meetup 2009
WordPress Security Updated - NYC Meetup 2009
 
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
A Beginner’s Guide to Wordpress - WordCamp Toronto 2011
 
WordPress Essentials for Beginners - YES Montreal December 2014
WordPress Essentials for Beginners - YES Montreal December 2014WordPress Essentials for Beginners - YES Montreal December 2014
WordPress Essentials for Beginners - YES Montreal December 2014
 
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
A Beginner's Guide to Wordpress - WordCamp Montreal 2011A Beginner's Guide to Wordpress - WordCamp Montreal 2011
A Beginner's Guide to Wordpress - WordCamp Montreal 2011
 
WordPress Security
WordPress SecurityWordPress Security
WordPress Security
 
WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010WordPress Security - WordCamp Boston 2010
WordPress Security - WordCamp Boston 2010
 
WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009WordPress Security - WordCamp NYC 2009
WordPress Security - WordCamp NYC 2009
 
WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013WordPress Security - WordPress Meetup Copenhagen 2013
WordPress Security - WordPress Meetup Copenhagen 2013
 
Extending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHPExtending & Scaling | Dallas PHP
Extending & Scaling | Dallas PHP
 
WordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute WorkshopWordPress Theme Design - Rich Media Institute Workshop
WordPress Theme Design - Rich Media Institute Workshop
 
WordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress SecurityWordCamp Mid-Atlantic WordPress Security
WordCamp Mid-Atlantic WordPress Security
 
Wordpress: A Tool for online Earning
Wordpress: A Tool for online EarningWordpress: A Tool for online Earning
Wordpress: A Tool for online Earning
 

More from Shawn Hooper

WP REST API: Actionable.co
WP REST API: Actionable.coWP REST API: Actionable.co
WP REST API: Actionable.co
Shawn Hooper
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS Products
Shawn Hooper
 
Payments Made Easy with Stripe
Payments Made Easy with StripePayments Made Easy with Stripe
Payments Made Easy with Stripe
Shawn Hooper
 
WordPress Coding Standards & Best Practices
WordPress Coding Standards & Best PracticesWordPress Coding Standards & Best Practices
WordPress Coding Standards & Best Practices
Shawn Hooper
 
Writing Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPressWriting Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPress
Shawn Hooper
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
Shawn Hooper
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
Shawn Hooper
 
WP-CLI Presentation from WordCamp NYC 2015
WP-CLI Presentation from WordCamp NYC 2015WP-CLI Presentation from WordCamp NYC 2015
WP-CLI Presentation from WordCamp NYC 2015
Shawn Hooper
 
Securing WordPress
Securing WordPressSecuring WordPress
Securing WordPress
Shawn Hooper
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPress
Shawn Hooper
 
Manage WordPress From the Command Line with WP-CLI
Manage WordPress From the Command Line with WP-CLIManage WordPress From the Command Line with WP-CLI
Manage WordPress From the Command Line with WP-CLI
Shawn Hooper
 
Hooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp ColumbusHooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp Columbus
Shawn Hooper
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealShawn Hooper
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
Shawn Hooper
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
Shawn Hooper
 
Time Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-CronTime Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-Cron
Shawn Hooper
 

More from Shawn Hooper (16)

WP REST API: Actionable.co
WP REST API: Actionable.coWP REST API: Actionable.co
WP REST API: Actionable.co
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS Products
 
Payments Made Easy with Stripe
Payments Made Easy with StripePayments Made Easy with Stripe
Payments Made Easy with Stripe
 
WordPress Coding Standards & Best Practices
WordPress Coding Standards & Best PracticesWordPress Coding Standards & Best Practices
WordPress Coding Standards & Best Practices
 
Writing Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPressWriting Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPress
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
 
WP-CLI Presentation from WordCamp NYC 2015
WP-CLI Presentation from WordCamp NYC 2015WP-CLI Presentation from WordCamp NYC 2015
WP-CLI Presentation from WordCamp NYC 2015
 
Securing WordPress
Securing WordPressSecuring WordPress
Securing WordPress
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPress
 
Manage WordPress From the Command Line with WP-CLI
Manage WordPress From the Command Line with WP-CLIManage WordPress From the Command Line with WP-CLI
Manage WordPress From the Command Line with WP-CLI
 
Hooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp ColumbusHooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp Columbus
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
 
Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
 
Time Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-CronTime Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-Cron
 

Recently uploaded

Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
TristanJasperRamos
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
Himani415946
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
ShahulHameed54211
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 

Recently uploaded (16)

Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
 
The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 

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?
  • 17.
  • 18. Keep It Updated! Blog - shawnhooper.ca
 Twitter - @shawnhooper WordPress Core ( w/ Automatic Updates!) WordPress Plugins 
 WordPress Themes
  • 19.
  • 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 plugins@wordpress.org
  • 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