Writing Secure JavaScript Code
summary
Demo app uses popular npm modules and shows concrete exploits: marked XSS via HTML entity decoding, ms regular‑expression ReDoS that freezes the Node event loop, and NoSQL injection by sending an object as a JSON password, plus a Dust.js path that leads to server‑side command execution. Exploits run with curl/httpie against the demo and a Snyk‑style dependency scan reveals about one in seven libraries carry vulnerabilities. Fixes are upgrades, patches or CI/blocking on vulnerability pull requests; automated alerts speed remediation.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 0:48What makes JavaScript great
- 10:51MS Vulnerability
- 13:39Regular Expressions
- 14:11The Event Loop
- 15:23Catastrophic Backtracking
- 17:11Redose
- 18:41Attack Manipulation
- 20:24JSON as Input
- 22:51Type Manipulation
- 23:51DustJS
- 24:46About Page
- 25:18Playing with About Page
- 27:18Wrapping Up
- 27:45Takeaways
- 28:12Libraries have bugs
- 28:56Microsoft Sonar and Lighthouse
- 29:52Upgrade
related talks
24mWriting Secure JavaScript
23mJavaScript attack surface
24mStrangerDanger: Finding Security Vulnerabilities Before They Find You!
55mNode.js Security: Breaking The Loop
35mStrangerDanger: Finding Security Vulnerabilities Before They Find You!
43mReact Security
47mNode.js Security: Breaking The Loop
01h 02meXential XSS (Cross Site Scripting)
