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
Mozilla Observatory First Draft
Search
luke crouch
March 15, 2021
Technology
150
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Mozilla Observatory First Draft
luke crouch
March 15, 2021
More Decks by luke crouch
See All by luke crouch
Mr. Brokebot: Lethal language attacks against AI agents
groovecoder
0
140
Pigeons to Padlocks: 5000 years of Network Security
groovecoder
0
110
cryptory-up-to-https-atlas-2024.pdf
groovecoder
0
89
Cryptography: 500 BC to https
groovecoder
0
230
VPNs
groovecoder
0
160
Digital Privacy & Security
groovecoder
0
290
Cryptography: 500 BC to Quantum Computing
groovecoder
0
1.1k
Just enough bitcoing to go cryptojacking with JavaScript
groovecoder
0
130
Can we protect Privacy without breaking the web
groovecoder
0
190
Other Decks in Technology
See All in Technology
Flutterをカメラで動かしたかった話
sony
1
130
Digitization部 紹介資料
sansan33
PRO
2
7.7k
AIコーディングの次。コードレビューと理解負荷を解消して組織の開発生産性を高める
moongift
PRO
2
2.3k
ガバメントクラウドでのランサムウェア対策
techniczna
2
1k
個人OSSが、机の上から世界に広がるまでの話
shinyasaita
1
370
グローバル基準のSREは、運用現場でどう機能したか:成熟度アセスメントの実践 / SRE NEXT 2026
sorawatanabe
0
140
【CEDEC2026】『ウマ娘 プリティーダービー』 英語版のキャラクターの方言や口調をローカライズするための創造的アプローチ
cygames
PRO
1
200
Cursor Meetup Sapporo - Cursor物語 続編
cocacola917
0
140
え?フロントエンドエンジニアの ワイがインフラも!?
puku0x
1
440
20260807_第6回_関東kaggler会LT_claw系bot xangiと始める、"寂しくない" kaggle
sugupoko
0
210
Redmine 7.0 新機能・機能強化解説(OSC2026京都ダイジェスト版)
vividtone
1
210
ガバメント AI 源内を地方自治体は活用できるのか可能性と課題、期待について
takeda_h
1
360
Featured
See All Featured
AI Search: Implications for SEO and How to Move Forward - #ShenzhenSEOConference
aleyda
1
1.3k
Discover your Explorer Soul
emna__ayadi
2
1.2k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
The browser strikes back
jonoalderson
0
1.5k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
430
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
260
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
370
Designing for Timeless Needs
cassininazir
1
430
Faster Mobile Websites
deanohume
310
32k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
840
Making the Leap to Tech Lead
cromwellryan
135
10k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
490
Transcript
Luke Crouch For learning and doing web app security
Me Luke Crouch • Privacy & Security Engineer, Mozilla •
Board member, Techlahoma Foundation • I’ve had 4 cups of coffee already ☕ ☕ ☕ ☕
This talk • 112 slides in ~15m • Mozilla Observatory
• Website • Command-line tool • API • Questions
How many of you use a tool to scan your
web site or app for security issues? 🙋
In Mozilla research, 16% say Yes n=1,181 web engineers *old
data
In Mozilla research, 47% say No n=1,181 web developers *old
data
Why don’t you use something to scan your web site
or app?
40% say: I don’t need it
Can’t have security vulnerabilities … … if you don’t know
about your security vulnerabilities.
17% say they “need to” use a tool
THANK YOU!
Because even if your app or site may not seem
like a target …
Your users may be re-using their password …
• their bank • their PayPal • their workplace •
their healthcare provider • their password manager (!) • their computer • etc. • their email • which gives an attacker access to all of those others!
So if your app is hacked, their other accounts could
get hacked too.
Next (rhetorical) question …
Which of the following security tech applies to your code?
• Mixed Content • Subresource Integrity • Cross-Origin Resource Sharing • Cookies • Secure • HttpOnly • Content Security Policy • HTTP Strict Transport Security • Redirections • Referrer Policy • X-Frame-Options • X-XSS-Protection • X-Content-Type-Options
🤷🤷
Which of the following security tech applies to your code?
• Mixed Content • Subresource Integrity • Cross-Origin Resource Sharing • Cookies • Secure • HttpOnly • Content Security Policy • HTTP Strict Transport Security • Redirections • Referrer Policy • X-Frame-Options • X-XSS-Protection • X-Content-Type-Options
How do you know what you need to know?
Luke Crouch For learning and doing web app security
None
None
None
None
None
None
Observatory helps me focus on learning the most important security
for my code right now.
Because the reason most of us don’t do all this
… • Mixed Content • Subresource Integrity • Cross-Origin Resource Sharing • Cookies • Secure • HttpOnly • Content Security Policy • HTTP Strict Transport Security • Redirections • Referrer Policy • X-Frame-Options • X-XSS-Protection • X-Content-Type-Options
we don’t have time to do it all.
But, there’s plenty of “quick wins” you can get with
a little bit of time
So, let’s get started …
⚠ Disclaimer: don’t be evil ⚠
You should only use security scanning and testing tools with
permission
So … don’t go scan a bunch of government websites
Now … let’s go scan a bunch of government websites
hackerone.com
None
None
None
So basically, GSA gives permission to scan some sites, within
certain scope and under certain conditions
None
Let’s try the first one on the list: itdashboard.gov
None
None
None
None
Loading external scripts over (insecure) HTTP - WCGW? 🤷
None
None
https://itdashboard.gov <html> <head> … <script src=“http://ajax.googleapis.com/…”></script> … </head> … </html>
https://itdashboard.gov <script src=“http://ajax.googleapis.com/…”></script> HTTP HTTP
None
None
https://itdashboard.gov <html> <head> … <script src=“http://ajax.googleapis.com/…”></script> … </head> … </html>
None
https://itdashboard.gov <html> <head> <script src=“http://ajax.googleapis.com/…” integrity="sha384-R4/ztc4ZlRqWjqIuvf6RX5yb/v90qNGx6fS48N0tRxiGkqveZETq72KgDVJCp2TC" > </script> </head>
</html>
None
None
None
None
None
None
https://www.keycdn.com/support/what-is-mime-sniffing
https://itdashboard.gov <script src=“/user-uploads/image.jpg”></script> /user-uploads/ js in image.jpg file js in
image.jpg file
None
Does your server set the right Content-Type for scripts and
styles?
Yes?
This is “easy” - you can add: X-Content-Type-Options: nosniff across
your entire server.
X-Content-Type-Options is the first recommended fix, because it’s easier than
others …
No?
Do you need to support old IE browsers? • No?
• add X-Content-Type-Options: nosniff • Yes? • Sorry to hear that • Does your site need to render user uploads in pages? • No? add X-Content-Type-Options: nosniff • Yes? • Sorry again …
This is how improving your security works
1. Find a potential vulnerability 2. Learn about the potential
attack(s) 3. Determine how much if affects your code specifically 4. Make an appropriate fix 5. Repeat
So, what’s next for itdashboard.gov ?
Normally, you would make the recommended fix …
None
And then
But since GSA won’t give us access to deploy code
on itdashboard.gov …
Let’s just check out the other tests in the report
…
None
None
X-XSS-Protection
None
None
But what does it actually do?
None
https://itdashboard.gov/?param=<script>alert(1)</script> <html> <head><title>…</title></head> <body> <?php echo $_GET[‘param’] ?> </body> </html>
X-XSS-Protection: 1; mode-block
https://itdashboard.gov/?param=<script>alert(1)</script> <html> <head><title>…</title></head> <body> <?php echo $_GET[‘param’] ?> </body> </html>
None
You might as well take care of older browser users
(they need all they help they can get!)
Do you need to render HTML from url params? •
No? • add X-XSS-Protection: 1; mode-block • Yes? • No you don’t. add X-XSS-Protection: 1; mode-block • For real you do? • No, for real you don’t.
None
Observatory Command-Line Interface
npm install observatory-cli
observatory itdashboard.gov --zero --format=report
None
So, same tests and results
Note: no “Recommendation”
But you could put this in your CI pipeline to
scan a dev or stage site on every code change
And you can make CI fail if the score drops
below a certain level
None
Observatory API
https://github.com/mozilla/http-observatory/blob/master/httpobs/docs/api.md
https://http-observatory.security.mozilla.org/api/v1 • POST /analyze?host=itdashboard.gov • hidden=true&rescan=true • GET /analyze?host=itdashboard.gov •
returns a “scan object” with a scan ID • GET /getScanResults?scan=<scan ID>
Now, let’s scan ALL the GSA sites in scope …
None
None
⚠ Disclaimer: don’t be evil ⚠
You should only use security scanning and testing tools with
permission
Questions • Mozilla Observatory • Website • Command-line tool •
API • 3rd-party scans • What else?
Appendix
None
None
None
None
None
None
So, let’s go see where itdashboard.gov might be vulnerable?
None
View source …
None
src=“http:// Phrase not found 🤔
None
“or use protocol-relative URLs” like src=“//
None
So, if someone accessed this page via insecure http:// ,
we could hack the script
But, if someone accessed this page via insecure http:// ,
we could just hack the page
So when would this ever be a real problem?
When would someone ever access this page over insecure http://
? 🙋
What if someone types “itdashboard.gov” without https?
What if another page links to “itdashboard.gov” without https?
When would someone run this page over insecure http:// ?
When would someone run this page at http://127.0.0.1 ?
None
None
None
Content Security Policy … what’s that?
Insert lots of content about CSP