Cookie Security – Myths and Misconceptions

Presented at AppSec USA 2017, Sept. 22, 2017, 9 a.m. (45 minutes).

Cookies are an integral part of any web application and secure management of cookies is essential to web security. However, during my years as a security consultant I've often encountered various myths and misconceptions regarding cookie security from both developers as well as other security professionals. This talk will dive into the details of cookie security and highlight some of the lesser known facts about well-known cookie attributes. For example, we will see why the ‘Secure' attribute doesn't make a cookie immune against active man-in-the-middle attacks, how JavaScript can manipulate cookies marked with ‘HttpOnly', why setting the ‘Domain' attribute to the origin host may make it less secure and how other applications on the same host still can access cookies scoped to a path outside their application. This talk will also cover many of the recent improvements to cookie security implemented in modern browsers, such as ‘Strict secure cookie', ‘Cookie prefixes', and the ‘SameSite' attribute. This talk will give you a solid understanding of the pitfalls affecting cookie security, the risks associated with these, and how you can leverage modern security specifications to enhance the protection of cookies in your web application.   Tentative outline (subject to change): -Cookie Basics -Cookie Lifetime o Persistent vs. non-persistent cookies o Expires and Max-Age Attribute o Security implications -Cookie Scope vs. Same-origin Policy -Secure Attribute o What it protects against o What it doesn't protect against o Targeting ‘Secure' cookies in MiTM attacks o Demo -HttpOnly Attribute o What it protects against o What it doesn't protect against o Attacking ‘HttpOnly' cookies from JavaScript o Demo -Path Attribute o Isolating cookies between applications on same domain o Compromising cookies scoped to another application's path o Demo -Domain Attribute o Broadly scoped domains o Narrowly scoped domains o Risks with setting the domain attribute -Modern Cookie Protections o SameSite Attribute o Cookie Prefixes o Strict Secure Cookie -Summary o Is there an ultimate cookie configuration?

Presenters:

  • David Johansson - Associate Principal Consultant - Synopsys
    David Johansson has 10 years of experience in software security, working as a consultant for several different companies. A large part of his work has been focused on secure software development in general and web security in particular. He has trained hundreds of developers and testers in various security courses, and presented talks at conferences such as OWASP AppSec EU (2017), InfoSecurity Europe (2015), and (ISC)2 Security Congress EMEA (2014). David lives in London (UK) where he works as an Associate Principal Consultant for Synopsys Software Integrity Group (formerly Cigital).

Links:

Similar Presentations: