~/talk

Go security pitfalls; 2 lessons from the battlefield at Grafana Labs

Talkat GopherCon UK 2023 · 2023-08-16..08-18· [go, security]
links:none on file
slides:none on file

Two real Grafana bugs are dissected: filepath.Clean misinterprets inputs where cleaning user paths still allows dot-dot sequences so plugin file access exposes configs and secrets, fixed by normalizing with a leading slash plus fuzz tests and regression cases; and slice sharing race leads to auth bypass where middleware slices are shared under concurrent requests, allowing an unauthenticated request to inherit an admin middleware and reset passwords, reproduced with k6 load tests, fixed by copying slices on request creation and validated by replaying the same load.

AI-written summary · about

  1. 0:00Start
  2. 2:45Go, a secure language
  3. 4:17Grafana: Our first O-day in December 2021
  4. 6:42filepath.Clean is tricky
  5. 8:38The vulnerable code
  6. 10:16The fixed code
  7. 12:36Go Fuzzing example 1: validation logic
  8. 12:54Go Fuzzing example 1: writing the predicates
  9. 14:36Go Fuzzing example 1: fixing the predicates
  10. 16:39Go Fuzzing example 2: validation logic
  11. 18:16Go Fuzzing example 2: abstracting the predicates
  12. 18:57Go Fuzzing example 2: writing the predicates
  13. 20:15Go Fuzzing example 2: finding a corner case
  14. 24:42Why appending to slice is dangerous?
  15. 26:56The vulnerable (?) code and the fix
  16. 29:27Exploiting the bug
  17. 41:41Bug bounty program
  18. 42:03Key takeaways
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.