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"
(→Authors and Primary Editors) |
Cam Morris (talk | contribs) (minor editorial changes) |
||
Line 40: | Line 40: | ||
** If possible, inspect schemas and perform schema hardening, to disable possible wildcard type or relaxed processing statements. | ** If possible, inspect schemas and perform schema hardening, to disable possible wildcard type or relaxed processing statements. | ||
* Securely validate the digital signature. | * Securely validate the digital signature. | ||
− | ** If you | + | ** If you expect only one signing key, use StaticKeySelector. Obtain the key directly from the identity provider, store it in local file and ignore any KeyInfo elements in the document. |
** If you expect more than one signing key, use X509KeySelector (the JKS variant). Obtain these keys directly form the identity providers, store them in local JKS and ignore any KeyInfo elements in the document. | ** If you expect more than one signing key, use X509KeySelector (the JKS variant). Obtain these keys directly form the identity providers, store them in local JKS and ignore any KeyInfo elements in the document. | ||
** If you expect a heterogenous signed documents (many certificates from many identity providers, multilevel validation paths), implement full trust establishment model based on PKIX and trusted root certificates. | ** If you expect a heterogenous signed documents (many certificates from many identity providers, multilevel validation paths), implement full trust establishment model based on PKIX and trusted root certificates. | ||
* Avoid signature-wrapping attacks. | * Avoid signature-wrapping attacks. | ||
− | ** Never | + | ** Never use 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. | ||
Line 84: | Line 84: | ||
= First and Last Mile Considerations = | = First and Last Mile Considerations = | ||
− | The SAML protocol is rarely the vector of choice, though | + | The SAML protocol is rarely the vector of choice, though it's important to have cheatsheets to make sure that this is robust. The various endpoints are more targeted, so how the SAML token is generated and how it is consumed are both important in practice. |
== First Mile Considerations == | == First Mile Considerations == |
Revision as of 14:49, 2 September 2015
Last revision (mm/dd/yy): 09/2/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.
First and Last Mile ConsiderationsThe SAML protocol is rarely the vector of choice, though it's important to have cheatsheets to make sure that this is robust. The various endpoints are more targeted, so how the SAML token is generated and how it is consumed are both important in practice. First Mile Considerations
Last Mile Considerations
Input ValidationJust because SAML is a security protocol does not mean that input validation goes away.
Authors and Primary Editors
Other Cheatsheets |