<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Douglasheld</id>
		<title>OWASP - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.owasp.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Douglasheld"/>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php/Special:Contributions/Douglasheld"/>
		<updated>2026-05-02T18:46:40Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.2</generator>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Choosing_and_Using_Security_Questions_Cheat_Sheet&amp;diff=241671</id>
		<title>Talk:Choosing and Using Security Questions Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Choosing_and_Using_Security_Questions_Cheat_Sheet&amp;diff=241671"/>
				<updated>2018-07-08T13:47:47Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* Security questions: dubious value */ added my sig&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;quot;Choosing and Using&amp;quot; part of the title read quite awkwardly the first couple times i saw this link. Consider renaming this cheat sheet to just &amp;quot;Security Questions Cheat Sheet&amp;quot;. [[User:Gabe Friedmann|Gabe Friedmann]] 17:24, 15 October 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Security questions: dubious value ==&lt;br /&gt;
&lt;br /&gt;
Security Questions should go the way of the dodo. What is the point of subverting a strong password with more easily guessed security questions? If SQ were stronger, they would form a better primary login factor. But, they are not.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 08:47, 8 July 2018 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Choosing_and_Using_Security_Questions_Cheat_Sheet&amp;diff=241670</id>
		<title>Talk:Choosing and Using Security Questions Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Choosing_and_Using_Security_Questions_Cheat_Sheet&amp;diff=241670"/>
				<updated>2018-07-08T13:47:30Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* Security questions: dubious value */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &amp;quot;Choosing and Using&amp;quot; part of the title read quite awkwardly the first couple times i saw this link. Consider renaming this cheat sheet to just &amp;quot;Security Questions Cheat Sheet&amp;quot;. [[User:Gabe Friedmann|Gabe Friedmann]] 17:24, 15 October 2012 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Security questions: dubious value ==&lt;br /&gt;
&lt;br /&gt;
Security Questions should go the way of the dodo. What is the point of subverting a strong password with more easily guessed security questions? If SQ were stronger, they would form a better primary login factor. But, they are not.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241669</id>
		<title>Talk:Credential Stuffing Prevention Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241669"/>
				<updated>2018-07-08T13:45:02Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: add bad passwords check&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The prerequisites to Credential Stuffing are to have a likely list of usernames or a particular username you would like to attack. Also, a list of most common passwords or an algorithm to try random passwords without repeating a password for a particular username.&lt;br /&gt;
&lt;br /&gt;
Some mitigations that aren't mentioned here are:&lt;br /&gt;
&lt;br /&gt;
1. Try to reduce the ease of obtaining a list of authorized users&lt;br /&gt;
* Make no different response from a login attempt to an existing vs. nonexistent account&lt;br /&gt;
* this includes making no distinction to the response when an existing account is locked out&lt;br /&gt;
&lt;br /&gt;
2. Reject commonly used or already breached passwords. If your users propose these, force them to use a better password. See https://haveibeenpwned.com/Passwords&lt;br /&gt;
&lt;br /&gt;
3. Consider lockout mechanisms additionally from an identified source, and also to an identified target. So for instance, lock out an account after X failed login attempts; but also perhaps lock or throttle logins on an entire tenancy or an entire region if the failed logins per time break above a threshold value. Under a credential stuffing attack, if you were to return 50% of login requests with 503 Unavailable, then a legitimate user has a 50% chance of getting in on the first try, while the attacker's goal will be stretched to twice of its former effort estimate.&lt;br /&gt;
&lt;br /&gt;
4.  Captchas can be a very useful throttling technique.&lt;br /&gt;
&lt;br /&gt;
5. If your application is sensitive to performance, consider segregating your operational environment between login activities and logged in activities. This way, users already logged in successfully can continue to use the application at full performance, while the segregated area dedicated to logins may have to start rejecting requests when it is under attack. Also, segregated resources allow you to more easily incorporate performance-hitting security features like harder working password hashes, or delayed responses by sleeping threads a while to confound various timing attacks.&lt;br /&gt;
&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 08:40, 8 July 2018 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241668</id>
		<title>Talk:Credential Stuffing Prevention Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241668"/>
				<updated>2018-07-08T13:42:13Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The prerequisites to Credential Stuffing are to have a likely list of usernames or a particular username you would like to attack. Also, a list of most common passwords or an algorithm to try random passwords without repeating a password for a particular username.&lt;br /&gt;
&lt;br /&gt;
Some mitigations that aren't mentioned here are:&lt;br /&gt;
&lt;br /&gt;
1. Try to reduce the ease of obtaining a list of authorized users&lt;br /&gt;
* Make no different response from a login attempt to an existing vs. nonexistent account&lt;br /&gt;
* this includes making no distinction to the response when an existing account is locked out&lt;br /&gt;
&lt;br /&gt;
2. Consider lockout mechanisms additionally from an identified source, and also to an identified target. So for instance, lock out an account after X failed login attempts; but also perhaps lock or throttle logins on an entire tenancy or an entire region if the failed logins per time break above a threshold value. Under a credential stuffing attack, if you were to return 50% of login requests with 503 Unavailable, then a legitimate user has a 50% chance of getting in on the first try, while the attacker's goal will be stretched to twice of its former effort estimate.&lt;br /&gt;
&lt;br /&gt;
3.  Captchas can be a very useful throttling technique.&lt;br /&gt;
&lt;br /&gt;
4. If your application is sensitive to performance, consider segregating your operational environment between login activities and logged in activities. This way, users already logged in successfully can continue to use the application at full performance, while the segregated area dedicated to logins may have to start rejecting requests when it is under attack. Also, segregated resources allow you to more easily incorporate performance-hitting security features like harder working password hashes, or delayed responses by sleeping threads a while to confound various timing attacks.&lt;br /&gt;
&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 08:40, 8 July 2018 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241667</id>
		<title>Talk:Credential Stuffing Prevention Cheat Sheet</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Credential_Stuffing_Prevention_Cheat_Sheet&amp;diff=241667"/>
				<updated>2018-07-08T13:40:53Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Some further ideas not expressed in the article&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The prerequisites to Credential Stuffing are to have a likely list of usernames or a particular username you would like to attack. Also, a list of most common passwords or an algorithm to try random passwords without repeating a password for a particular username.&lt;br /&gt;
&lt;br /&gt;
Some mitigations that aren't mentioned here are:&lt;br /&gt;
1. Try to reduce the ease of obtaining a list of authorized users&lt;br /&gt;
 - Make no different response from a login attempt to an existing vs. nonexistent account&lt;br /&gt;
   -- this includes making no distinction to the response when an existing account is locked out&lt;br /&gt;
2. Consider lockout mechanisms additionally from an identified source, and also to an identified target. So for instance, lock out an account after X failed login attempts; but also perhaps lock or throttle logins on an entire tenancy or an entire region if the failed logins per time break above a threshold value. Under a credential stuffing attack, if you were to return 50% of login requests with 503 Unavailable, then a legitimate user has a 50% chance of getting in on the first try, while the attacker's goal will be stretched to twice of its former effort estimate.&lt;br /&gt;
3.  Captchas can be a very useful throttling technique.&lt;br /&gt;
4. If your application is sensitive to performance, consider segregating your operational environment between login activities and logged in activities. This way, users already logged in successfully can continue to use the application at full performance, while the segregated area dedicated to logins may have to start rejecting requests when it is under attack. Also, segregated resources allow you to more easily incorporate performance-hitting security features like harder working password hashes, or delayed responses by sleeping threads a while to confound various timing attacks.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 08:40, 8 July 2018 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Membership/members&amp;diff=222645</id>
		<title>Membership/members</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Membership/members&amp;diff=222645"/>
				<updated>2016-10-24T14:11:41Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* Join The Mission */ whitespace formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Join The Mission'''=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The professional association of OWASP Foundation is a not-for-profit 501c3 charitable organization not associated with any commercial product or service. OWASP is an open source project dedicated to finding and fighting the causes of insecure software to be successful we need your support. OWASP individuals, supporting educational and commercial organization form an application security community that works together to create articles, methodologies, documentation, tools, and technologies (“OWASP Materials”)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
With your annual donation of $50usd Individual OR $5000usd Corporate your donation enables the ongoing support of OWASP [http://www.owasp.org/index.php/Category:OWASP_Project projects], [https://lists.owasp.org/mailman/listinfo mailing lists], [http://www.owasp.org/index.php/Category:OWASP_AppSec_Conference conferences], [http://www.owasp.org/index.php/OWASP_Podcast#tab=Latest_Shows podcasts]. [http://www.owasp.org/index.php/Funds_available_for_OWASP_Projects grants] and [https://www.owasp.org/index.php/Global_Committee_Pages global steering activities]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For more detailed information on the value of Membership [https://www.owasp.org/index.php/Membership Click Here!] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[https://www.owasp.org/index.php/Membership  https://www.owasp.org/images/9/9d/Register_now.gif]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Membership/members&amp;diff=222644</id>
		<title>Membership/members</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Membership/members&amp;diff=222644"/>
				<updated>2016-10-24T14:11:09Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Removed section with all of the bad information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;='''Join The Mission'''=&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The professional association of OWASP Foundation is a not-for-profit 501c3 charitable organization not associated with any commercial product or service. OWASP is an open source project dedicated to finding and fighting the causes of insecure software to be successful we need your support. OWASP individuals, supporting educational and commercial organization form an application security community that works together to create articles, methodologies, documentation, tools, and technologies (“OWASP Materials”)&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
With your annual donation of $50usd Individual OR $5000usd Corporate your donation enables the ongoing support of OWASP [http://www.owasp.org/index.php/Category:OWASP_Project projects], [https://lists.owasp.org/mailman/listinfo mailing lists], [http://www.owasp.org/index.php/Category:OWASP_AppSec_Conference conferences], [http://www.owasp.org/index.php/OWASP_Podcast#tab=Latest_Shows podcasts]. [http://www.owasp.org/index.php/Funds_available_for_OWASP_Projects grants] and [https://www.owasp.org/index.php/Global_Committee_Pages global steering activities]. &lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
For more detailed information on the value of Membership [https://www.owasp.org/index.php/Membership Click Here!] &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;center&amp;gt;&lt;br /&gt;
[https://www.owasp.org/index.php/Membership  https://www.owasp.org/images/9/9d/Register_now.gif]&lt;br /&gt;
&amp;lt;/center&amp;gt;&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Membership/members&amp;diff=222637</id>
		<title>Talk:Membership/members</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Membership/members&amp;diff=222637"/>
				<updated>2016-10-24T13:53:34Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* Page is completely inaccurate */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;No members are listed. Are there really no paid-up-to-date individual members, or is something wrong with the page? -[[User:Mchalmers|Matt]] 01:12, 28 July 2008 (EDT)&lt;br /&gt;
&lt;br /&gt;
== Page is completely inaccurate ==&lt;br /&gt;
&lt;br /&gt;
The page has not been updated since 2011. Membership appears to be kept now in Salesforce.com although there is also a public Google Sheets document referenced elsewhere.&lt;br /&gt;
&lt;br /&gt;
The links in this page are essentially dead. I am going to delete the whole page.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=218855</id>
		<title>Talk:Certificate and Public Key Pinning</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=218855"/>
				<updated>2016-07-13T15:07:21Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* Best practices when running traffic through a CDN */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== June 21 2016 Comments ==&lt;br /&gt;
&lt;br /&gt;
Hi Jeffrey and John,&lt;br /&gt;
&lt;br /&gt;
I am from PKI project team at Symantec, and am reading your OWASP  guide about certificate pinning and have a question on this point: what to pin?&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning&lt;br /&gt;
&lt;br /&gt;
In certificate paragraph, it implies that it should be the server’s certificate, not its issuer.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;There is a downside to pinning a certificate. If the site rotates its certificate on a regular basis, then your application would need to be updated regularly. “&lt;br /&gt;
&lt;br /&gt;
The sample code, e.g. Android, however, all use an ICA [from [[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:05, 13 July 2016 (CDT): &amp;quot;Intermediate Certificate Authority&amp;quot;] to pin. I believe pinning ICA is a good balance of flexibility. Is the guide intention to suggest pinning of CA or the server host’s certificate? Thanks,&lt;br /&gt;
&lt;br /&gt;
Ming&lt;br /&gt;
&lt;br /&gt;
== Past Failures ==&lt;br /&gt;
&lt;br /&gt;
This section is 'further reading' for those interested in surveying the landscape.&lt;br /&gt;
&lt;br /&gt;
* Governments Want/Require Interception&lt;br /&gt;
** Certified Lies: Detecting and Defeating Government Interception Attacks Against SSL, cryptome.org/ssl-mitm.pdf&lt;br /&gt;
** http://www.dailymail.co.uk/indiahome/indianews/article-2126277/No-secrets-Blackberry-Security-services-intercept-data-government-gets-way-messenger-service.html&lt;br /&gt;
* Governments Engage in Interception&lt;br /&gt;
** http://www.thetechherald.com/articles/Tunisian-government-harvesting-usernames-and-passwords/12429/&lt;br /&gt;
* Vendors Provide Interception Taps&lt;br /&gt;
** http://www.cisco.com/web/about/security/intelligence/LI-3GPP.html&lt;br /&gt;
* Governments Use Interception Taps&lt;br /&gt;
** https://www.eff.org/nsa-spying&lt;br /&gt;
* Mobile Interception is Patented&lt;br /&gt;
** Lawful interception for targets in a proxy mobile internet protocol network, http://www.google.com/patents/EP2332309A1&lt;br /&gt;
* Handset manufactures add trusted roots&lt;br /&gt;
** http://gaurangkp.wordpress.com/tag/nokias-man-in-the-middle-attack/&lt;br /&gt;
* Carriers can add trusted roots&lt;br /&gt;
** No reference yet, but http://www.theregister.co.uk/2011/12/15/carrier_iq_privacy_latest/&lt;br /&gt;
* CAs can become compromised&lt;br /&gt;
** http://isc.sans.edu/diary.html?storyid=11500&lt;br /&gt;
* Researchers created Rogue CAs&lt;br /&gt;
** http://www.win.tue.nl/hashclash/rogue-ca/&lt;br /&gt;
* Researchers collided certificates on existing CA certificates&lt;br /&gt;
** http://www.win.tue.nl/~bdeweger/CollidingCertificates/ddl-full.pdf&lt;br /&gt;
* DNS can become compromised&lt;br /&gt;
** http://forums.theregister.co.uk/forum/2/2011/09/05/dns_hijack_service_updated/&lt;br /&gt;
* Physical plant can become compromised&lt;br /&gt;
** http://www.pcworld.com/article/119851/paris_hilton_victim_of_tmobiles_web_flaws.html&lt;br /&gt;
* Its easy to set up an AP or Base Station (Chris Paget's IMSI Catcher)&lt;br /&gt;
** http://www.wired.com/threatlevel/2010/07/intercepting-cell-phone-calls/&lt;br /&gt;
* Can't trust some CAs – they will sell you out and issue subordinate CAs for money&lt;br /&gt;
** http://www.net-security.org/secworld.php?id=12369&lt;br /&gt;
** http://www.zdnet.com/trustwave-sold-root-certificate-for-surveillance-3040095011/&lt;br /&gt;
* Can't trust some browsers – they will sell you out and elide their responsibility&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=724929&lt;br /&gt;
* Can't trust some browsers – they include questionable certificates out of the box&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=542689&lt;br /&gt;
* Can't override some browser's CA list&lt;br /&gt;
** http://my.opera.com/community/forums/topic.dml?id=1580452&lt;br /&gt;
* Can't override OS's CA list (burned into ROM)&lt;br /&gt;
** http://support.google.com/android/bin/answer.py?hl=en&amp;amp;answer=1649774&lt;br /&gt;
* CRL/OCSP does not work as expected/intended&lt;br /&gt;
** http://blog.spiderlabs.com/2011/04/certificate-revocation-behavior-in-modern-browsers.html&lt;br /&gt;
** https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion&lt;br /&gt;
* User will break it too (not just bad guys)&lt;br /&gt;
** http://www.esecurityplanet.com/mobile-security/hacker-bypasses-apples-ios-in-app-purchases.html&lt;br /&gt;
** http://www.h-online.com/security/news/item/Apps-for-Windows-8-easily-hacked-1767839.html&lt;br /&gt;
* Interception proxies add additional risk&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html&lt;br /&gt;
* HTTPS is broken&lt;br /&gt;
** http://www.thoughtcrime.org/software/sslstrip/&lt;br /&gt;
* PKI is broken&lt;br /&gt;
** www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf&lt;br /&gt;
* The Internet is Broken :)&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html&lt;br /&gt;
&lt;br /&gt;
== Operational considerations ==&lt;br /&gt;
&lt;br /&gt;
We use certificate pinning very commonly in my organization (yay for us) but we recently hit a problem when we were routinely changing a certificate on a service. The development team for one of the client applications and implemented pinning, but they had not considered what would happen when the certificate changed. &lt;br /&gt;
&lt;br /&gt;
The majority of our clients support 2 pinned certificates at a time, so when we want to change the server cert the process is&lt;br /&gt;
&lt;br /&gt;
1) Configure the new server cert in the client alongside the old one&lt;br /&gt;
2) Replace the old cert on the server&lt;br /&gt;
3) Configure the old cert from the client&lt;br /&gt;
&lt;br /&gt;
This way we can do the cert rotation usually with no downtime for the client.&lt;br /&gt;
&lt;br /&gt;
The team in question did not do this, which meant they had to have a few minutes of downtime (this is important as we have a demanding SLA) and also it meant that we had to do the change out of office hours to minimize the impact.&lt;br /&gt;
&lt;br /&gt;
So, my suggestion is that we expand this page to include a section on &amp;quot;Operational considerations&amp;quot; that outlines the recommended approach.&lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
If no-one objects, I will add the new section in a couple of days.&lt;br /&gt;
&lt;br /&gt;
[[User:Michael Goodwin|Michael Goodwin]] ([[User talk:Michael Goodwin|talk]]) 06:20, 2 April 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I am not sure how to reply to your question so I will do it inline.  Let me know the appropriate method).&lt;br /&gt;
&lt;br /&gt;
I absolutely agree that this is a needed section.  We have had certificate pinning in for two years and it has been extremely difficult because the teams don't fully grasp the operational implications.  Our strategy has been to include the old cert and the new cert.  Since our app is a consumer app, I have also lobbied extremely hard to get a 'Your app is out of date and needs to be upgraded' but have not got traction.  As a result, every time the certificate changes it's a world of pain since we don't have an effective way to let users know they need to update.   &lt;br /&gt;
&lt;br /&gt;
I have many, many thoughts on the operations side and would love to contribute.&lt;br /&gt;
[[User:SteveA|SteveA]]&lt;br /&gt;
&lt;br /&gt;
== Android example contains code that breaks apps  ==&lt;br /&gt;
&lt;br /&gt;
The Android code example contains a section where it checks that the authtype equals &amp;quot;RSA&amp;quot;.  F5 recently changed their default authtypes to RSA-DHE.  This meant that when we upgraded our F5's in production, all of our Android mobile apps broke.  Obviously a big issue.&lt;br /&gt;
&lt;br /&gt;
What is the compelling reason for this line of code:&lt;br /&gt;
&lt;br /&gt;
if (!(null != authType &amp;amp;&amp;amp; authType.equalsIgnoreCase(&amp;quot;RSA&amp;quot;))) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: AuthType is not RSA&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== iOS sample is bad ==&lt;br /&gt;
&lt;br /&gt;
the iOS sample doesn't need to be an entire program; it should be a minimal Objective-C fragment that demonstrates best practices in loading the keys or key fingerprints from a configuration file.&lt;br /&gt;
&lt;br /&gt;
This Objective-C sample diverges pretty badly from the other language examples, which are short and sweet.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:34, 17 June 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
A flaw in many pinning implementations was pointed out in [https://www.cigital.com/blog/ineffective-certificate-pinning-implementations/]&lt;br /&gt;
Does the OWASP sample code address this?  Probably worth an explicit mention in the doc somewhere.  I don't have time to tackle this now.&lt;br /&gt;
--[[User:TimMorgan|TimMorgan]] ([[User talk:TimMorgan|talk]]) 13:06, 10 March 2016 (CST)&lt;br /&gt;
&lt;br /&gt;
== Best practices when running traffic through a CDN ==&lt;br /&gt;
&lt;br /&gt;
In the modern day customers are allowing CDN vendors to route their HTTPS content and this means the CDN vendors are entrusted with decrypting their traffic.&lt;br /&gt;
I think this really throws a lot of conventional security wisdom out the window - and it would be nice if a certificate pinning best practice were established and documented here.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:07, 13 July 2016 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=218854</id>
		<title>Talk:Certificate and Public Key Pinning</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=218854"/>
				<updated>2016-07-13T15:05:27Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: defined ICA&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== June 21 2016 Comments ==&lt;br /&gt;
&lt;br /&gt;
Hi Jeffrey and John,&lt;br /&gt;
&lt;br /&gt;
I am from PKI project team at Symantec, and am reading your OWASP  guide about certificate pinning and have a question on this point: what to pin?&lt;br /&gt;
&lt;br /&gt;
https://www.owasp.org/index.php/Certificate_and_Public_Key_Pinning&lt;br /&gt;
&lt;br /&gt;
In certificate paragraph, it implies that it should be the server’s certificate, not its issuer.&lt;br /&gt;
&lt;br /&gt;
&amp;quot;There is a downside to pinning a certificate. If the site rotates its certificate on a regular basis, then your application would need to be updated regularly. “&lt;br /&gt;
&lt;br /&gt;
The sample code, e.g. Android, however, all use an ICA [from [[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:05, 13 July 2016 (CDT): &amp;quot;Intermediate Certificate Authority&amp;quot;] to pin. I believe pinning ICA is a good balance of flexibility. Is the guide intention to suggest pinning of CA or the server host’s certificate? Thanks,&lt;br /&gt;
&lt;br /&gt;
Ming&lt;br /&gt;
&lt;br /&gt;
== Past Failures ==&lt;br /&gt;
&lt;br /&gt;
This section is 'further reading' for those interested in surveying the landscape.&lt;br /&gt;
&lt;br /&gt;
* Governments Want/Require Interception&lt;br /&gt;
** Certified Lies: Detecting and Defeating Government Interception Attacks Against SSL, cryptome.org/ssl-mitm.pdf&lt;br /&gt;
** http://www.dailymail.co.uk/indiahome/indianews/article-2126277/No-secrets-Blackberry-Security-services-intercept-data-government-gets-way-messenger-service.html&lt;br /&gt;
* Governments Engage in Interception&lt;br /&gt;
** http://www.thetechherald.com/articles/Tunisian-government-harvesting-usernames-and-passwords/12429/&lt;br /&gt;
* Vendors Provide Interception Taps&lt;br /&gt;
** http://www.cisco.com/web/about/security/intelligence/LI-3GPP.html&lt;br /&gt;
* Governments Use Interception Taps&lt;br /&gt;
** https://www.eff.org/nsa-spying&lt;br /&gt;
* Mobile Interception is Patented&lt;br /&gt;
** Lawful interception for targets in a proxy mobile internet protocol network, http://www.google.com/patents/EP2332309A1&lt;br /&gt;
* Handset manufactures add trusted roots&lt;br /&gt;
** http://gaurangkp.wordpress.com/tag/nokias-man-in-the-middle-attack/&lt;br /&gt;
* Carriers can add trusted roots&lt;br /&gt;
** No reference yet, but http://www.theregister.co.uk/2011/12/15/carrier_iq_privacy_latest/&lt;br /&gt;
* CAs can become compromised&lt;br /&gt;
** http://isc.sans.edu/diary.html?storyid=11500&lt;br /&gt;
* Researchers created Rogue CAs&lt;br /&gt;
** http://www.win.tue.nl/hashclash/rogue-ca/&lt;br /&gt;
* Researchers collided certificates on existing CA certificates&lt;br /&gt;
** http://www.win.tue.nl/~bdeweger/CollidingCertificates/ddl-full.pdf&lt;br /&gt;
* DNS can become compromised&lt;br /&gt;
** http://forums.theregister.co.uk/forum/2/2011/09/05/dns_hijack_service_updated/&lt;br /&gt;
* Physical plant can become compromised&lt;br /&gt;
** http://www.pcworld.com/article/119851/paris_hilton_victim_of_tmobiles_web_flaws.html&lt;br /&gt;
* Its easy to set up an AP or Base Station (Chris Paget's IMSI Catcher)&lt;br /&gt;
** http://www.wired.com/threatlevel/2010/07/intercepting-cell-phone-calls/&lt;br /&gt;
* Can't trust some CAs – they will sell you out and issue subordinate CAs for money&lt;br /&gt;
** http://www.net-security.org/secworld.php?id=12369&lt;br /&gt;
** http://www.zdnet.com/trustwave-sold-root-certificate-for-surveillance-3040095011/&lt;br /&gt;
* Can't trust some browsers – they will sell you out and elide their responsibility&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=724929&lt;br /&gt;
* Can't trust some browsers – they include questionable certificates out of the box&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=542689&lt;br /&gt;
* Can't override some browser's CA list&lt;br /&gt;
** http://my.opera.com/community/forums/topic.dml?id=1580452&lt;br /&gt;
* Can't override OS's CA list (burned into ROM)&lt;br /&gt;
** http://support.google.com/android/bin/answer.py?hl=en&amp;amp;answer=1649774&lt;br /&gt;
* CRL/OCSP does not work as expected/intended&lt;br /&gt;
** http://blog.spiderlabs.com/2011/04/certificate-revocation-behavior-in-modern-browsers.html&lt;br /&gt;
** https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion&lt;br /&gt;
* User will break it too (not just bad guys)&lt;br /&gt;
** http://www.esecurityplanet.com/mobile-security/hacker-bypasses-apples-ios-in-app-purchases.html&lt;br /&gt;
** http://www.h-online.com/security/news/item/Apps-for-Windows-8-easily-hacked-1767839.html&lt;br /&gt;
* Interception proxies add additional risk&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html&lt;br /&gt;
* HTTPS is broken&lt;br /&gt;
** http://www.thoughtcrime.org/software/sslstrip/&lt;br /&gt;
* PKI is broken&lt;br /&gt;
** www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf&lt;br /&gt;
* The Internet is Broken :)&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html&lt;br /&gt;
&lt;br /&gt;
== Operational considerations ==&lt;br /&gt;
&lt;br /&gt;
We use certificate pinning very commonly in my organization (yay for us) but we recently hit a problem when we were routinely changing a certificate on a service. The development team for one of the client applications and implemented pinning, but they had not considered what would happen when the certificate changed. &lt;br /&gt;
&lt;br /&gt;
The majority of our clients support 2 pinned certificates at a time, so when we want to change the server cert the process is&lt;br /&gt;
&lt;br /&gt;
1) Configure the new server cert in the client alongside the old one&lt;br /&gt;
2) Replace the old cert on the server&lt;br /&gt;
3) Configure the old cert from the client&lt;br /&gt;
&lt;br /&gt;
This way we can do the cert rotation usually with no downtime for the client.&lt;br /&gt;
&lt;br /&gt;
The team in question did not do this, which meant they had to have a few minutes of downtime (this is important as we have a demanding SLA) and also it meant that we had to do the change out of office hours to minimize the impact.&lt;br /&gt;
&lt;br /&gt;
So, my suggestion is that we expand this page to include a section on &amp;quot;Operational considerations&amp;quot; that outlines the recommended approach.&lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
If no-one objects, I will add the new section in a couple of days.&lt;br /&gt;
&lt;br /&gt;
[[User:Michael Goodwin|Michael Goodwin]] ([[User talk:Michael Goodwin|talk]]) 06:20, 2 April 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I am not sure how to reply to your question so I will do it inline.  Let me know the appropriate method).&lt;br /&gt;
&lt;br /&gt;
I absolutely agree that this is a needed section.  We have had certificate pinning in for two years and it has been extremely difficult because the teams don't fully grasp the operational implications.  Our strategy has been to include the old cert and the new cert.  Since our app is a consumer app, I have also lobbied extremely hard to get a 'Your app is out of date and needs to be upgraded' but have not got traction.  As a result, every time the certificate changes it's a world of pain since we don't have an effective way to let users know they need to update.   &lt;br /&gt;
&lt;br /&gt;
I have many, many thoughts on the operations side and would love to contribute.&lt;br /&gt;
[[User:SteveA|SteveA]]&lt;br /&gt;
&lt;br /&gt;
== Android example contains code that breaks apps  ==&lt;br /&gt;
&lt;br /&gt;
The Android code example contains a section where it checks that the authtype equals &amp;quot;RSA&amp;quot;.  F5 recently changed their default authtypes to RSA-DHE.  This meant that when we upgraded our F5's in production, all of our Android mobile apps broke.  Obviously a big issue.&lt;br /&gt;
&lt;br /&gt;
What is the compelling reason for this line of code:&lt;br /&gt;
&lt;br /&gt;
if (!(null != authType &amp;amp;&amp;amp; authType.equalsIgnoreCase(&amp;quot;RSA&amp;quot;))) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: AuthType is not RSA&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== iOS sample is bad ==&lt;br /&gt;
&lt;br /&gt;
the iOS sample doesn't need to be an entire program; it should be a minimal Objective-C fragment that demonstrates best practices in loading the keys or key fingerprints from a configuration file.&lt;br /&gt;
&lt;br /&gt;
This Objective-C sample diverges pretty badly from the other language examples, which are short and sweet.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:34, 17 June 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== TODO ==&lt;br /&gt;
&lt;br /&gt;
A flaw in many pinning implementations was pointed out in [https://www.cigital.com/blog/ineffective-certificate-pinning-implementations/]&lt;br /&gt;
Does the OWASP sample code address this?  Probably worth an explicit mention in the doc somewhere.  I don't have time to tackle this now.&lt;br /&gt;
--[[User:TimMorgan|TimMorgan]] ([[User talk:TimMorgan|talk]]) 13:06, 10 March 2016 (CST)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User_talk:Jmanico&amp;diff=218355</id>
		<title>User talk:Jmanico</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User_talk:Jmanico&amp;diff=218355"/>
				<updated>2016-06-29T09:06:34Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* You deleted HTTP Response Splitting */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Jim's Suggestions for 2015 Strategic Plans = &lt;br /&gt;
 __TOC__{{TOC hidden}}&lt;br /&gt;
== Build a scalable OWASP training program that spreads security training around the world ==&lt;br /&gt;
* Focus on building free and open source training materials for all to use&lt;br /&gt;
* Take existing wiki, powerpoint from talks, powerpoints from trainers who have open sourced content, key OWASP training-centric projects (webgoat, security Shepard, etc) and merge, clean up and professionalize the content into an OWASP branded series of trainings.&lt;br /&gt;
* Produce professional OWASP branded training videos and CBT&lt;br /&gt;
* Focus conference training program on using open source as opposed to proprietary/commercial content&lt;br /&gt;
* As a commercial ILT trainer I have a big conflict of interest over this topic&lt;br /&gt;
&lt;br /&gt;
== Strengthen OWASP chapters and increase Chapter’s abilities to spread message of OWASP through locally organized and run events. ==&lt;br /&gt;
* Even something as simple as a chapter meeting is an &amp;quot;event&amp;quot; so anything to help make even chapter meetings better serves this goal&lt;br /&gt;
* Better plan to help chapters use funds&lt;br /&gt;
* Alert all chapters of existing chapter funds, on a monthly basis, on their public lists. Link to &amp;quot;How to use it to spread the message&amp;quot;&lt;br /&gt;
* Help pollenate cross-chapter meetings (Jerry Hoff)&lt;br /&gt;
* FUND SMALLER CHAPTERS IN A VERY SIGNIFICANT WAY&lt;br /&gt;
&lt;br /&gt;
== Mature the OWASP Projects Platform: Provide the OWASP projects community a mature project platform to encourage senior developers to participate in the various and many OWASP projects. ==&lt;br /&gt;
* Consider hiring senior developer/developers to mature code centric OWASP programs like ESAPI, OWASP Java Encoder, etc.&lt;br /&gt;
* Consider funding security initiatives reviewing various open source projects and software frameworks in common use&lt;br /&gt;
* Connect leads of popular open source frameworks to OWASP community members willing to provide free appsec services, products, etc.&lt;br /&gt;
* Build a new website that is developer centric, pointing to key developers/secure coding projects and materials and other resources&lt;br /&gt;
&lt;br /&gt;
== You deleted HTTP Response Splitting ==&lt;br /&gt;
&lt;br /&gt;
Hi Jim, why did you delete the HTTP Response Splitting page? There is no descriptive information in the &amp;quot;move log&amp;quot;.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 04:06, 29 June 2016 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=HTTP_Response_Splitting&amp;diff=216282</id>
		<title>HTTP Response Splitting</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=HTTP_Response_Splitting&amp;diff=216282"/>
				<updated>2016-05-03T15:07:06Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: corrected the example&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Attack}}&lt;br /&gt;
&lt;br /&gt;
Last revision: '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
[[Category:OWASP ASDR Project]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
HTTP response splitting occurs when:&lt;br /&gt;
&lt;br /&gt;
* Data enters a web application through an untrusted source, most frequently an HTTP request. &lt;br /&gt;
* The data is included in an HTTP response header sent to a web user without being validated for malicious characters. &lt;br /&gt;
&lt;br /&gt;
HTTP response splitting is a means to an end, not an end in itself. At its root, the attack is straightforward: an attacker passes malicious data to a vulnerable application, and the application includes the data in an HTTP response header.&lt;br /&gt;
&lt;br /&gt;
To mount a successful exploit, the application must allow input that contains CR (carriage return, also given by %0d or \r) and LF (line feed, also given by %0a or \n)characters into the header AND the underlying platform must be vulnerable to the injection of such characters. These characters not only give attackers control of the remaining headers and body of the response the application intends to send, but also allow them to create additional responses entirely under their control.&lt;br /&gt;
&lt;br /&gt;
The example below uses a Java example, but this issue has been fixed in virtually all modern Java EE application servers. If you are concerned about this risk, you should test on the platform of concern to see if the underlying platform allows for CR or LF characters to be injected into headers. We suspect that, in general, this vulnerability has been fixed in most modern application servers, regardless of what language the code has been written in.&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
The following code segment reads the name of the author of a weblog entry, author, from an HTTP request and sets it in a cookie header of an HTTP response.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	String author = request.getParameter(AUTHOR_PARAM);&lt;br /&gt;
	...&lt;br /&gt;
	Cookie cookie = new Cookie(&amp;quot;author&amp;quot;, author);&lt;br /&gt;
        cookie.setMaxAge(cookieExpiration);&lt;br /&gt;
        response.addCookie(cookie);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Assuming a string consisting of standard alpha-numeric characters, such as &amp;quot;Jane Smith&amp;quot;, is submitted in the request the HTTP response including this cookie might take the following form:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	HTTP/1.1 200 OK&lt;br /&gt;
	...&lt;br /&gt;
	Set-Cookie: author=Jane Smith&lt;br /&gt;
	...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
However, because the value of the cookie is formed of unvalidated user input, the response will only maintain this form if the value submitted for AUTHOR_PARAM does not contain any CR and LF characters. If an attacker submits a malicious string, such as &amp;quot;Wiley Hacker\r\nContent-Length:45\r\n\r\n...&amp;quot;, then the HTTP response would be split into an imposter response followed by the original response, which is now ignored:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
	HTTP/1.1 200 OK&lt;br /&gt;
	...&lt;br /&gt;
	Set-Cookie: author=Wiley Hacker&lt;br /&gt;
	Content-Length: 999&lt;br /&gt;
	&lt;br /&gt;
	&amp;lt;html&amp;gt;malicious content...&amp;lt;/html&amp;gt; (to 999th character in this example)&lt;br /&gt;
	Original content starting with character 1000, which is now ignored by the web browser...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The ability of the attacker to construct arbitrary HTTP responses permits a variety of resulting attacks, including: [[Cross-User Defacement]], [[Cache Poisoning]], [[Cross-site Scripting (XSS)]] and [[Page Hijacking]].&lt;br /&gt;
&lt;br /&gt;
==Related [[Threat Agents]]==&lt;br /&gt;
* [[internal software developer]]&lt;br /&gt;
&lt;br /&gt;
==Related [[Attacks]]==&lt;br /&gt;
* [[Cross-User Defacement]]&lt;br /&gt;
* [[Cache Poisoning]]&lt;br /&gt;
* [[Cross-site Scripting (XSS)]]&lt;br /&gt;
* [[Page Hijacking]]&lt;br /&gt;
&lt;br /&gt;
==Related [[Vulnerabilities]]==&lt;br /&gt;
* [[:Category:Input Validation Vulnerability]]&lt;br /&gt;
&lt;br /&gt;
==Related [[Controls]]==&lt;br /&gt;
* [[:Category:Input Validation]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* http://www.infosecwriters.com/text_resources/pdf/HTTP_Response.pdf - HTTP Response Spliting&lt;br /&gt;
* http://www.securiteam.com/securityreviews/5WP0E2KFGK.html - Introdution to HTTP Response Spliting&lt;br /&gt;
&lt;br /&gt;
[[Category:FIXME|link not working&lt;br /&gt;
&lt;br /&gt;
* Watchfire Whitepaper: HTTP Response Splitting, Web Cache Poisoning Attacks, and Related Topics Whitepaper[http://download.watchfire.com/ttl/wp/HTTPResponseSplitting.pdf?file=HTTPResponseSplitting.pdf&amp;amp;authToken=1214447561_257e36e250a83a8e5942584866d295ee]&lt;br /&gt;
&lt;br /&gt;
]]&lt;br /&gt;
&lt;br /&gt;
==Credit==&lt;br /&gt;
&lt;br /&gt;
{{Template:Fortify}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category: Protocol Manipulation]]&lt;br /&gt;
[[Category: Attack]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CRLF_Injection&amp;diff=216281</id>
		<title>CRLF Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CRLF_Injection&amp;diff=216281"/>
				<updated>2016-05-03T14:57:09Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Vulnerability}}&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''&lt;br /&gt;
&lt;br /&gt;
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
The term CRLF refers to '''C'''arriage '''R'''eturn (ASCII 13, \r) '''L'''ine '''F'''eed (ASCII 10, \n). They're used to note the termination of a line, however, dealt with differently in today’s popular Operating Systems. For example: in Windows both a CR and LF are required to note the end of a line, whereas in Linux/UNIX a LF is only required. In the HTTP protocol, the CR-LF sequence is always used to terminate a line.&lt;br /&gt;
&lt;br /&gt;
A CRLF Injection attack occurs when a user manages to submit a CRLF into an application. This is most commonly done by modifying an HTTP parameter or URL.&lt;br /&gt;
&lt;br /&gt;
==Risk Factors==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Depending on how the application is developed, this can be a minor problem or a fairly serious security flaw. Let's look at the latter because this is after all a security related post. &lt;br /&gt;
&lt;br /&gt;
Let's assume a file is used at some point to read/write data to  a log of some sort. If an attacker managed to place a CRLF then can then inject some sort of read programmatic method to the file. This could result in the contents being written to screen on the next attempt to use this file.&lt;br /&gt;
&lt;br /&gt;
Another example is the &amp;quot;response splitting&amp;quot; attacks, where CRLFs are injected into an application and included in the response.  The extra CRLFs are interpreted by proxies, caches, and maybe browsers as the end of a packet, causing mayhem.&lt;br /&gt;
&lt;br /&gt;
==Related [[Attacks]]==&lt;br /&gt;
&lt;br /&gt;
* [[HTTP Response Splitting]]&lt;br /&gt;
* [[Attack 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Vulnerabilities]]==&lt;br /&gt;
&lt;br /&gt;
* [[Vulnerability 1]]&lt;br /&gt;
* [[Vulnerabiltiy 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Controls]]==&lt;br /&gt;
&lt;br /&gt;
* [[Control 1]]&lt;br /&gt;
* [[Control 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Technical Impacts]]==&lt;br /&gt;
&lt;br /&gt;
* [[Technical Impact 1]]&lt;br /&gt;
* [[Technical Impact 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
[[Category:FIXME|add links&lt;br /&gt;
&lt;br /&gt;
In addition, one should classify vulnerability based on the following subcategories: Ex:&amp;lt;nowiki&amp;gt;[[Category:Error Handling Vulnerability]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Availability Vulnerability&lt;br /&gt;
&lt;br /&gt;
Authorization Vulnerability&lt;br /&gt;
&lt;br /&gt;
Authentication Vulnerability&lt;br /&gt;
&lt;br /&gt;
Concurrency Vulnerability&lt;br /&gt;
&lt;br /&gt;
Configuration Vulnerability&lt;br /&gt;
&lt;br /&gt;
Cryptographic Vulnerability&lt;br /&gt;
&lt;br /&gt;
Encoding Vulnerability&lt;br /&gt;
&lt;br /&gt;
Error Handling Vulnerability&lt;br /&gt;
&lt;br /&gt;
Input Validation Vulnerability&lt;br /&gt;
&lt;br /&gt;
Logging and Auditing Vulnerability&lt;br /&gt;
&lt;br /&gt;
Session Management Vulnerability]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP ASDR Project]]&lt;br /&gt;
[[Category:Vulnerability]]&lt;br /&gt;
[[Category:Implementation]]&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=CRLF_Injection&amp;diff=216280</id>
		<title>CRLF Injection</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=CRLF_Injection&amp;diff=216280"/>
				<updated>2016-05-03T14:55:51Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Template:Vulnerability}}&lt;br /&gt;
&lt;br /&gt;
Last revision (mm/dd/yy): '''{{REVISIONMONTH}}/{{REVISIONDAY}}/{{REVISIONYEAR}}'''&lt;br /&gt;
&lt;br /&gt;
[[ASDR_TOC_Vulnerabilities|Vulnerabilities Table of Contents]]&lt;br /&gt;
&lt;br /&gt;
==Description==&lt;br /&gt;
The term CRLF refers to '''C'''arriage '''R'''eturn (ASCII 13, \r) '''L'''ine '''F'''eed (ASCII 10, \n). They're used to note the termination of a line, however, dealt with differently in today’s popular Operating Systems. For example: in Windows both a CR and LF are required to note the end of a line, whereas in Linux/UNIX a LF is only required.&lt;br /&gt;
&lt;br /&gt;
A CRLF Injection attack occurs when a user manages to submit a CRLF into an application. This is most commonly done by modifying an HTTP parameter or URL.&lt;br /&gt;
&lt;br /&gt;
==Risk Factors==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Examples==&lt;br /&gt;
Depending on how the application is developed, this can be a minor problem or a fairly serious security flaw. Let's look at the latter because this is after all a security related post. &lt;br /&gt;
&lt;br /&gt;
Let's assume a file is used at some point to read/write data to  a log of some sort. If an attacker managed to place a CRLF then can then inject some sort of read programmatic method to the file. This could result in the contents being written to screen on the next attempt to use this file.&lt;br /&gt;
&lt;br /&gt;
Another example is the &amp;quot;response splitting&amp;quot; attacks, where CRLFs are injected into an application and included in the response.  The extra CRLFs are interpreted by proxies, caches, and maybe browsers as the end of a packet, causing mayhem.&lt;br /&gt;
&lt;br /&gt;
==Related [[Attacks]]==&lt;br /&gt;
&lt;br /&gt;
* [[HTTP Response Splitting]]&lt;br /&gt;
* [[Attack 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Vulnerabilities]]==&lt;br /&gt;
&lt;br /&gt;
* [[Vulnerability 1]]&lt;br /&gt;
* [[Vulnerabiltiy 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Controls]]==&lt;br /&gt;
&lt;br /&gt;
* [[Control 1]]&lt;br /&gt;
* [[Control 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Related [[Technical Impacts]]==&lt;br /&gt;
&lt;br /&gt;
* [[Technical Impact 1]]&lt;br /&gt;
* [[Technical Impact 2]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
TBD&lt;br /&gt;
&lt;br /&gt;
[[Category:FIXME|add links&lt;br /&gt;
&lt;br /&gt;
In addition, one should classify vulnerability based on the following subcategories: Ex:&amp;lt;nowiki&amp;gt;[[Category:Error Handling Vulnerability]]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Availability Vulnerability&lt;br /&gt;
&lt;br /&gt;
Authorization Vulnerability&lt;br /&gt;
&lt;br /&gt;
Authentication Vulnerability&lt;br /&gt;
&lt;br /&gt;
Concurrency Vulnerability&lt;br /&gt;
&lt;br /&gt;
Configuration Vulnerability&lt;br /&gt;
&lt;br /&gt;
Cryptographic Vulnerability&lt;br /&gt;
&lt;br /&gt;
Encoding Vulnerability&lt;br /&gt;
&lt;br /&gt;
Error Handling Vulnerability&lt;br /&gt;
&lt;br /&gt;
Input Validation Vulnerability&lt;br /&gt;
&lt;br /&gt;
Logging and Auditing Vulnerability&lt;br /&gt;
&lt;br /&gt;
Session Management Vulnerability]]&lt;br /&gt;
&lt;br /&gt;
__NOTOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:OWASP ASDR Project]]&lt;br /&gt;
[[Category:Vulnerability]]&lt;br /&gt;
[[Category:Implementation]]&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=196278</id>
		<title>Talk:Certificate and Public Key Pinning</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=196278"/>
				<updated>2015-06-17T15:34:02Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* iOS sample is bad */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Past Failures ==&lt;br /&gt;
&lt;br /&gt;
This section is 'further reading' for those interested in surveying the landscape.&lt;br /&gt;
&lt;br /&gt;
* Governments Want/Require Interception&lt;br /&gt;
** Certified Lies: Detecting and Defeating Government Interception Attacks Against SSL, cryptome.org/ssl-mitm.pdf&lt;br /&gt;
** http://www.dailymail.co.uk/indiahome/indianews/article-2126277/No-secrets-Blackberry-Security-services-intercept-data-government-gets-way-messenger-service.html&lt;br /&gt;
* Governments Engage in Interception&lt;br /&gt;
** http://www.thetechherald.com/articles/Tunisian-government-harvesting-usernames-and-passwords/12429/&lt;br /&gt;
* Vendors Provide Interception Taps&lt;br /&gt;
** http://www.cisco.com/web/about/security/intelligence/LI-3GPP.html&lt;br /&gt;
* Governments Use Interception Taps&lt;br /&gt;
** https://www.eff.org/nsa-spying&lt;br /&gt;
* Mobile Interception is Patented&lt;br /&gt;
** Lawful interception for targets in a proxy mobile internet protocol network, http://www.google.com/patents/EP2332309A1&lt;br /&gt;
* Handset manufactures add trusted roots&lt;br /&gt;
** http://gaurangkp.wordpress.com/tag/nokias-man-in-the-middle-attack/&lt;br /&gt;
* Carriers can add trusted roots&lt;br /&gt;
** No reference yet, but http://www.theregister.co.uk/2011/12/15/carrier_iq_privacy_latest/&lt;br /&gt;
* CAs can become compromised&lt;br /&gt;
** http://isc.sans.edu/diary.html?storyid=11500&lt;br /&gt;
* Researchers created Rogue CAs&lt;br /&gt;
** http://www.win.tue.nl/hashclash/rogue-ca/&lt;br /&gt;
* Researchers collided certificates on existing CA certificates&lt;br /&gt;
** http://www.win.tue.nl/~bdeweger/CollidingCertificates/ddl-full.pdf&lt;br /&gt;
* DNS can become compromised&lt;br /&gt;
** http://forums.theregister.co.uk/forum/2/2011/09/05/dns_hijack_service_updated/&lt;br /&gt;
* Physical plant can become compromised&lt;br /&gt;
** http://www.pcworld.com/article/119851/paris_hilton_victim_of_tmobiles_web_flaws.html&lt;br /&gt;
* Its easy to set up an AP or Base Station (Chris Paget's IMSI Catcher)&lt;br /&gt;
** http://www.wired.com/threatlevel/2010/07/intercepting-cell-phone-calls/&lt;br /&gt;
* Can't trust some CAs – they will sell you out and issue subordinate CAs for money&lt;br /&gt;
** http://www.net-security.org/secworld.php?id=12369&lt;br /&gt;
** http://www.zdnet.com/trustwave-sold-root-certificate-for-surveillance-3040095011/&lt;br /&gt;
* Can't trust some browsers – they will sell you out and elide their responsibility&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=724929&lt;br /&gt;
* Can't trust some browsers – they include questionable certificates out of the box&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=542689&lt;br /&gt;
* Can't override some browser's CA list&lt;br /&gt;
** http://my.opera.com/community/forums/topic.dml?id=1580452&lt;br /&gt;
* Can't override OS's CA list (burned into ROM)&lt;br /&gt;
** http://support.google.com/android/bin/answer.py?hl=en&amp;amp;answer=1649774&lt;br /&gt;
* CRL/OCSP does not work as expected/intended&lt;br /&gt;
** http://blog.spiderlabs.com/2011/04/certificate-revocation-behavior-in-modern-browsers.html&lt;br /&gt;
** https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion&lt;br /&gt;
* User will break it too (not just bad guys)&lt;br /&gt;
** http://www.esecurityplanet.com/mobile-security/hacker-bypasses-apples-ios-in-app-purchases.html&lt;br /&gt;
** http://www.h-online.com/security/news/item/Apps-for-Windows-8-easily-hacked-1767839.html&lt;br /&gt;
* Interception proxies add additional risk&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html&lt;br /&gt;
* HTTPS is broken&lt;br /&gt;
** http://www.thoughtcrime.org/software/sslstrip/&lt;br /&gt;
* PKI is broken&lt;br /&gt;
** www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf&lt;br /&gt;
* The Internet is Broken :)&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html&lt;br /&gt;
&lt;br /&gt;
== Operational considerations ==&lt;br /&gt;
&lt;br /&gt;
We use certificate pinning very commonly in my organization (yay for us) but we recently hit a problem when we were routinely changing a certificate on a service. The development team for one of the client applications and implemented pinning, but they had not considered what would happen when the certificate changed. &lt;br /&gt;
&lt;br /&gt;
The majority of our clients support 2 pinned certificates at a time, so when we want to change the server cert the process is&lt;br /&gt;
&lt;br /&gt;
1) Configure the new server cert in the client alongside the old one&lt;br /&gt;
2) Replace the old cert on the server&lt;br /&gt;
3) Configure the old cert from the client&lt;br /&gt;
&lt;br /&gt;
This way we can do the cert rotation usually with no downtime for the client.&lt;br /&gt;
&lt;br /&gt;
The team in question did not do this, which meant they had to have a few minutes of downtime (this is important as we have a demanding SLA) and also it meant that we had to do the change out of office hours to minimize the impact.&lt;br /&gt;
&lt;br /&gt;
So, my suggestion is that we expand this page to include a section on &amp;quot;Operational considerations&amp;quot; that outlines the recommended approach.&lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
If no-one objects, I will add the new section in a couple of days.&lt;br /&gt;
&lt;br /&gt;
[[User:Michael Goodwin|Michael Goodwin]] ([[User talk:Michael Goodwin|talk]]) 06:20, 2 April 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I am not sure how to reply to your question so I will do it inline.  Let me know the appropriate method).&lt;br /&gt;
&lt;br /&gt;
I absolutely agree that this is a needed section.  We have had certificate pinning in for two years and it has been extremely difficult because the teams don't fully grasp the operational implications.  Our strategy has been to include the old cert and the new cert.  Since our app is a consumer app, I have also lobbied extremely hard to get a 'Your app is out of date and needs to be upgraded' but have not got traction.  As a result, every time the certificate changes it's a world of pain since we don't have an effective way to let users know they need to update.   &lt;br /&gt;
&lt;br /&gt;
I have many, many thoughts on the operations side and would love to contribute.&lt;br /&gt;
[[User:SteveA|SteveA]]&lt;br /&gt;
&lt;br /&gt;
== Android example contains code that breaks apps  ==&lt;br /&gt;
&lt;br /&gt;
The Android code example contains a section where it checks that the authtype equals &amp;quot;RSA&amp;quot;.  F5 recently changed their default authtypes to RSA-DHE.  This meant that when we upgraded our F5's in production, all of our Android mobile apps broke.  Obviously a big issue.&lt;br /&gt;
&lt;br /&gt;
What is the compelling reason for this line of code:&lt;br /&gt;
&lt;br /&gt;
if (!(null != authType &amp;amp;&amp;amp; authType.equalsIgnoreCase(&amp;quot;RSA&amp;quot;))) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: AuthType is not RSA&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== iOS sample is bad ==&lt;br /&gt;
&lt;br /&gt;
the iOS sample doesn't need to be an entire program; it should be a minimal Objective-C fragment that demonstrates best practices in loading the keys or key fingerprints from a configuration file.&lt;br /&gt;
&lt;br /&gt;
This Objective-C sample diverges pretty badly from the other language examples, which are short and sweet.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] ([[User talk:Douglasheld|talk]]) 10:34, 17 June 2015 (CDT)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=196277</id>
		<title>Talk:Certificate and Public Key Pinning</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Certificate_and_Public_Key_Pinning&amp;diff=196277"/>
				<updated>2015-06-17T15:33:44Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* iOS sample is bad */ new section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Past Failures ==&lt;br /&gt;
&lt;br /&gt;
This section is 'further reading' for those interested in surveying the landscape.&lt;br /&gt;
&lt;br /&gt;
* Governments Want/Require Interception&lt;br /&gt;
** Certified Lies: Detecting and Defeating Government Interception Attacks Against SSL, cryptome.org/ssl-mitm.pdf&lt;br /&gt;
** http://www.dailymail.co.uk/indiahome/indianews/article-2126277/No-secrets-Blackberry-Security-services-intercept-data-government-gets-way-messenger-service.html&lt;br /&gt;
* Governments Engage in Interception&lt;br /&gt;
** http://www.thetechherald.com/articles/Tunisian-government-harvesting-usernames-and-passwords/12429/&lt;br /&gt;
* Vendors Provide Interception Taps&lt;br /&gt;
** http://www.cisco.com/web/about/security/intelligence/LI-3GPP.html&lt;br /&gt;
* Governments Use Interception Taps&lt;br /&gt;
** https://www.eff.org/nsa-spying&lt;br /&gt;
* Mobile Interception is Patented&lt;br /&gt;
** Lawful interception for targets in a proxy mobile internet protocol network, http://www.google.com/patents/EP2332309A1&lt;br /&gt;
* Handset manufactures add trusted roots&lt;br /&gt;
** http://gaurangkp.wordpress.com/tag/nokias-man-in-the-middle-attack/&lt;br /&gt;
* Carriers can add trusted roots&lt;br /&gt;
** No reference yet, but http://www.theregister.co.uk/2011/12/15/carrier_iq_privacy_latest/&lt;br /&gt;
* CAs can become compromised&lt;br /&gt;
** http://isc.sans.edu/diary.html?storyid=11500&lt;br /&gt;
* Researchers created Rogue CAs&lt;br /&gt;
** http://www.win.tue.nl/hashclash/rogue-ca/&lt;br /&gt;
* Researchers collided certificates on existing CA certificates&lt;br /&gt;
** http://www.win.tue.nl/~bdeweger/CollidingCertificates/ddl-full.pdf&lt;br /&gt;
* DNS can become compromised&lt;br /&gt;
** http://forums.theregister.co.uk/forum/2/2011/09/05/dns_hijack_service_updated/&lt;br /&gt;
* Physical plant can become compromised&lt;br /&gt;
** http://www.pcworld.com/article/119851/paris_hilton_victim_of_tmobiles_web_flaws.html&lt;br /&gt;
* Its easy to set up an AP or Base Station (Chris Paget's IMSI Catcher)&lt;br /&gt;
** http://www.wired.com/threatlevel/2010/07/intercepting-cell-phone-calls/&lt;br /&gt;
* Can't trust some CAs – they will sell you out and issue subordinate CAs for money&lt;br /&gt;
** http://www.net-security.org/secworld.php?id=12369&lt;br /&gt;
** http://www.zdnet.com/trustwave-sold-root-certificate-for-surveillance-3040095011/&lt;br /&gt;
* Can't trust some browsers – they will sell you out and elide their responsibility&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=724929&lt;br /&gt;
* Can't trust some browsers – they include questionable certificates out of the box&lt;br /&gt;
** https://bugzilla.mozilla.org/show_bug.cgi?id=542689&lt;br /&gt;
* Can't override some browser's CA list&lt;br /&gt;
** http://my.opera.com/community/forums/topic.dml?id=1580452&lt;br /&gt;
* Can't override OS's CA list (burned into ROM)&lt;br /&gt;
** http://support.google.com/android/bin/answer.py?hl=en&amp;amp;answer=1649774&lt;br /&gt;
* CRL/OCSP does not work as expected/intended&lt;br /&gt;
** http://blog.spiderlabs.com/2011/04/certificate-revocation-behavior-in-modern-browsers.html&lt;br /&gt;
** https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion&lt;br /&gt;
* User will break it too (not just bad guys)&lt;br /&gt;
** http://www.esecurityplanet.com/mobile-security/hacker-bypasses-apples-ios-in-app-purchases.html&lt;br /&gt;
** http://www.h-online.com/security/news/item/Apps-for-Windows-8-easily-hacked-1767839.html&lt;br /&gt;
* Interception proxies add additional risk&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html&lt;br /&gt;
* HTTPS is broken&lt;br /&gt;
** http://www.thoughtcrime.org/software/sslstrip/&lt;br /&gt;
* PKI is broken&lt;br /&gt;
** www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf&lt;br /&gt;
* The Internet is Broken :)&lt;br /&gt;
** http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html&lt;br /&gt;
&lt;br /&gt;
== Operational considerations ==&lt;br /&gt;
&lt;br /&gt;
We use certificate pinning very commonly in my organization (yay for us) but we recently hit a problem when we were routinely changing a certificate on a service. The development team for one of the client applications and implemented pinning, but they had not considered what would happen when the certificate changed. &lt;br /&gt;
&lt;br /&gt;
The majority of our clients support 2 pinned certificates at a time, so when we want to change the server cert the process is&lt;br /&gt;
&lt;br /&gt;
1) Configure the new server cert in the client alongside the old one&lt;br /&gt;
2) Replace the old cert on the server&lt;br /&gt;
3) Configure the old cert from the client&lt;br /&gt;
&lt;br /&gt;
This way we can do the cert rotation usually with no downtime for the client.&lt;br /&gt;
&lt;br /&gt;
The team in question did not do this, which meant they had to have a few minutes of downtime (this is important as we have a demanding SLA) and also it meant that we had to do the change out of office hours to minimize the impact.&lt;br /&gt;
&lt;br /&gt;
So, my suggestion is that we expand this page to include a section on &amp;quot;Operational considerations&amp;quot; that outlines the recommended approach.&lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
If no-one objects, I will add the new section in a couple of days.&lt;br /&gt;
&lt;br /&gt;
[[User:Michael Goodwin|Michael Goodwin]] ([[User talk:Michael Goodwin|talk]]) 06:20, 2 April 2015 (CDT)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
(I am not sure how to reply to your question so I will do it inline.  Let me know the appropriate method).&lt;br /&gt;
&lt;br /&gt;
I absolutely agree that this is a needed section.  We have had certificate pinning in for two years and it has been extremely difficult because the teams don't fully grasp the operational implications.  Our strategy has been to include the old cert and the new cert.  Since our app is a consumer app, I have also lobbied extremely hard to get a 'Your app is out of date and needs to be upgraded' but have not got traction.  As a result, every time the certificate changes it's a world of pain since we don't have an effective way to let users know they need to update.   &lt;br /&gt;
&lt;br /&gt;
I have many, many thoughts on the operations side and would love to contribute.&lt;br /&gt;
[[User:SteveA|SteveA]]&lt;br /&gt;
&lt;br /&gt;
== Android example contains code that breaks apps  ==&lt;br /&gt;
&lt;br /&gt;
The Android code example contains a section where it checks that the authtype equals &amp;quot;RSA&amp;quot;.  F5 recently changed their default authtypes to RSA-DHE.  This meant that when we upgraded our F5's in production, all of our Android mobile apps broke.  Obviously a big issue.&lt;br /&gt;
&lt;br /&gt;
What is the compelling reason for this line of code:&lt;br /&gt;
&lt;br /&gt;
if (!(null != authType &amp;amp;&amp;amp; authType.equalsIgnoreCase(&amp;quot;RSA&amp;quot;))) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: AuthType is not RSA&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
== iOS sample is bad ==&lt;br /&gt;
&lt;br /&gt;
the iOS sample doesn't need to be an entire program; it should be a minimal Objective-C fragment that demonstrates best practices in loading the keys or key fingerprints from a configuration file.&lt;br /&gt;
&lt;br /&gt;
This Objective-C sample diverges pretty badly from the other language examples, which are short and sweet.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Certificate_and_Public_Key_Pinning&amp;diff=196275</id>
		<title>Certificate and Public Key Pinning</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Certificate_and_Public_Key_Pinning&amp;diff=196275"/>
				<updated>2015-06-17T15:24:12Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[[Certificate and Public Key Pinning]] is a technical guide to implementing certificate and public key pinning as discussed at the ''[https://www.owasp.org/index.php/Virginia Virginia chapter's]'' presentation [[Media:Securing-Wireless-Channels-in-the-Mobile-Space.ppt|Securing Wireless Channels in the Mobile Space]]. This guide is focused on providing clear, simple, actionable guidance for securing the channel in a hostile environment where actors could be malicious and the conference of trust a liability. Additional presentation material included [[Media:pubkey-pin-supplement.pdf|supplement with code excerpts]], [[Media:pubkey-pin-android.zip|Android sample program]], [[Media:pubkey-pin-ios.zip|iOS sample program]], [[Media:pubkey-pin-dotnet.zip|.Net sample program]], and [[Media:pubkey-pin-openssl.zip|OpenSSL sample program]].&lt;br /&gt;
&lt;br /&gt;
A cheat sheet is available at [[Pinning_Cheat_Sheet|Pinning Cheat Sheet]].&lt;br /&gt;
&lt;br /&gt;
== Introduction == &lt;br /&gt;
&lt;br /&gt;
Secure channels are a cornerstone to users and employees working remotely and on the go. Users and developers expect end-to-end security when sending and receiving data - especially sensitive data on channels protected by VPN, SSL, or TLS. While organizations which control DNS and CA have likely reduced risk to trivial levels under most threat models, users and developers subjugated to other's DNS and a public CA hierarchy are exposed to non-trivial amounts of risk. In fact, history has shown those relying on outside services have suffered chronic breaches in their secure channels.&lt;br /&gt;
&lt;br /&gt;
The pandemic abuse of trust has resulted in users, developers and applications making security related decisions on untrusted input. The situation is somewhat of a paradox: entities such as DNS and CAs are trusted and supposed to supply trusted input; yet their input cannot be trusted. Relying on untrusted input for security related decisions is not only bad karma, it violates a number of secure coding principals (see, for example, OWASP's [[Injection Theory]] and [[Data Validation]]).&lt;br /&gt;
&lt;br /&gt;
Pinning effectively removes the &amp;quot;conference of trust&amp;quot;. An application which pins a certificate or public key no longer needs to depend on others - such as DNS or CAs - when making security decisions relating to a peer's identity. For those familiar with SSH, you should realize that public key pinning is nearly identical to SSH's &amp;lt;tt&amp;gt;StrictHostKeyChecking&amp;lt;/tt&amp;gt; option. SSH had it right the entire time, and the rest of the world is beginning to realize the virtues of directly identifying a host or service by its public key.&lt;br /&gt;
&lt;br /&gt;
Others who actively engage in pinning include Google and its browser Chrome. Chrome was successful in detecting the DigiNotar compromise which uncovered suspected interception by the Iranian government on its citizens. The initial report of the compromise can be found at ''[https://productforums.google.com/d/topic/gmail/3J3r2JqFNTw/discussion Is This MITM Attack to Gmail's SSL?]''; and Google Security's immediate response at ''[https://googleonlinesecurity.blogspot.com/2011/08/update-on-attempted-man-in-middle.html An update on attempted man-in-the-middle attacks]''.&lt;br /&gt;
&lt;br /&gt;
== What's the problem? ==&lt;br /&gt;
&lt;br /&gt;
Users, developers, and applications expect end-to-end security on their secure channels, but some secure channels are not meeting the expectation. Specifically, channels built using well known protocols such as VPN, SSL, and TLS can be vulnerable to a number of attacks.&lt;br /&gt;
&lt;br /&gt;
Examples of past failures are listed on the discussion tab for this article. This cheat sheet does not attempt to catalogue the failures in the industry, investigate the design flaws in the scaffolding, justify the lack of accountability or liability with the providers, explain the race to the bottom in services, or demystify the collusion between, for example, Browsers and CAs. For additional reading, please visit ''[http://www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf PKI is Broken]'' and ''[http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html The Internet is Broken]''.&lt;br /&gt;
&lt;br /&gt;
=== Patient 0 ===&lt;br /&gt;
&lt;br /&gt;
The original problem was the ''Key Distribution Problem''. Insecure communications can be transformed into a secure communication problem with encryption. Encrypted communications can be transformed into an identity problem with signatures. The identity problem terminates at the key distribution problem. They are the same problem.&lt;br /&gt;
&lt;br /&gt;
=== The Cures ===&lt;br /&gt;
&lt;br /&gt;
There are three cures for the key distribution problem. First is to have first hand knowledge of your partner or peer (i.e., a peer, server or service). This could be solved with SneakerNet. Unfortunately, SneakerNet does not scale and cannot be used to solve the key distribution problem.&lt;br /&gt;
&lt;br /&gt;
The second is to rely on others, and it has two variants: (1) web of trust, and (2) hierarchy of trust. Web of Trust and Hierarchy of Trust solve the key distribution problem in a sterile environment. However, Web of Trust and Hierarchy of Trust each requires us to rely on others - or '''confer trust'''. In practice, trusting others is showing to be problematic.&lt;br /&gt;
&lt;br /&gt;
== What Is Pinning? ==&lt;br /&gt;
&lt;br /&gt;
Pinning is the process of associating a host with their ''expected'' X509 certificate or public key. Once a certificate or public key is known or seen for a host, the certificate or public key is associated or 'pinned' to the host. If more than one certificate or public key is acceptable, then the program holds a ''pinset'' (taking from [https://developers.google.com/events/io/sessions/gooio2012/107/ Jon Larimer and Kenny Root Google I/O talk]). In this case, the advertised identity must match one of the elements in the pinset.&lt;br /&gt;
&lt;br /&gt;
A host or service's certificate or public key can be added to an application at development time, or it can be added upon first encountering the certificate or public key. The former - adding at development time - is preferred since ''preloading'' the certificate or public key ''out of band'' usually means the attacker cannot taint the pin. If the certificate or public key is added upon first encounter, you will be using ''key continuity''. Key continuity can fail if the attacker has a privileged position during the first first encounter.&lt;br /&gt;
&lt;br /&gt;
Pinning leverages knowledge of the pre-existing relationship between the user and an organization or service to help make better security related decisions. Because you already have information on the server or service, you don't need to rely on generalized mechanisms meant to solve the ''key distribution'' problem. That is, you don't need to turn to DNS for name/address mappings or CAs for bindings and status. One exception is revocation and it is discussed below in [[#Pinning_Gaps|Pinning Gaps]].&lt;br /&gt;
&lt;br /&gt;
It is also worth mention that Pinning is not Stapling. Stapling sends both the certificate and  OCSP responder information in the same request to avoid the additional fetches the client should perform during path validations.&lt;br /&gt;
&lt;br /&gt;
=== When Do You Pin? ===&lt;br /&gt;
&lt;br /&gt;
You should pin anytime you want to be relatively certain of the remote host's identity or when operating in a hostile environment. Since one or both are almost always true, you should probably pin all the time.&lt;br /&gt;
&lt;br /&gt;
A perfect case in point: during the two weeks or so of preparation for the presentation and cheat sheet, we've observed three relevant and related failures. First was [http://gaurangkp.wordpress.com/2013/01/09/nokia-https-mitm/ Nokia/Opera willfully breaking the secure channel]; second was [http://blog.malwarebytes.org/intelligence/2013/02/digital-certificates-and-malware-a-dangerous-mix/ DigiCert issuing a code signing certificate for malware]; and third was [http://krebsonsecurity.com/2013/02/security-firm-bit9-hacked-used-to-spread-malware/ Bit9's loss of its root signing key]. The environment is not only hostile, its toxic.&lt;br /&gt;
&lt;br /&gt;
=== When Do You Whitelist? ===&lt;br /&gt;
&lt;br /&gt;
If you are working for an organization which practices &amp;quot;egress filtering&amp;quot; as part of a Data Loss Prevention (DLP) strategy, you will likely encounter ''Interception Proxies''. I like to refer to these things as '''&amp;quot;good&amp;quot; bad guys''' (as opposed to '''&amp;quot;bad&amp;quot; bad guys''') since both break end-to-end security and we can't tell them apart. In this case, '''do not''' offer to whitelist the interception proxy since it defeats your security goals. Add the interception proxy's public key to your pinset after being '''instructed''' to do so by the folks in Risk Acceptance.&lt;br /&gt;
&lt;br /&gt;
Note: if you whitelist a certificate or public key for a different host (for example, to accommodate an interception proxy), you are no longer pinning the expected certificates and keys for the host. Security and integrity on the channel could suffer, and it surely breaks end-to-end security expectations of users and organizations.&lt;br /&gt;
&lt;br /&gt;
For more reading on interception proxies, the additional risk they bestow, and how they fail, see Dr. Matthew Green's ''[http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html How do Interception Proxies fail?]'' and Jeff Jarmoc's BlackHat talk ''[https://www.blackhat.com/html/bh-eu-12/bh-eu-12-archives.html#jarmoc SSL/TLS Interception Proxies and Transitive Trust]''.&lt;br /&gt;
&lt;br /&gt;
=== How Do You Pin? ===&lt;br /&gt;
&lt;br /&gt;
The idea is to re-use the existing protocols and infrastructure, but use them in a hardened manner. For re-use, a program would keep doing the things it used to do when establishing a secure connection.&lt;br /&gt;
&lt;br /&gt;
To harden the channel, the program would take advantage of the &amp;lt;tt&amp;gt;OnConnect&amp;lt;/tt&amp;gt; callback offered by a library, framework or platform. In the callback, the program would verify the remote host's identity by validating its certificate or public key. While pinning does not have to occur in an &amp;lt;tt&amp;gt;OnConnect&amp;lt;/tt&amp;gt; callback, its often most convenient because the underlying connection information is readily available.&lt;br /&gt;
&lt;br /&gt;
== What Should Be Pinned? ==&lt;br /&gt;
&lt;br /&gt;
The first thing to decide is what should be pinned. For this choice, you have two options: you can (1) pin  the certificate; or (2) pin the public key. If you choose public keys, you have two additional choices: (a) pin the &amp;lt;tt&amp;gt;subjectPublicKeyInfo&amp;lt;/tt&amp;gt;; or (b) pin one of the concrete types such as &amp;lt;tt&amp;gt;RSAPublicKey&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;DSAPublicKey&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The three choices are explained below in more detail. I would encourage you to pin the &amp;lt;tt&amp;gt;subjectPublicKeyInfo&amp;lt;/tt&amp;gt; because it has the public parameters (such as &amp;lt;tt&amp;gt;{e,n}&amp;lt;/tt&amp;gt; for an RSA public key) '''and''' contextual information such as an algorithm and OID. The context will help you keep your bearings at times, and Figure 1 below shows the additional information available.&lt;br /&gt;
&lt;br /&gt;
=== Encodings/Formats ===&lt;br /&gt;
&lt;br /&gt;
For the purposes of this article, the objects are in X509-compatible presentation format (PKCS#1 defers to X509, both of which use ASN.1). If you have a PEM encoded object (for example, &amp;lt;tt&amp;gt;-----BEGIN CERTIFICATE-----&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;-----END CERTIFICATE-----&amp;lt;/tt&amp;gt;), then convert the object to DER encoding. Conversion using OpenSSL is offered below in [[#Format_Conversions|Format Conversions]].&lt;br /&gt;
&lt;br /&gt;
A certificate is an object which binds an entity (such as a person or organization) to a public key via a signature. The certificate is DER encoded, and has associated data or attributes such as ''Subject'' (who is identified or bound), ''Issuer'' (who signed it), ''Validity'' (''NotBefore'' and ''NotAfter''), and a ''Public Key''.&lt;br /&gt;
&lt;br /&gt;
A certificate has a ''subjectPublicKeyInfo''. The subjectPublicKeyInfo is a key with additional information. The ASN.1 type includes an ''Algorithm ID'', a ''Version'', and an extensible format to hold a concrete public key. Figures 1 and 2 below show different views of the same RSA key, which is the subjectPublicKeyInfo. The key is for the site [https://www.random.org random.org], and it is used in the sample programs and listings below.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
| [[File:random-org-der-dump.png|thumb|375px|Figure 1: subjectPublicKeyInfo dumped with dumpans1]]&lt;br /&gt;
| [[File:random-org-der-hex.png|thumb|375px|Figure 2: subjectPublicKeyInfo under a hex editor]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The concrete public key is an encoded public key. The key format will usually be specified elsewhere - for example, PKCS#1 in the case of RSA Public Keys. In the case of an RSA public key, the type is ''RSAPublicKey'' and the parameters &amp;lt;tt&amp;gt;{e,n}&amp;lt;/tt&amp;gt; will be ASN.1 encoded. Figures 1 and 2 above clearly show the modulus (''n'' at line 28) and exponent (''e'' at line 289). For DSA, the concrete type is DSAPublicKey and the ASN.1 encoded parameters would be &amp;lt;tt&amp;gt;{p,q,g,y}&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Final takeaways: (1) a certificate binds an entity to a public key; (2) a certificate has a subjectPublicKeyInfo; and (3) a subjectPublicKeyInfo has an concrete public key. For those who want to learn more, a more in-depth discussion from a programmer's perspective can be found at the Code Project's article ''[http://www.codeproject.com/Articles/25487/Cryptographic-Interoperability-Keys Cryptographic Interoperability: Keys]''.&lt;br /&gt;
&lt;br /&gt;
=== Certificate ===&lt;br /&gt;
&lt;br /&gt;
[[File:pin-cert.png|thumb|right|100px|Certificate]] The certificate is easiest to pin. You can fetch the certificate out of band for the website, have the IT folks email your company certificate to you, use &amp;lt;tt&amp;gt;openssl s_client&amp;lt;/tt&amp;gt; to retrieve the certificate etc. When the certificate expires, you would update your application. Assuming your application has no bugs or security defects, the application would be updated every year or two.&lt;br /&gt;
&lt;br /&gt;
At runtime, you retrieve the website or server's certificate in the callback. Within the callback, you compare the retrieved certificate with the certificate embedded within the program. If the comparison fails, then fail the method or function. &lt;br /&gt;
&lt;br /&gt;
There is a downside to pinning a certificate. If the site rotates its certificate on a regular basis, then your application would need to be updated regularly. For example, Google rotates its certificates, so you will need to update your application about once a month (if it depended on Google services). Even though Google rotates its certificates, the underlying public keys (within the certificate) remain static.&lt;br /&gt;
&lt;br /&gt;
=== Public Key ===&lt;br /&gt;
&lt;br /&gt;
[[File:pin-pubkey.png|thumb|right|100px|Public Key]] Public key pinning is more flexible but a little trickier due to the extra steps necessary to extract the public key from a certificate. As with a certificate, the program checks the extracted public key with its embedded copy of the public key.&lt;br /&gt;
&lt;br /&gt;
There are two downsides two public key pinning. First, its harder to work with keys (versus certificates) since you usually must extract the key from the certificate. Extraction is a minor inconvenience in Java and .Net, buts its uncomfortable in Cocoa/CocoaTouch and OpenSSL. Second, the key is static and may violate key rotation policies.&lt;br /&gt;
&lt;br /&gt;
=== Hashing ===&lt;br /&gt;
&lt;br /&gt;
While the three choices above used DER encoding, its also acceptable to use a hash of the information (or other transforms). In fact, the original sample programs were written using digested certificates and public keys. The samples were changed to allow a programmer to inspect the objects with tools like &amp;lt;tt&amp;gt;dumpasn1&amp;lt;/tt&amp;gt; and other ASN.1 decoders.&lt;br /&gt;
&lt;br /&gt;
Hashing also provides three additional benefits. First, hashing allows you to anonymize a certificate or public key. This might be important if you application is concerned about leaking information during decompilation and re-engineering.&lt;br /&gt;
&lt;br /&gt;
Second, a digested certificate fingerprint is often available as a native API for many libraries, so its convenient to use.&lt;br /&gt;
&lt;br /&gt;
Finally, an organization might want to supply a reserve (or back-up) identity in case the primary identity is compromised. Hashing ensures your adversaries do not see the reserved certificate or public key in advance of its use. In fact, Google's IETF draft ''websec-key-pinning'' uses the technique.&lt;br /&gt;
&lt;br /&gt;
== What About X509? ==&lt;br /&gt;
&lt;br /&gt;
PKI{X} and the Internet form an intersection. What Internet users expect and what they receive from CAs could vary wildly. For example, an Internet user has security goals, while a CA has revenue goals and legal goals. Many are surprised to learn that the user is often required to perform host identity verification even though the CA issued the certificate (the details are buried in CA warranties on their certificates and their Certification Practice Statement (CPS)).&lt;br /&gt;
&lt;br /&gt;
There are a number of PKI profiles available. For the Internet, &amp;quot;Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL)&amp;quot;, also known as [http://tools.ietf.org/rfc/rfc5280.txt RFC 5280], is of interest. Since a certificate is specified in the ITU's X509 standard, there are lots of mandatory and optional fields available for validation from both bodies. Because of the disjoint goals among groups, the next section provides guidance.&lt;br /&gt;
&lt;br /&gt;
=== Mandatory Checks ===&lt;br /&gt;
&lt;br /&gt;
All X509 verifications must include:&lt;br /&gt;
&lt;br /&gt;
* A path validation check. The check verifies all the signatures on certificates in the chain are valid under a given PKI. The check begins at the server or service's certificate (the leaf), and proceeds back to a trusted root certificate (the root).&lt;br /&gt;
&lt;br /&gt;
* A validity check, or the &amp;lt;tt&amp;gt;notBefore&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;notAfter&amp;lt;/tt&amp;gt; fields. The &amp;lt;tt&amp;gt;notAfter&amp;lt;/tt&amp;gt; field is especially important since a CA will not warrant the certificate after the date, and it does not have to provide CRL/OCSP updates after the date.&lt;br /&gt;
&lt;br /&gt;
* Revocation status. As with &amp;lt;tt&amp;gt;notAfter&amp;lt;/tt&amp;gt;, revocation is important because the CA will not warrant a certificate once it is listed as revoked. The IETF approved way of checking a certificate's revocation is OCSP and specified in [http://tools.ietf.org/rfc/rfc2560.txt RFC 2560].&lt;br /&gt;
&lt;br /&gt;
=== Optional Checks ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;[Mulling over what else to present, and the best way to present it. Subject name? DNS lookups? Key Usage? Algorithms? Geolocation based on IP? Check back soon.]&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
In the model which pre-dated PKIX RFC-5280, X.509v1 there was strong binding of the certificate Subject name to the X.500 Directory.  With the update to X.509v3, the Directory is  still the standard for authentication of caCertificate attributes, versus accepting a self signed root. Geo-location is important, the fake certificate for Google was given a location of Florida, instead of Mountain View, CA. The binding of the certificate to the Directory can anchor the root caCertificate, in effect &amp;quot;pin&amp;quot; it, to a valid entity that can have demonstrable attributes such as location.  This is detailed in RFC-1255.  Additional fields specified, such as the subject alternative field, for example a RFC-822 email address, or DNS name, can be located in the DNS, but the actual heavy lifting is done by the X.500 Directory, which is used currently as a cross-certificate trust conduit at the Federal Bridge between major communities of interest, that are not Internet focused. While those cross-certificates are valuable in validation between trust communities, a self-signed root, still needs to be either pinned, curated in trust bundle such as in  web browser software secure storage or represented by a federated community. The Directory can play a role to fill in gaps to validate caCertificates, either locally, or nationally under an administrative domain such as c=US. By divorcing the subject from the Directory entry, problems begin to arise in which pinning plays a key role to ensure that client and server have the same reference points.&lt;br /&gt;
&lt;br /&gt;
=== Public Key Checks ===&lt;br /&gt;
&lt;br /&gt;
''Quod vide'' (''q.v.''). Verifying the identity of a host with knowledge of its associated/expected public key is pinning.&lt;br /&gt;
&lt;br /&gt;
== Examples of Pinning ==&lt;br /&gt;
&lt;br /&gt;
This section demonstrates certificate and public key pinning in Android Java, iOS, .Net, and OpenSSL. All programs attempt to connect to [https://www.random.org random.org] and fetch bytes (Dr. Mads Haahr participates in AOSP's pinning program, so the site should have a static key). The programs enjoy a pre-existing relationship with the site (more correctly, ''a priori'' knowledge), so they include a copy of the site's public key and pin the identity on the key.&lt;br /&gt;
&lt;br /&gt;
Parameter validation, return value checking, and error checking have been omitted in the code below, but is present in the sample programs. So the sample code is ready for copy/paste. By far, the most uncomfortable languages are C-based: iOS and OpenSSL.&lt;br /&gt;
&lt;br /&gt;
===HTTP pinning===&lt;br /&gt;
[http://www.rfc-editor.org/rfc/rfc7469.txt RFC 7469] introduced a new HTTP header that allows SSL servers to declare hashes of their certificates with time scope in which these certificates should not be changed. For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
       Public-Key-Pins: max-age=2592000;&lt;br /&gt;
       pin-sha256=&amp;quot;E9CZ9INDbd+2eRQozYqqbQ2yXLVKB9+xcprMF+44U1g=&amp;quot;;&lt;br /&gt;
       pin-sha256=&amp;quot;LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=&amp;quot;;&lt;br /&gt;
       report-uri=&amp;quot;http://example.com/pkp-report&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please note that [http://www.rfc-editor.org/rfc/rfc7469.txt RFC 7469] is controversial since it allows overrides for locally installed authorities. That is, it allows an adversary or other party who successfully phishes the user to override a known good pinset with non-authentic or fraudulent information. Second, the reporting mechanism is suppressed from broken pinsets, so a complying user agent will be complicit in the cover up after the fact. That is, the reporting of the broken pinset is called out as '''MUST NOT''' report [https://en.wikipedia.org/w/index.php?title=HTTP_Public_Key_Pinning [1]].&lt;br /&gt;
&lt;br /&gt;
=== Android ===&lt;br /&gt;
&lt;br /&gt;
Pinning in Android is accomplished through a custom &amp;lt;tt&amp;gt;X509TrustManager&amp;lt;/tt&amp;gt;. &amp;lt;tt&amp;gt;X509TrustManager&amp;lt;/tt&amp;gt; should perform the customary X509 checks in addition to performing the pin.&lt;br /&gt;
&lt;br /&gt;
Download: [[Media:pubkey-pin-android.zip|Android sample program]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;public final class PubKeyManager implements X509TrustManager&lt;br /&gt;
{&lt;br /&gt;
  private static String PUB_KEY = &amp;quot;30820122300d06092a864886f70d0101&amp;quot; +&lt;br /&gt;
    &amp;quot;0105000382010f003082010a0282010100b35ea8adaf4cb6db86068a836f3c85&amp;quot; +&lt;br /&gt;
    &amp;quot;5a545b1f0cc8afb19e38213bac4d55c3f2f19df6dee82ead67f70a990131b6bc&amp;quot; +&lt;br /&gt;
    &amp;quot;ac1a9116acc883862f00593199df19ce027c8eaaae8e3121f7f329219464e657&amp;quot; +&lt;br /&gt;
    &amp;quot;2cbf66e8e229eac2992dd795c4f23df0fe72b6ceef457eba0b9029619e0395b8&amp;quot; +&lt;br /&gt;
    &amp;quot;609851849dd6214589a2ceba4f7a7dcceb7ab2a6b60c27c69317bd7ab2135f50&amp;quot; +&lt;br /&gt;
    &amp;quot;c6317e5dbfb9d1e55936e4109b7b911450c746fe0d5d07165b6b23ada7700b00&amp;quot; +&lt;br /&gt;
    &amp;quot;33238c858ad179a82459c4718019c111b4ef7be53e5972e06ca68a112406da38&amp;quot; +&lt;br /&gt;
    &amp;quot;cf60d2f4fda4d1cd52f1da9fd6104d91a34455cd7b328b02525320a35253147b&amp;quot; +&lt;br /&gt;
    &amp;quot;e0b7a5bc860966dc84f10d723ce7eed5430203010001&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  public void checkServerTrusted(X509Certificate[] chain, String authType) throws CertificateException&lt;br /&gt;
  {&lt;br /&gt;
    if (chain == null) {&lt;br /&gt;
      throw new IllegalArgumentException(&amp;quot;checkServerTrusted: X509Certificate array is null&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!(chain.length &amp;gt; 0)) {&lt;br /&gt;
      throw new IllegalArgumentException(&amp;quot;checkServerTrusted: X509Certificate is empty&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (!(null != authType &amp;amp;&amp;amp; authType.equalsIgnoreCase(&amp;quot;RSA&amp;quot;))) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: AuthType is not RSA&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Perform customary SSL/TLS checks&lt;br /&gt;
    try {&lt;br /&gt;
      TrustManagerFactory tmf = TrustManagerFactory.getInstance(&amp;quot;X509&amp;quot;);&lt;br /&gt;
      tmf.init((KeyStore) null);&lt;br /&gt;
      &lt;br /&gt;
      for (TrustManager trustManager : tmf.getTrustManagers()) {&lt;br /&gt;
        ((X509TrustManager) trustManager).checkServerTrusted(chain, authType);&lt;br /&gt;
      }&lt;br /&gt;
    } catch (Exception e) {&lt;br /&gt;
      throw new CertificateException(e);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    // Hack ahead: BigInteger and toString(). We know a DER encoded Public Key begins&lt;br /&gt;
    // with 0x30 (ASN.1 SEQUENCE and CONSTRUCTED), so there is no leading 0x00 to drop.&lt;br /&gt;
    RSAPublicKey pubkey = (RSAPublicKey) chain[0].getPublicKey();&lt;br /&gt;
    String encoded = new BigInteger(1 /* positive */, pubkey.getEncoded()).toString(16);&lt;br /&gt;
&lt;br /&gt;
    // Pin it!&lt;br /&gt;
    final boolean expected = PUB_KEY.equalsIgnoreCase(encoded);&lt;br /&gt;
    if (!expected) {&lt;br /&gt;
      throw new CertificateException(&amp;quot;checkServerTrusted: Expected public key: &amp;quot;&lt;br /&gt;
                + PUB_KEY + &amp;quot;, got public key:&amp;quot; + encoded);&lt;br /&gt;
      }&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;PubKeyManager&amp;lt;/tt&amp;gt; would be used in code similar to below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;TrustManager tm[] = { new PubKeyManager() };&lt;br /&gt;
&lt;br /&gt;
SSLContext context = SSLContext.getInstance(&amp;quot;TLS&amp;quot;);&lt;br /&gt;
context.init(null, tm, null);&lt;br /&gt;
&lt;br /&gt;
URL url = new URL( &amp;quot;https://www.random.org/integers/?&amp;quot; +&lt;br /&gt;
                   &amp;quot;num=16&amp;amp;min=0&amp;amp;max=255&amp;amp;col=16&amp;amp;base=10&amp;amp;format=plain&amp;amp;rnd=new&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
HttpsURLConnection connection = (HttpsURLConnection) url.openConnection();&lt;br /&gt;
connection.setSSLSocketFactory(context.getSocketFactory());&lt;br /&gt;
&lt;br /&gt;
InputStreamReader instream = new InputStreamReader(connection.getInputStream());&lt;br /&gt;
StreamTokenizer tokenizer = new StreamTokenizer(instream);&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== iOS ===&lt;br /&gt;
&lt;br /&gt;
iOS pinning is performed through a &amp;lt;tt&amp;gt;NSURLConnectionDelegate&amp;lt;/tt&amp;gt;. The delegate must implement &amp;lt;tt&amp;gt;connection:canAuthenticateAgainstProtectionSpace:&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;connection:didReceiveAuthenticationChallenge:&amp;lt;/tt&amp;gt;. Within &amp;lt;tt&amp;gt;connection:didReceiveAuthenticationChallenge:&amp;lt;/tt&amp;gt;, the delegate must call &amp;lt;tt&amp;gt;SecTrustEvaluate&amp;lt;/tt&amp;gt; to perform customary X509 checks.&lt;br /&gt;
&lt;br /&gt;
Download: [[Media:pubkey-pin-ios.zip|iOS sample program]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;-(IBAction)fetchButtonTapped:(id)sender&lt;br /&gt;
{&lt;br /&gt;
    NSString* requestString = @&amp;quot;https://www.random.org/integers/?&lt;br /&gt;
        num=16&amp;amp;min=0&amp;amp;max=255&amp;amp;col=16&amp;amp;base=16&amp;amp;format=plain&amp;amp;rnd=new&amp;quot;;&lt;br /&gt;
    NSURL* requestUrl = [NSURL URLWithString:requestString];&lt;br /&gt;
&lt;br /&gt;
    NSURLRequest* request = [NSURLRequest requestWithURL:requestUrl&lt;br /&gt;
                                             cachePolicy:NSURLRequestReloadIgnoringLocalCacheData&lt;br /&gt;
                                         timeoutInterval:10.0f];&lt;br /&gt;
&lt;br /&gt;
    NSURLConnection* connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
-(BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:&lt;br /&gt;
                  (NSURLProtectionSpace*)space&lt;br /&gt;
{&lt;br /&gt;
    return [[space authenticationMethod] isEqualToString: NSURLAuthenticationMethodServerTrust];&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:&lt;br /&gt;
                   (NSURLAuthenticationChallenge *)challenge&lt;br /&gt;
{&lt;br /&gt;
  if ([[[challenge protectionSpace] authenticationMethod] isEqualToString: NSURLAuthenticationMethodServerTrust])&lt;br /&gt;
  {&lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
      SecTrustRef serverTrust = [[challenge protectionSpace] serverTrust];&lt;br /&gt;
      if(nil == serverTrust)&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      OSStatus status = SecTrustEvaluate(serverTrust, NULL);&lt;br /&gt;
      if(!(errSecSuccess == status))&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      SecCertificateRef serverCertificate = SecTrustGetCertificateAtIndex(serverTrust, 0);&lt;br /&gt;
      if(nil == serverCertificate)&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      CFDataRef serverCertificateData = SecCertificateCopyData(serverCertificate);&lt;br /&gt;
      [(id)serverCertificateData autorelease];&lt;br /&gt;
      if(nil == serverCertificateData)&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      const UInt8* const data = CFDataGetBytePtr(serverCertificateData);&lt;br /&gt;
      const CFIndex size = CFDataGetLength(serverCertificateData);&lt;br /&gt;
      NSData* cert1 = [NSData dataWithBytes:data length:(NSUInteger)size];&lt;br /&gt;
&lt;br /&gt;
      NSString *file = [[NSBundle mainBundle] pathForResource:@&amp;quot;random-org&amp;quot; ofType:@&amp;quot;der&amp;quot;];&lt;br /&gt;
      NSData* cert2 = [NSData dataWithContentsOfFile:file];&lt;br /&gt;
&lt;br /&gt;
      if(nil == cert1 || nil == cert2)&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      const BOOL equal = [cert1 isEqualToData:cert2];&lt;br /&gt;
      if(!equal)&lt;br /&gt;
        break; /* failed */&lt;br /&gt;
&lt;br /&gt;
      // The only good exit point&lt;br /&gt;
      return [[challenge sender] useCredential: [NSURLCredential credentialForTrust: serverTrust]&lt;br /&gt;
                    forAuthenticationChallenge: challenge];&lt;br /&gt;
    } while(0);&lt;br /&gt;
&lt;br /&gt;
    // Bad dog&lt;br /&gt;
    return [[challenge sender] cancelAuthenticationChallenge: challenge];&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== .Net ===&lt;br /&gt;
&lt;br /&gt;
.Net pinning can be achieved by using &amp;lt;tt&amp;gt;ServicePointManager&amp;lt;/tt&amp;gt; as shown below.&lt;br /&gt;
&lt;br /&gt;
Download: [[Media:pubkey-pin-dotnet.zip|.Net sample program]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;// Encoded RSAPublicKey&lt;br /&gt;
private static String PUB_KEY = &amp;quot;30818902818100C4A06B7B52F8D17DC1CCB47362&amp;quot; +&lt;br /&gt;
    &amp;quot;C64AB799AAE19E245A7559E9CEEC7D8AA4DF07CB0B21FDFD763C63A313A668FE9D764E&amp;quot; +&lt;br /&gt;
    &amp;quot;D913C51A676788DB62AF624F422C2F112C1316922AA5D37823CD9F43D1FC54513D14B2&amp;quot; +&lt;br /&gt;
    &amp;quot;9E36991F08A042C42EAAEEE5FE8E2CB10167174A359CEBF6FACC2C9CA933AD403137EE&amp;quot; +&lt;br /&gt;
    &amp;quot;2C3F4CBED9460129C72B0203010001&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
public static void Main(string[] args)&lt;br /&gt;
{&lt;br /&gt;
  ServicePointManager.ServerCertificateValidationCallback = PinPublicKey;&lt;br /&gt;
  WebRequest wr = WebRequest.Create(&amp;quot;https://encrypted.google.com/&amp;quot;);&lt;br /&gt;
  wr.GetResponse();&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
public static bool PinPublicKey(object sender, X509Certificate certificate, X509Chain chain,&lt;br /&gt;
                                SslPolicyErrors sslPolicyErrors)&lt;br /&gt;
{&lt;br /&gt;
  if (null == certificate)&lt;br /&gt;
    return false;&lt;br /&gt;
&lt;br /&gt;
  String pk = certificate.GetPublicKeyString();&lt;br /&gt;
  if (pk.Equals(PUB_KEY))&lt;br /&gt;
    return true;&lt;br /&gt;
&lt;br /&gt;
  // Bad dog&lt;br /&gt;
  return false;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== OpenSSL ===&lt;br /&gt;
&lt;br /&gt;
Pinning can occur at one of two places with OpenSSL. First is the user supplied &amp;lt;tt&amp;gt;verify_callback&amp;lt;/tt&amp;gt;. Second is after the connection is established via &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt;. Either method will allow you to access the peer's certificate.&lt;br /&gt;
&lt;br /&gt;
Though OpenSSL performs the X509 checks, you must fail the connection and tear down the socket on error. By design, a server that does not supply a certificate will result in &amp;lt;tt&amp;gt;X509_V_OK&amp;lt;/tt&amp;gt; with a '''NULL''' certificate. To check the result of the customary verification: (1) you must call &amp;lt;tt&amp;gt;SSL_get_verify_result&amp;lt;/tt&amp;gt; and verify the return code is &amp;lt;tt&amp;gt;X509_V_OK&amp;lt;/tt&amp;gt;; and (2) you must call &amp;lt;tt&amp;gt;SSL_get_peer_certificate&amp;lt;/tt&amp;gt; and verify the certificate is '''non-NULL'''.&lt;br /&gt;
&lt;br /&gt;
Download: [[Media:pubkey-pin-openssl.zip|OpenSSL sample program]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;int pkp_pin_peer_pubkey(SSL* ssl)&lt;br /&gt;
{&lt;br /&gt;
    if(NULL == ssl) return FALSE;&lt;br /&gt;
    &lt;br /&gt;
    X509* cert = NULL;&lt;br /&gt;
    FILE* fp = NULL;&lt;br /&gt;
    &lt;br /&gt;
    /* Scratch */&lt;br /&gt;
    int len1 = 0, len2 = 0;&lt;br /&gt;
    unsigned char *buff1 = NULL, *buff2 = NULL;&lt;br /&gt;
    &lt;br /&gt;
    /* Result is returned to caller */&lt;br /&gt;
    int ret = 0, result = FALSE;&lt;br /&gt;
    &lt;br /&gt;
    do&lt;br /&gt;
    {&lt;br /&gt;
        /* http://www.openssl.org/docs/ssl/SSL_get_peer_certificate.html */&lt;br /&gt;
        cert = SSL_get_peer_certificate(ssl);&lt;br /&gt;
        if(!(cert != NULL))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Begin Gyrations to get the subjectPublicKeyInfo       */&lt;br /&gt;
        /* Thanks to Viktor Dukhovni on the OpenSSL mailing list */&lt;br /&gt;
        &lt;br /&gt;
        /* http://groups.google.com/group/mailing.openssl.users/browse_thread/thread/d61858dae102c6c7 */&lt;br /&gt;
        len1 = i2d_X509_PUBKEY(X509_get_X509_PUBKEY(cert), NULL);&lt;br /&gt;
        if(!(len1 &amp;gt; 0))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* scratch */&lt;br /&gt;
        unsigned char* temp = NULL;&lt;br /&gt;
        &lt;br /&gt;
        /* http://www.openssl.org/docs/crypto/buffer.html */&lt;br /&gt;
        buff1 = temp = OPENSSL_malloc(len1);&lt;br /&gt;
        if(!(buff1 != NULL))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* http://www.openssl.org/docs/crypto/d2i_X509.html */&lt;br /&gt;
        len2 = i2d_X509_PUBKEY(X509_get_X509_PUBKEY(cert), &amp;amp;temp);&lt;br /&gt;
&lt;br /&gt;
        /* These checks are verifying we got back the same values as when we sized the buffer.      */&lt;br /&gt;
        /* Its pretty weak since they should always be the same. But it gives us something to test. */&lt;br /&gt;
        if(!((len1 == len2) &amp;amp;&amp;amp; (temp != NULL) &amp;amp;&amp;amp; ((temp - buff1) == len1)))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* End Gyrations */&lt;br /&gt;
        &lt;br /&gt;
        /* See the warning above!!!                                            */&lt;br /&gt;
        /* http://pubs.opengroup.org/onlinepubs/009696699/functions/fopen.html */&lt;br /&gt;
        fp = fopen(&amp;quot;random-org.der&amp;quot;, &amp;quot;rx&amp;quot;);&lt;br /&gt;
        if(NULL ==fp) {&lt;br /&gt;
            fp = fopen(&amp;quot;random-org.der&amp;quot;, &amp;quot;r&amp;quot;);&lt;br /&gt;
        &lt;br /&gt;
        if(!(NULL != fp))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Seek to eof to determine the file's size                            */&lt;br /&gt;
        /* http://pubs.opengroup.org/onlinepubs/009696699/functions/fseek.html */&lt;br /&gt;
        ret = fseek(fp, 0, SEEK_END);&lt;br /&gt;
        if(!(0 == ret))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Fetch the file's size                                               */&lt;br /&gt;
        /* http://pubs.opengroup.org/onlinepubs/009696699/functions/ftell.html */&lt;br /&gt;
        long size = ftell(fp);&lt;br /&gt;
&lt;br /&gt;
        /* Arbitrary size, but should be relatively small (less than 1K or 2K) */&lt;br /&gt;
        if(!(size != -1 &amp;amp;&amp;amp; size &amp;gt; 0 &amp;amp;&amp;amp; size &amp;lt; 2048))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Rewind to beginning to perform the read                             */&lt;br /&gt;
        /* http://pubs.opengroup.org/onlinepubs/009696699/functions/fseek.html */&lt;br /&gt;
        ret = fseek(fp, 0, SEEK_SET);&lt;br /&gt;
        if(!(0 == ret))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Re-use buff2 and len2 */&lt;br /&gt;
        buff2 = NULL; len2 = (int)size;&lt;br /&gt;
        &lt;br /&gt;
        /* http://www.openssl.org/docs/crypto/buffer.html */&lt;br /&gt;
        buff2 = OPENSSL_malloc(len2);&lt;br /&gt;
        if(!(buff2 != NULL))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* http://pubs.opengroup.org/onlinepubs/009696699/functions/fread.html */&lt;br /&gt;
        /* Returns number of elements read, which should be 1 */&lt;br /&gt;
        ret = (int)fread(buff2, (size_t)len2, 1, fp);&lt;br /&gt;
        if(!(ret == 1))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* Re-use size. MIN and MAX macro below... */&lt;br /&gt;
        size = len1 &amp;lt; len2 ? len1 : len2;&lt;br /&gt;
        &lt;br /&gt;
        /*************************/&lt;br /&gt;
        /*****    PAYDIRT    *****/&lt;br /&gt;
        /*************************/&lt;br /&gt;
        if(len1 != (int)size || len2 != (int)size || 0 != memcmp(buff1, buff2, (size_t)size))&lt;br /&gt;
            break; /* failed */&lt;br /&gt;
        &lt;br /&gt;
        /* The one good exit point */&lt;br /&gt;
        result = TRUE;&lt;br /&gt;
        &lt;br /&gt;
    } while(0);&lt;br /&gt;
    &lt;br /&gt;
    if(fp != NULL)&lt;br /&gt;
        fclose(fp);&lt;br /&gt;
    &lt;br /&gt;
    /* http://www.openssl.org/docs/crypto/buffer.html */&lt;br /&gt;
    if(NULL != buff2)&lt;br /&gt;
        OPENSSL_free(buff2);&lt;br /&gt;
    &lt;br /&gt;
    /* http://www.openssl.org/docs/crypto/buffer.html */&lt;br /&gt;
    if(NULL != buff1)&lt;br /&gt;
        OPENSSL_free(buff1);&lt;br /&gt;
    &lt;br /&gt;
    /* http://www.openssl.org/docs/crypto/X509_new.html */&lt;br /&gt;
    if(NULL != cert)&lt;br /&gt;
        X509_free(cert);&lt;br /&gt;
    &lt;br /&gt;
    return result;&lt;br /&gt;
}&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Pinning Alternatives ==&lt;br /&gt;
&lt;br /&gt;
Not all applications use split key cryptography. Fortunately, there are protocols which allow you to set up a secure channel based on knowledge of passwords and pre-shared secrets (rather than putting the secret on the wire in a basic authentication scheme). Two are listed below - SRP and PSK. SRP and PSK have [http://www.iana.org/assignments/tls-parameters/tls-parameters.xml#tls-parameters-3 88 cipher suites assigned to them by IANA for TLS], so there's no shortage of choices.&lt;br /&gt;
&lt;br /&gt;
{| align=&amp;quot;center&amp;quot;&lt;br /&gt;
| [[File:pin-iana-assigned.png|thumb|450px|Figure 3: IANA reserved cipher suites for SRP and PSK]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== SRP ===&lt;br /&gt;
&lt;br /&gt;
Secure Remote Password (SRP) is a Password Authenticated Key Exchange (PAKE) by Thomas Wu based upon Diffie-Hellman. The protocol is standardized in [https://tools.ietf.org/rfc/rfc5054.txt RFC 5054] and available in the OpenSSL library (among others). In the SRP scheme, the server uses a verifier which consists of a &amp;lt;tt&amp;gt;{salt, hash(password)}&amp;lt;/tt&amp;gt; pair. The user has the password and receives the salt from the server. With lots of hand waving, both parties select per-instance random values (nonces) and execute the protocol using ''g&amp;lt;sup&amp;gt;{(salt + password)|verifier} + nonces&amp;lt;/sup&amp;gt;'' rather than traditional Diffie-Hellman using ''g&amp;lt;sup&amp;gt;ab&amp;lt;/sup&amp;gt;''.&lt;br /&gt;
&lt;br /&gt;
[[File:homer-p-np.jpg|thumb|right|150px|P=NP!!!]]Diffie-Hellman based schemes are part of a family of problems based on Discrete Logs (DL), which are logarithms over a finite field. DL schemes are appealing because they are known to be hard (unless ''P=NP'', which would cause computational number theorists to have a cow).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== PSK ===&lt;br /&gt;
&lt;br /&gt;
PSK is Pre-Shared Key and specified in [https://tools.ietf.org/rfc/rfc4279.txt RFC 4279] and [https://tools.ietf.org/rfc/rfc4764.txt RFC 4764]. The shared secret is used as a pre-master secret in TLS-PSK for SSL/TLS; or used to key a block cipher in EAP-PSK. EAP-PSK is designed for authentication over insecure networks such as IEEE 802.11.&lt;br /&gt;
&lt;br /&gt;
== Miscellaneous ==&lt;br /&gt;
&lt;br /&gt;
This sections covers administrivia and miscellaneous items related to pinning.&lt;br /&gt;
&lt;br /&gt;
=== Ephemeral Keys ===&lt;br /&gt;
&lt;br /&gt;
Ephemeral keys are temporary keys used for one instance of a protocol execution and then thrown away. An ephemeral key has the benefit of providing forward secrecy, meaning a compromise of the site or service's long term (static) signing key does not facilitate decrypting past messages because the key was temporary and discarded (once the session terminated).&lt;br /&gt;
&lt;br /&gt;
Ephemeral keys do not affect pinning because the Ephemeral key is delivered in a separate &amp;lt;tt&amp;gt;ServerKeyExchange&amp;lt;/tt&amp;gt; message. In addition, the ephemeral key is a key and not a certificate, so it does not change the construction of the certificate chain. That is, the certificate of interest will still be located at &amp;lt;tt&amp;gt;certificates[0]&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Pinning Gaps ===&lt;br /&gt;
&lt;br /&gt;
There are two gaps when pinning due to reuse of the existing infrastructure and protocols. First, an explicit challenge is '''not''' sent by the program to the peer server based on the server's public information. So the program never knows if the peer can actually decrypt messages. However, the shortcoming is usually academic in practice since an adversary will receive messages it can't decrypt.&lt;br /&gt;
&lt;br /&gt;
Second is revocation. Clients don't usually engage in revocation checking, so it could be possible to use a known bad certificate or key in a pinset. Even if revocation is active, Certificate Revocation Lists (CRLs) and Online Certificate Status Protocol (OCSP) can be defeated in a hostile environment. An application can take steps to remediate, with the primary means being freshness. That is, an application should be updated and distributed immediately when a critical security parameter changes.&lt;br /&gt;
&lt;br /&gt;
=== No Relationship ^@$! ===&lt;br /&gt;
&lt;br /&gt;
If you don't have a pre-existing relationship, all is not lost. First, you can pin a host or server's certificate or public key the first time you encounter it. If the bad guy was not active when you encountered the certificate or public key, he or she will not be successful with future funny business.&lt;br /&gt;
&lt;br /&gt;
Second, bad certificates are being spotted quicker in the field due to projects like [http://www.chromium.org Chromium] and [https://addons.mozilla.org/en-us/firefox/addon/certificate-patrol/ Certificate Patrol], and initiatives like the EFF's [https://www.eff.org/observatory SSL Observatory].&lt;br /&gt;
&lt;br /&gt;
Third, help is on its way, and there are a number of futures that will assist with the endeavors:&lt;br /&gt;
&lt;br /&gt;
* Public Key Pinning (http://www.ietf.org/id/draft-ietf-websec-key-pinning-09.txt) – an extension to the HTTP protocol allowing web host operators to instruct user agents (UAs) to remember (&amp;quot;pin&amp;quot;) the hosts' cryptographic identities for a given period of time.&lt;br /&gt;
* DNS-based Authentication of Named Entities (DANE) (https://datatracker.ietf.org/doc/rfc6698/) - uses Secure DNS to associate Certificates with Domain Names For S/MIME, SMTP with TLS, DNSSEC and TLSA records.&lt;br /&gt;
* Sovereign Keys (http://www.eff.org/sovereign-keys) - operates by providing an optional and secure way of associating domain names with public keys via DNSSEC. PKI (hierarchical) is still used. Semi-centralized with append only logging.&lt;br /&gt;
* Convergence (http://convergence.io) – different [geographical] views of a site and its associated data (certificates and public keys). Web of Trust is used. Semi-centralized.&lt;br /&gt;
&lt;br /&gt;
While Sovereign Keys and Convergence still require us to confer trust to outside parties, the parties involved do not serve share holders or covet revenue streams. Their interests are industry transparency and user security.&lt;br /&gt;
&lt;br /&gt;
=== More Information? ===&lt;br /&gt;
&lt;br /&gt;
Pinning is an ''old new thing'' that has been shaken, stirred, and repackaged. While &amp;quot;pinning&amp;quot; and &amp;quot;pinsets&amp;quot; are relatively new terms for old things, Jon Larimer and Kenny Root spent time on the subject at Google I/O 2012 with their talk ''[https://developers.google.com/events/io/sessions/gooio2012/107/ Security and Privacy in Android Apps]''.&lt;br /&gt;
&lt;br /&gt;
=== Format Conversions ===&lt;br /&gt;
&lt;br /&gt;
As a convenience to readers, the following with convert between PEM and DER format using OpenSSL.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Public key, X509&lt;br /&gt;
$ openssl genrsa -out rsa-openssl.pem 3072&lt;br /&gt;
$ openssl rsa -in rsa-openssl.pem -pubout -outform DER -out rsa-openssl.der&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;# Private key, PKCS#8&lt;br /&gt;
$ openssl genrsa -out rsa-openssl.pem 3072&lt;br /&gt;
$ openssl pkcs8 -nocrypt -in rsa-openssl.pem -inform PEM -topk8 -outform DER -out rsa-openssl.der&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
* OWASP [[Injection_Theory|Injection Theory]]&lt;br /&gt;
* OWASP [[Data_Validation|Data Validation]]&lt;br /&gt;
* OWASP [[Transport_Layer_Protection_Cheat_Sheet|Transport Layer Protection Cheat Sheet]]&lt;br /&gt;
* IETF [http://www.ietf.org/id/draft-ietf-websec-key-pinning-09.txt Public Key Pinning]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc5054.txt RFC 5054 (SRP)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc4764.txt RFC 4764 (EAP-PSK)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc1421.txt RFC 1421 (PEM Encoding)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc5280.txt RFC 5280 (Internet X.509, PKIX)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc4648.txt RFC 4648 (Base16, Base32, and Base64 Encodings)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc3279.txt RFC 3279 (PKI, X509 Algorithms and CRL Profiles)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc4055.txt RFC 4055 (PKI, X509 Additional Algorithms and CRL Profiles)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc2246.txt RFC 2246 (TLS 1.0)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc4346.txt RFC 4346 (TLS 1.1)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc5246.txt RFC 5246 (TLS 1.2)]&lt;br /&gt;
* IETF [http://www.ietf.org/rfc/rfc6698.txt RFC 6698, Draft (DANE)]&lt;br /&gt;
* EFF [http://www.eff.org/sovereign-keys Sovereign Keys]&lt;br /&gt;
* Thoughtcrime Labs [http://convergence.io/ Convergence]&lt;br /&gt;
* RSA Laboratories [http://www.rsa.com/rsalabs/node.asp?id=2125 PKCS#1, RSA Encryption Standard]&lt;br /&gt;
* RSA Laboratories [http://www.rsa.com/rsalabs/node.asp?id=2128 PKCS#6, Extended-Certificate Syntax Standard]&lt;br /&gt;
* ITU [http://www.itu.int/rec/T-REC-X.690-200811-I/en Specification of Basic Encoding Rules (BER), Canonical Encoding Rules (CER) and Distinguished Encoding Rules (DER)]&lt;br /&gt;
* TOR Project [https://blog.torproject.org/blog/detecting-certificate-authority-compromises-and-web-browser-collusion Detecting Certificate Authority Compromises and Web Browser Collusion]&lt;br /&gt;
* Code Project [http://www.codeproject.com/Articles/25487/Cryptographic-Interoperability-Keys Cryptographic Interoperability: Keys]&lt;br /&gt;
* Google I/O [https://developers.google.com/events/io/sessions/gooio2012/107/ Security and Privacy in Android Apps]&lt;br /&gt;
* Trevor Perrin [https://crypto.stanford.edu/RealWorldCrypto/slides/perrin.pdf Transparency, Trust Agility, Pinning (Recent Developments in Server Authentication)]&lt;br /&gt;
* Dr. Peter Gutmann's [http://www.cs.auckland.ac.nz/~pgut001/pubs/pkitutorial.pdf PKI is Broken]&lt;br /&gt;
* Dr. Matthew Green's [http://blog.cryptographyengineering.com/2012/02/how-to-fix-internet.html The Internet is Broken]&lt;br /&gt;
* Dr. Matthew Green's [http://blog.cryptographyengineering.com/2012/03/how-do-interception-proxies-fail.html How do Interception Proxies fail?]&lt;br /&gt;
&lt;br /&gt;
= Authors and Primary Editors  =&lt;br /&gt;
&lt;br /&gt;
* Jeffrey Walton - jeffrey, owasp.org&lt;br /&gt;
* JohnSteven - john, owasp.org&lt;br /&gt;
* Jim Manico - jim, owasp.org&lt;br /&gt;
* Kevin Wall - kevin, owasp.org&lt;br /&gt;
&lt;br /&gt;
[[Category:Control]]&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117310</id>
		<title>AppSecResearch2012/wp-content/presentations/Doug Held - A Buffer Overflow Story.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117310"/>
				<updated>2011-09-13T23:26:22Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Added author portrait&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''A Buffer Overflow Story: From Responsible Disclosure to Closure'''  ==&lt;br /&gt;
[[File:Douglas_held_20110508_R_centre.jpg‎]]&lt;br /&gt;
&amp;lt;br&amp;gt;Douglas Held &amp;lt;br&amp;gt;Software Security Consultant &amp;lt;br&amp;gt;Fortify Software &amp;lt;br&amp;gt;doug.held@hp.com &lt;br /&gt;
&lt;br /&gt;
== '''Link to the presentation:''' [[File:A Buffer Overflow Story.pdf]] ==&lt;br /&gt;
&lt;br /&gt;
== '''Abstract:''' ==&lt;br /&gt;
&lt;br /&gt;
The US National Institutes of Science and Technology has been holding a competition to choose a design for the Secure Hash Algorithm, version 3 (&amp;quot;SHA-3&amp;quot;). The primary goal is for the cryptographic community to weed out the less secure algorithms and choose from the remainder. Each submission includes a C reference implementation for demonstrating performance, a factor in the final choice. &lt;br /&gt;
&lt;br /&gt;
Fortify Software undertook an automated code review of the SHA-3 round 1 contestants' reference implementations, including Ron Rivest's MD6. &lt;br /&gt;
&lt;br /&gt;
Findings included bugs that could cause crashes, performance or security problems. After a follow up audit and contacting the developers with the findings, Fortify reported summary results on the Fortify blog and on Slashdot.org. According to the blog entry, &amp;quot;This just emphasizes what we already knew about C, even the most careful, security conscious developer messes up memory management.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
The speaker will discuss specific findings, including some very unexpected outcomes, as well as wildly differing perspectives from the developer community. The story underscores the need to continue improving education and processes to further the goal of computing securely.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:Douglas_held_20110508_R_centre.jpg&amp;diff=117309</id>
		<title>File:Douglas held 20110508 R centre.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:Douglas_held_20110508_R_centre.jpg&amp;diff=117309"/>
				<updated>2011-09-13T23:22:03Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: uploaded a new version of &amp;amp;quot;File:Douglas held 20110508 R centre.jpg&amp;amp;quot;: Photographic portrait of Douglas Held (OWASP speaker)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Portrait of Douglas Held (OWASP speaker)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:File-Douglas_held_20110508_R_centre.jpg&amp;diff=117308</id>
		<title>File:File-Douglas held 20110508 R centre.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:File-Douglas_held_20110508_R_centre.jpg&amp;diff=117308"/>
				<updated>2011-09-13T23:16:59Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Photographic portrait of Douglas Held (OWASP speaker)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Photographic portrait of Douglas Held (OWASP speaker)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=User:Douglasheld&amp;diff=117307</id>
		<title>User:Douglasheld</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=User:Douglasheld&amp;diff=117307"/>
				<updated>2011-09-13T23:10:36Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Initial content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Douglas held 20110508 R centre.jpg]]&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:Douglas_held_20110508_R_centre.jpg&amp;diff=117306</id>
		<title>File:Douglas held 20110508 R centre.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:Douglas_held_20110508_R_centre.jpg&amp;diff=117306"/>
				<updated>2011-09-13T23:09:28Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Portrait of Douglas Held (OWASP speaker)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Portrait of Douglas Held (OWASP speaker)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117305</id>
		<title>AppSecResearch2012/wp-content/presentations/Doug Held - A Buffer Overflow Story.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117305"/>
				<updated>2011-09-13T23:06:03Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''A Buffer Overflow Story: From Responsible Disclosure to Closure'''  ==&lt;br /&gt;
&lt;br /&gt;
Douglas Held &amp;lt;br&amp;gt;Software Security Consultant &amp;lt;br&amp;gt;Fortify Software &amp;lt;br&amp;gt;doug.held@hp.com &lt;br /&gt;
&lt;br /&gt;
'''Link to the presentation:''' [[Image:A Buffer Overflow Story.pdf]] &lt;br /&gt;
&lt;br /&gt;
'''Abstract:''' &lt;br /&gt;
&lt;br /&gt;
The US National Institutes of Science and Technology has been holding a competition to choose a design for the Secure Hash Algorithm, version 3 (&amp;quot;SHA-3&amp;quot;). The primary goal is for the cryptographic community to weed out the less secure algorithms and choose from the remainder. Each submission includes a C reference implementation for demonstrating performance, a factor in the final choice. &lt;br /&gt;
&lt;br /&gt;
Fortify Software undertook an automated code review of the SHA-3 round 1 contestants' reference implementations, including Ron Rivest's MD6. &lt;br /&gt;
&lt;br /&gt;
Findings included bugs that could cause crashes, performance or security problems. After a follow up audit and contacting the developers with the findings, Fortify reported summary results on the Fortify blog and on Slashdot.org. According to the blog entry, &amp;quot;This just emphasizes what we already knew about C, even the most careful, security conscious developer messes up memory management.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
The speaker will discuss specific findings, including some very unexpected outcomes, as well as wildly differing perspectives from the developer community. The story underscores the need to continue improving education and processes to further the goal of computing securely.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117304</id>
		<title>AppSecResearch2012/wp-content/presentations/Doug Held - A Buffer Overflow Story.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117304"/>
				<updated>2011-09-13T23:03:47Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: /* A Buffer Overflow Story: From Responsible Disclosure to Closure */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''A Buffer Overflow Story: From Responsible Disclosure to Closure'''  ==&lt;br /&gt;
&lt;br /&gt;
Douglas Held &amp;lt;br&amp;gt;Software Security Consultant &amp;lt;br&amp;gt;Fortify Software doug.held@hp.com &lt;br /&gt;
&lt;br /&gt;
'''Link to the presentation:''' [[Image:A Buffer Overflow Story.pdf]] &lt;br /&gt;
&lt;br /&gt;
'''Abstract:''' &lt;br /&gt;
&lt;br /&gt;
The US National Institutes of Science and Technology has been holding a competition to choose a design for the Secure Hash Algorithm, version 3 (&amp;quot;SHA-3&amp;quot;). The primary goal is for the cryptographic community to weed out the less secure algorithms and choose from the remainder. Each submission includes a C reference implementation for demonstrating performance, a factor in the final choice. &lt;br /&gt;
&lt;br /&gt;
Fortify Software undertook an automated code review of the SHA-3 round 1 contestants' reference implementations, including Ron Rivest's MD6. &lt;br /&gt;
&lt;br /&gt;
Findings included bugs that could cause crashes, performance or security problems. After a follow up audit and contacting the developers with the findings, Fortify reported summary results on the Fortify blog and on Slashdot.org. According to the blog entry, &amp;quot;This just emphasizes what we already knew about C, even the most careful, security conscious developer messes up memory management.&amp;quot; &lt;br /&gt;
&lt;br /&gt;
The speaker will discuss specific findings, including some very unexpected outcomes, as well as wildly differing perspectives from the developer community. The story underscores the need to continue improving education and processes to further the goal of computing securely.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117303</id>
		<title>AppSecResearch2012/wp-content/presentations/Doug Held - A Buffer Overflow Story.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=AppSecResearch2012/wp-content/presentations/Doug_Held_-_A_Buffer_Overflow_Story.pdf&amp;diff=117303"/>
				<updated>2011-09-13T23:02:25Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Initial content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''A Buffer Overflow Story: From Responsible Disclosure to Closure''' ==&lt;br /&gt;
Douglas Held&lt;br /&gt;
Software Security Consultant&lt;br /&gt;
Fortify Software&lt;br /&gt;
doug.held@hp.com&lt;br /&gt;
&lt;br /&gt;
'''Link to the presentation:''' [[File:A_Buffer_Overflow_Story.pdf]]&lt;br /&gt;
&lt;br /&gt;
'''Abstract:'''&lt;br /&gt;
&lt;br /&gt;
The US National Institutes of Science and Technology has been holding a competition to choose a design for the Secure Hash Algorithm, version 3 (&amp;quot;SHA-3&amp;quot;). The primary goal is for the cryptographic community to weed out the less secure algorithms and choose from the remainder. Each submission includes a C reference implementation for demonstrating performance, a factor in the final choice.  &lt;br /&gt;
&lt;br /&gt;
Fortify Software undertook an automated code review of the SHA-3 round 1 contestants' reference implementations, including Ron Rivest's MD6.  &lt;br /&gt;
&lt;br /&gt;
Findings included bugs that could cause crashes, performance or security problems. After a follow up audit and contacting the developers with the findings, Fortify reported summary results on the Fortify blog and on Slashdot.org. According to the blog entry, &amp;quot;This just emphasizes what we already knew about C, even the most careful, security conscious developer messes up memory management.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
The speaker will discuss specific findings, including some very unexpected outcomes, as well as wildly differing perspectives from the developer community. The story underscores the need to continue improving education and processes to further the goal of computing securely.&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=File:A_Buffer_Overflow_Story.pdf&amp;diff=117302</id>
		<title>File:A Buffer Overflow Story.pdf</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=File:A_Buffer_Overflow_Story.pdf&amp;diff=117302"/>
				<updated>2011-09-13T22:54:34Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: Douglas Held (Fortify Sofware) presentation to OWASP AppSec EU 2011&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Douglas Held (Fortify Sofware) presentation to OWASP AppSec EU 2011&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	<entry>
		<id>https://wiki.owasp.org/index.php?title=Talk:Securing_tomcat&amp;diff=57912</id>
		<title>Talk:Securing tomcat</title>
		<link rel="alternate" type="text/html" href="https://wiki.owasp.org/index.php?title=Talk:Securing_tomcat&amp;diff=57912"/>
				<updated>2009-04-03T18:06:06Z</updated>
		
		<summary type="html">&lt;p&gt;Douglasheld: new section: File Permissions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== File permissions ==&lt;br /&gt;
&lt;br /&gt;
Hmm, what does &amp;quot;Make sure tomcat user has read/write access to /tmp&amp;quot; mean?  &lt;br /&gt;
&lt;br /&gt;
Tomcat creates a directory &amp;quot;temp&amp;quot;, not &amp;quot;tmp&amp;quot;, and read/write on a directory doesn't actually allow reading or writing.  I assume the intention is &amp;quot;chmod 700 temp&amp;quot;... would love if anyone can clarify.&lt;br /&gt;
[[User:Douglasheld|Douglasheld]] 18:06, 3 April 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Newer Tomcat branches ==&lt;br /&gt;
&lt;br /&gt;
This page is hopelessly outdated for anyone working with the Tomcat 6 branch.  We need to figure out the best way to document security measures for the different supported branches.&lt;br /&gt;
[[User:Ken|Ken]] 10:25, 20 March 2009 (UTC)&lt;br /&gt;
&lt;br /&gt;
I've not had call to use Tomcat 6, but in a few months I plan to start experimenting with the embedded version.  I don't mind expanding the article to have a section on 6 (and keep the section on 5.5), but I can't contribute anything just yet.  My preference would be a single article as it will cut down on duplication.  In the meantime, any differences, areas to cover, new features, etc. that others could note down will help speed things up. [[User:Dledmonds|Darren]] 09:11, 26 March 2009 (UTC)&lt;/div&gt;</summary>
		<author><name>Douglasheld</name></author>	</entry>

	</feed>