Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Javascript Security and Lightning Locker Service


Published on

This session will introduce Locker Service, a new feature of the Lightning Component Framework which serves to manage JavaScript security while rendering Lightning applications. Get the background on why Locker Service is necessary, what you'll need to know to implement and the advantages it offers the platform.

Published in: Software
  • Be the first to comment

Javascript Security and Lightning Locker Service

  1. 1. JavaScript Security and Lightning LockerService Josh Birk Developer Evangelist Doug Chasman Distinguished Engineer
  2. 2. Forward-Looking Statements Statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward- looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available., inc. assumes no obligation and does not intend to update these forward-looking statements.
  3. 3. JavaScript Security
  4. 4. ● Loosely Typed, “Everything is an Object” ● DOM (Document Object Model) fully accessible ● Browser provides access to events, URL’s, cookies, etc. ● Persistence and State possible via cookies, LocalStorage, etc. Notable Aspects of JavaScript
  5. 5. XSS (Cross Site Scripting): Website allows dynamic content ● Document.write ● DOM updates ● User provided uploads Attacker injects malicious code ● Window.location ● Event Targets Website updated with malicious code Subsequent visits run malicious code User updates status Status includes script statement Status is stored in the database Visiting the status page runs exploit
  6. 6. XSS DEMO
  7. 7. ● Data extraction ● Database manipulation ● Keystroke logging ● Window Location hacking ● Form entry manipulation Possible XSS Outcomes
  8. 8. Component Level Security Out of the box, components have DOM access to each other, shared access to the window and event structures, and access to any client side API.
  9. 9. Introducing LockerService
  10. 10. LockerService LockerService uses various technologies and techniques that are intended to do the following: Prevent: ● XSS and similar security issues ● Unrestricted DOM access ● Calling undocumented/private APIs • Enable: ● Cool new features like client-side API versioning ● Faster security review ● Better JS development practices ● Easily updating security features and policies
  11. 11. ❖ Loosely Typed, “Everything is an Object” ➢ LockerService uses Strict mode and enforces CSP ❖ DOM (Document Object Model) fully accessible ➢ LockerService replaces DOM with a Virtual DOM Proxy ❖ Browser provides access to events, URL’s, cookies, etc. ➢ LockerService either replaces or blocks access ❖ Persistence and State possible via cookies, LocalStorage, etc. ➢ LockerService either replaces or blocks access Notable Aspects of JavaScript
  12. 12. Content Security Policy (CSP) is a computer security standard introduced to prevent cross-site scripting (XSS), clickjacking and other code injection attacks resulting from execution of malicious content in the trusted web page context.
  13. 13. ● Summer ‘16 ○ Automatically turned ON in brand-new Summer ‘16 Orgs ○ Also turned ON in older Orgs without Lighting Components ○ Critical update for Orgs with at least one Lightning Component ○ Can be toggled, either directly or by request ● Winter ‘17 ○ Turned ON in all Orgs LockerService
  14. 14. Salesforce Lightning CLI Sublime Lightning Plugin
  15. 15. Questions?
  16. 16. thank y u