Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Plugin Security
Search
Brad Parbs
July 26, 2014
Technology
3
150
Plugin Security
Brad Parbs
July 26, 2014
Tweet
Share
More Decks by Brad Parbs
See All by Brad Parbs
Learn to Love the Terminal
bradp
0
690
Extremely Powerful Local WordPress Development with Vagrant and Friends
bradp
1
180
Extremely Powerful Local WordPress Development with Vagrant and Friends - WordCamp Grand Rapids 2014
bradp
1
320
Web414 - Writing Clean, Clear, & Semantic Markup with HTML5
bradp
0
410
WordCamp Baltimore - Let's Get Sassy!
bradp
2
500
Starter Themes for Appleton WordPress Meetup
bradp
1
180
#WCGR - Getting SASSy
bradp
4
290
#WCPVD - Getting SASSy
bradp
2
280
WordCamp Chicago 2013 - Template Hiearchy
bradp
1
170
Other Decks in Technology
See All in Technology
Bill One 開発エンジニア 紹介資料
sansan33
PRO
4
17k
SREのプラクティスを用いた3領域同時 マネジメントへの挑戦 〜SRE・情シス・セキュリティを統合した チーム運営術〜
coconala_engineer
2
620
Oracle Cloud Observability and Management Platform - OCI 運用監視サービス概要 -
oracle4engineer
PRO
2
14k
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
850
Introduction to Bill One Development Engineer
sansan33
PRO
0
360
顧客との商談議事録をみんなで読んで顧客解像度を上げよう
shibayu36
0
200
Greatest Disaster Hits in Web Performance
guaca
0
120
インフラエンジニア必見!Kubernetesを用いたクラウドネイティブ設計ポイント大全
daitak
0
340
月間数億レコードのアクセスログ基盤を無停止・低コストでAWS移行せよ!アプリケーションエンジニアのSREチャレンジ💪
miyamu
0
840
予期せぬコストの急増を障害のように扱う――「コスト版ポストモーテム」の導入とその後の改善
muziyoshiz
1
1.7k
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
170
~Everything as Codeを諦めない~ 後からCDK
mu7889yoon
3
300
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.8k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
250
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
730
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
A Modern Web Designer's Workflow
chriscoyier
698
190k
How to make the Groovebox
asonas
2
1.9k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
Stop Working from a Prison Cell
hatefulcrawdad
273
21k
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
How to build a perfect <img>
jonoalderson
1
4.9k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
Transcript
Security for Your Plugins
I’m Brad Parbs.
Nathan, you should watch Band of Brothers.
Let’s talk about what sucks in WordPress.
None
None
“20% of the 50 most popular WordPress plugins are vulnerable
to common Web attacks. This amounts to nearly 8 million downloads of vulnerable plugins.” Checkmarx, an application security company
Things that happen when your stuff isn’t secure.
None
How do we make sure this doesn’t happen?
Always develop with debugging ON
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false );
define( 'WP_DEBUG_LOG', true ); define( 'SCRIPT_DEBUG', true ); define( 'WP_CACHE', false );
Sanitize all the things
intval(); absint();
wp_kses();
sanitize_title();
sanitize_email() sanitize_file_name() sanitize_html_class() sanitize_key() sanitize_meta()
sanitize_mime_type() sanitize_option() sanitize_sql_orderby() sanitize_post_field() sanitize_text_field() sanitize_title() sanitize_title_for_query() sanitize_title_with_dashes() sanitize_user()
Escape all the things
esc_html();
esc_textarea();
esc_attr();
esc_url();
http://codex.wordpress.org/Data_Validation
Database Queries
$wpdb-‐>insert();
$wpdb-‐>update();
$wpdb-‐>prepare();
Nonces
wp_nonce_url();
wp_nonce_field();
wp_create_nonce();
check_admin_referer();
wp_verify_nonce();
Remote Data
CURL is bad.
For real, CURL is bad.
wp_remote_get();
wp_remote_post();
wp_remote_request();
Check capabilities & roles
current_user_can();
Use native functions
A story about TimThumb
Questions?
None