Architecting Robust JavaScript Applications
summary
Modern JavaScript apps pull in 1,000+ modules—NPM passes 1,000,000 packages and 97% of app code often comes from NPM—so compromised packages happen (the event-stream hijack exfiltrated Bitcoin keys). Emergent defenses are language-level isolation like realms and compartments (proposals) and a secure ECMAScript / SES model with lockdown and harden shims; build tooling such as Lavamoat auto-sandboxes deps and emits privilege manifests (usable today but still bleeding edge). Patterns that work: WeakMap sealer/unsealer, hardened objects and membranes; Google Caja, Firefox, Salesforce, Moddable, MetaMask and Agoric use variants in production.
AI-written summary · about
chapters (13)
- 0:00Introduction and speaker intro
- 4:42Why robust JavaScript matters
- 8:37JavaScript's standardization and modularity
- 12:49Principle of least authority in JavaScript
- 15:15Realms and compartments for isolation
- 23:45Recap of first part and transition
- 25:28Design patterns for secure modules
- 27:18Making objects tamper-proof
- 33:12Safe monkey patching with WeakMap
- 37:03Sealer and unsealer pairs
- 42:06Proxy pattern for API attenuation
- 48:10Membranes and dynamic isolation
- 50:45Conclusion and real-world applications
related talks
20mKeynote: Securing JavaScript
52mBest Practices for Developers to Master Security
42mSecuring Your Software Supply Chain
19mModularity Matters
20mKeynote: Securing JavaScript
26mHow npm is Making JavaScript Safe For Everyone
15m“Security” in the JavaScript ecosystem
46mWhat Can Traditional Web App Security Learn From Browser Wallet Extensions?
