Luckily, SAML offers an alternative mechanism called HTTP Artifact binding that allows protocol messages to be transported more securely.
This article will look at the drawbacks of using HTTP Redirect and HTTP POST bindings for transporting protocol messages. We will then discuss how HTTP Artifact Binding works and why it can make your SSO solution more secure.
Disadvantages of SAML Front-Channel Bindings
Although SAML defines several binding types for exchanging messages between trusted providers, most SAML SSO solutions utilize HTTP Redirect and HTTP POST bindings. Both HTTP Redirect and HTTP POST are front-channel bindings, meaning that the protocol messages are exchanged via the browser. Exchanging protocol messages in the full view of the browser increases the attack surface of an SSO solution by opening it up to risks such as Cross-Site Scripting (XSS). Personally Identifiable Information (PII) is also exposed to the browser unless the SAML assertions are encrypted. As we have seen with other protocols, such as OAuth, the more data we move to the server-side, the more secure the protocol.
The upcoming browser changes to phase out third-party cookies may be a further driving force for moving protocol messages away from the browser. With these changes, the browser will not attach cookies to cross-domain requests. This will impact SSO implementations as they commonly rely on cookies to manage user sessions and correlate requests with responses. So, it may become necessary to adopt back-channel communication.
This is where HTTP Artifact binding comes in.
SAML HTTP Artifact Binding
SAML HTTP Artifact binding sends protocol messages using a direct server-to-server connection between an Identity Provider (IdP) and a Service Provider (SP). The messages never pass via the browser, so HTTP Artifact is a back-channel binding type.
At a high level, HTTP Artifact binding uses a similar approach to OAuth Authorization Code Flow. Instead of exchanging the SAML protocol message via the browser, it sends a unique one-time-use reference to the message called an artifact. The receiver resolves the artifact by sending a request directly to the artifact issuer. This exchanges the artifact for the actual message using a direct server-to-server connection between the providers, away from the browser. The secure back-channel exchange occurs over a synchronous binding, such as SOAP. So, that is SAML over SOAP over HTTP.
HTTP Artifact binding removes all sensitive user data from the browser. Only the artifact is exchanged via the browser, and without the artifact, there is no way of accessing the SAML assertion. This mitigates a set of attack vectors where an attacker steals and modifies the protocol messages. However, requiring signed artifact resolution requests can further secure the SSO solution, as message signatures cryptographically bind requests to their issuer. This means that the provider attempting to resolve the artifact can be authenticated, preventing stolen artifacts from being exchanged by a malicious party. Therefore, the attack surface of an SSO solution is significantly reduced by keeping assertions away from the browser and requiring signed back-channel requests.
SAML HTTP Artifact Binding Flow
When using HTTP Artifact binding to exchange the SAML assertion in SP-initiated authentication, the following flow will take place: