ajax applications : a blueprint for disaster bryan sullivan, security program manager microsoft...

17
Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Upload: zoe-sullivan

Post on 13-Jan-2016

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Ajax Applications : A Blueprint for Disaster

Bryan Sullivan, Security Program Manager

Microsoft

Originally developed with Billy Hoffman, Hewlett Packard

Page 2: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

2

General Ajax Security Issues

• Increased attack surface• Direct API access• Easier to reverse-engineer• Amplifies web attacks• Offline attacks

…in theory…

Page 3: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Theory put to the test

• Ajax application built using “expert” advice

• Books• Blogs• Conferences

3

Page 4: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

DEMONSTRATIONHacker Vacations

4

Page 5: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Lessons learned

1. You cannot control client-side code

2. Don’t store secrets in client-side code

3. Don’t let client-side code perform authentication/authorization functions

4. Don’t expose admin functionality

5. Remember web application security basics

6. Exercise caution when converting data to HTML on the client

5

Page 6: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

PATTERNS AND ANTIPATTERNSAjax Security

6

Page 7: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Antipattern 1: Domino Effect

holdSeat

makeOffer

chargeAccount

bookSeat

7

Page 8: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Pattern 1: Polling Status Calls

8

PerformLongOp

GetStatus

Page 9: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Antipattern 2: Holding Critical State on Client

• Script variables• Flash/Silverlight variables• Offline storage mechanisms• Local Shared Objects ie “Flash cookies”• Silverlight Isolated Storage• Hidden form fields• Cookies

9

Page 10: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Pattern 2: Hold Critical State on Server

• Keep session state just like Web 1.0

10

Page 11: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Antipattern 3: Single-call Authorization

11

holdSeat

makeOffer

chargeAccount

Check authorization here

Page 12: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Pattern 3: Every-call Authorization

12

holdSeat

makeOffer

chargeAccount

Check authorization here

…and here

…and here

Page 13: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Antipattern 4: Exposing Admin Libraries

13

Page 14: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Pattern 4: Segregate Admin Libraries

14

Page 15: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Use with care: Client-side Data Binding

15

Page 16: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

Conclusion

With great power comes great responsibility

16

Page 17: Ajax Applications : A Blueprint for Disaster Bryan Sullivan, Security Program Manager Microsoft Originally developed with Billy Hoffman, Hewlett Packard

More resources

17

My blog:http://blogs.msdn.com/sdl/

My alias:bryansul