This site is the archived OWASP Foundation Wiki and is no longer accepting Account Requests.
To view the new OWASP Foundation website, please visit https://owasp.org
Difference between revisions of "SAML Security Cheat Sheet"
m (moving nav to bottom for mobile friendliness) |
m (formatting) |
||
Line 10: | Line 10: | ||
The <i>Security Assertion Markup Language</i> (SAML) is an open standard for exchanging authorization and authentication information. The <i>Web Browser SAML/SSO Profile with Redirect/POST bindings</i> is one of the most common SSO implementation. This cheatsheet will focus primarily on that profile. | The <i>Security Assertion Markup Language</i> (SAML) is an open standard for exchanging authorization and authentication information. The <i>Web Browser SAML/SSO Profile with Redirect/POST bindings</i> is one of the most common SSO implementation. This cheatsheet will focus primarily on that profile. | ||
− | =Validate Message Confidentiality and Integrity= | + | |
+ | = Validate Message Confidentiality and Integrity = | ||
* [[Transport Layer Protection Cheat Sheet|TLS 1.2]] is the most common solution to guarantee message confidentiality and integrity. Refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-sec-consider-2.0-os.pdf SAML Security (section 4)] for additional information. This step will help counter the following attacks: | * [[Transport Layer Protection Cheat Sheet|TLS 1.2]] is the most common solution to guarantee message confidentiality and integrity. Refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-sec-consider-2.0-os.pdf SAML Security (section 4)] for additional information. This step will help counter the following attacks: | ||
Line 22: | Line 23: | ||
**Man-in-the-middle 6.4.2 | **Man-in-the-middle 6.4.2 | ||
**Forged Assertion 6.4.3 | **Forged Assertion 6.4.3 | ||
+ | |||
=Validate Protocol Usage= | =Validate Protocol Usage= | ||
Line 44: | Line 46: | ||
** Never used getElementsByTagName to select security related elements in an XML document without prior validation. | ** Never used getElementsByTagName to select security related elements in an XML document without prior validation. | ||
**Always use absolute XPath expressions to select elements, unless a hardened schema is used for validation. | **Always use absolute XPath expressions to select elements, unless a hardened schema is used for validation. | ||
+ | |||
=Validate Protocol Processing Rules= | =Validate Protocol Processing Rules= | ||
Line 55: | Line 58: | ||
** Forged Assertion (6.4.3) | ** Forged Assertion (6.4.3) | ||
** Browser State Exposure (6.4.4) | ** Browser State Exposure (6.4.4) | ||
+ | |||
=Validate Binding Implementation= | =Validate Binding Implementation= | ||
Line 60: | Line 64: | ||
*For an HTTP Redirect Binding refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf SAML Binding] (3.4). To view an encoding example, you may want to reference RequestUtil.java found within [https://developers.google.com/google-apps/sso/saml_reference_implementation_web Google's reference implementation]. | *For an HTTP Redirect Binding refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf SAML Binding] (3.4). To view an encoding example, you may want to reference RequestUtil.java found within [https://developers.google.com/google-apps/sso/saml_reference_implementation_web Google's reference implementation]. | ||
* For an HTTP POST Binding refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf SAML Binding] (3.5). The caching considerations are also very important. If a SAML protocol message gets cached, it can subsequently be used as a Stolen Assertion (6.4.1) or Replay (6.4.5) attack. | * For an HTTP POST Binding refer to [http://docs.oasis-open.org/security/saml/v2.0/saml-bindings-2.0-os.pdf SAML Binding] (3.5). The caching considerations are also very important. If a SAML protocol message gets cached, it can subsequently be used as a Stolen Assertion (6.4.1) or Replay (6.4.5) attack. | ||
+ | |||
=Validate Security Countermeasures= | =Validate Security Countermeasures= | ||
Line 75: | Line 80: | ||
Need an architectural diagram? The [http://www.oasis-open.org/committees/download.php/11511/sstc-saml-tech-overview-2.0-draft-03.pdf SAML technical overview] contains the most complete diagrams. For the Web Browser SSO Profile with Redirect/POST bindings refer to the section 4.1.3. In fact, of all the SAML documentation, the technical overview is the most valuable from a high-level perspective. | Need an architectural diagram? The [http://www.oasis-open.org/committees/download.php/11511/sstc-saml-tech-overview-2.0-draft-03.pdf SAML technical overview] contains the most complete diagrams. For the Web Browser SSO Profile with Redirect/POST bindings refer to the section 4.1.3. In fact, of all the SAML documentation, the technical overview is the most valuable from a high-level perspective. | ||
+ | |||
= Authors and Primary Editors = | = Authors and Primary Editors = | ||
Line 80: | Line 86: | ||
* [http://bradbroulik.blogspot.dk/2010/01/bulletproof-sso-with-saml-20.html Brad Broulik] | * [http://bradbroulik.blogspot.dk/2010/01/bulletproof-sso-with-saml-20.html Brad Broulik] | ||
* [https://ipsec.pl/ Paweł Krawczyk] | * [https://ipsec.pl/ Paweł Krawczyk] | ||
+ | |||
== Other Cheatsheets == | == Other Cheatsheets == |
Revision as of 01:27, 1 September 2015
Last revision (mm/dd/yy): 09/1/2015 IntroductionThe Security Assertion Markup Language (SAML) is an open standard for exchanging authorization and authentication information. The Web Browser SAML/SSO Profile with Redirect/POST bindings is one of the most common SSO implementation. This cheatsheet will focus primarily on that profile.
Validate Message Confidentiality and Integrity
Validate Protocol UsageThis is a common area for security gaps - see Google SSO vulnerability (AVANTSSAR 2008) for a real life example. Their SSO profile was vulnerable to a Man-in-the-middle attack from a malicious SP (Service Provider). The SSO Web Browser Profile is most susceptible to attacks from trusted partners. This particular security flaw was exposed because the SAML Response did not contain all of the required data elements necessary for a secure message exchange. Following the SAML Profile usage requirements for AuthnRequest (4.1.4.1) and Response (4.1.4.2) will help counter this attack. The AVANTSSAR team suggested the following data elements should be required:
Further vulnerabilities in SAML implementations were described in 2012 (On Breaking SAML: Be Whoever You Want to Be). The following recommendations were proposed in response (Secure SAML validation to prevent XML signature wrapping attacks):
Validate Protocol Processing RulesThis is another common area for security gaps simply because of the vast number of steps to assert. Processing a SAML response is an expensive operation but all steps must be validated.
Validate Binding Implementation
Validate Security CountermeasuresRevisit each security threat that exists within the SAML Security document and assert you have applied the appropriate countermeasures for threats that may exist for your particular implementation. Additional countermeasures considererd should include:
Need an architectural diagram? The SAML technical overview contains the most complete diagrams. For the Web Browser SSO Profile with Redirect/POST bindings refer to the section 4.1.3. In fact, of all the SAML documentation, the technical overview is the most valuable from a high-level perspective.
Authors and Primary Editors
Other Cheatsheets |