~/talk

How to Hack a Django Website

Talkat DjangoCon Europe 2020 · 2020-09-18..09-19· [security, django]
slides:none on file

Four concrete exploits and fixes: a Sentry instance exposing pickle serializer plus signed cookies and the secret key lets an attacker craft a pickle RCE payload and run arbitrary Python on the server; a GitHub Unicode case collision lets password resets target the wrong email (patched in Django on 2020-12-18 / Django 3.1); admin use of mark_safe causes XSS (use format_html); embedding JSON in script tags needs json_script or CSP and serve a security.txt for vuln reports.

AI-written summary · about

  1. 0:00Intro
  2. 0:16Four Stories
  3. 1:43Scan Facebook IP range
  4. 2:07Find Sentry
  5. 2:33Browse Sentry Wow, DEBUG=True
  6. 2:58Read Debugged Settings
  7. 4:04Replace contents of signed cookie
  8. 5:20PICKLE IS CODE
  9. 7:14Bounty
  10. 9:50GitHub 2019 Blog Post by John Gracey
  11. 11:26All Case Collisions with English: Lowercase Uppercase
  12. 12:41Step 3 - Reset Password
  13. 13:29Step 4 - Unleash Chaos
  14. 15:46How to Protect • Upgrade Django.
  15. 16:22YPlan Happened to me
  16. 17:0699 Step 2: Someone browses the admin
  17. 17:18mark_safe is not safe
  18. 18:30Use format_html
  19. 21:22Lotsa sites Recurring audit issue.
  20. 22:09View Forms "JSON"
  21. 22:36Step 3: Template Inlines JSON
  22. 23:06Cat Alert
  23. 24:35Use json_script
  24. 27:13Bonus Protection: security.txt
  25. 27:48security.txt view
  26. 28:08security.txt example
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.