~/talk

Securing React: Prompt Engineering for Robust and Secure Code Generation

Talkat NDC Security 2025 · 2025-01-20..01-23· [react, ai-assisted-development, security]
slides:none on file

Shows how verbose security rules become reusable prompts, stores them in source control, and applies them before and after generation; demonstrates a live fix where ChatGPT initially outputs unsafe JSX and then is guided to use validate URLs on client using URL class and sanitize with DOMPurify. Includes a concrete URL validator function, recommends CSS.escape for style injection, forbids dangerouslySetInnerHTML unless sanitized, and claims ~3x speedups for juniors and ~100x for senior developers when prompts are iterated.

AI-written summary · about

  1. 0:00Introduction and context
  2. 1:09AI in software engineering
  3. 2:54The secure AI lifecycle
  4. 4:24React framework overview
  5. 5:17Prompt engineering for security
  6. 7:02Iterating on prompt rules
  7. 8:29Prompts for code quality
  8. 12:04Contextual prompt strategies
  9. 12:43React security fundamentals
  10. 14:28Common React vulnerabilities
  11. 15:49Cross-site scripting deep dive
  12. 20:31Escaping and JSX security
  13. 22:28Secure data handling
  14. 25:53Dangerous React anti-patterns
  15. 26:43Dangerous URL vulnerabilities
  16. 29:50Strict URL validation techniques
  17. 32:48Rendering HTML safely
  18. 35:36Secure JSON handling
  19. 38:24CSS injection threats
  20. 40:19Safe DOM access with refs
  21. 43:11Access control and lazy loading
  22. 45:21Managing third-party libraries
  23. 48:39Preventing open redirects
  24. 52:13Secure server-side rendering
  25. 55:10Conclusion and live demo
~/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.