跳到主要内容
ecdsa.com

SAML 查看器

以 XML、POST 绑定的 base64 或 Redirect 绑定的 URL 形式粘贴 SAML 2.0 消息。添加 IdP 证书即可验证其中的签名,填写你的 SP 设置即可检查条件。

100% 本地运行——所有操作都在你的浏览器中完成,不会向任何服务器发送数据

来源:node-saml 的签名测试语料(MIT),附带其测试所用的证书和检查时间。

XML、base64(HTTP-POST)或带有 SAMLRequest / SAMLResponse 的 URL
验证
PEM 或 base64 DER,取自 IdP 元数据
检查时间时间均为 UTC。
服务提供商设置

What you can paste

SAML 2.0 moves XML messages between an identity provider (IdP) and a service provider (SP) through the browser. The inspector reads them in every form they travel in:

  • raw XML — a samlp:Response, a bare saml:Assertion, an AuthnRequest, LogoutRequest or LogoutResponse, or md:EntityDescriptor metadata;
  • the HTTP-POST binding — the base64 of the XML, as the browser posts it in the SAMLResponse form field, alone or as the whole form body with RelayState;
  • the HTTP-Redirect binding — a URL whose SAMLRequest or SAMLResponse parameter is DEFLATE-compressed and base64-encoded, signed in the query string with SigAlg and Signature (SAML Bindings §3.4.4.1): the inspector inflates it with your browser's own DecompressionStream and checks that signature over the parameters exactly as they appear.

Documents with a DOCTYPE are refused before parsing, as the SAML specifications require.

What a signature actually covers

XML signatures (XML-DSig) do not sign a document; they sign the elements their Reference URIs point to, after canonicalisation and transforms. A SAML signature is supposed to sit inside the element it signs and point at its ID. The inspector shows, for every ds:Signature, the element each reference resolves to, recomputes each digest, checks the signature value over the canonical SignedInfo, and then says what the signature protects — a Response, an Assertion, or nothing it can be proven to protect.

That last line is where real-world SAML breaks. A service provider does not consume "the signed element"; it consumes the first assertion of the Response. Signature wrapping attacks insert a second, unsigned assertion where the SP looks, or move the signed one where the signature still verifies but nothing reads it; others exploit comments that truncate a NameID during canonicalisation, duplicated IDs, references to an outer element, or a signature that verifies only with a certificate the attacker put into KeyInfo. The inspector compares what is signed with what an SP consumes and reports every gap: the consumed assertion unsigned, several assertions, nested assertions in Advice, duplicate IDs, a reference that is not the signature's parent, extra transforms, comment-split text, a signature made with the embedded certificate instead of the IdP's.

The conditions of an assertion

With your SP settings it also checks what SAML Core §2.5 and §2.4.1 and the Web Browser SSO profile require: the Issuer, the Audience against your entityID, Destination and the bearer SubjectConfirmationData Recipient against your ACS URL, InResponseTo against your request, NotBefore and NotOnOrAfter against the check time, and the Response status. It lists the NameID, the authentication context and every attribute. For metadata, it shows the roles, endpoints and keys and flags endpoints that do not use TLS.

The examples come from the signature test corpus of node-saml, the SAML library behind Passport: a correctly signed Response, a wrapped one, one re-signed by an attacker with their own certificate in KeyInfo, a signed LogoutRequest in XML and over the Redirect binding, and signed SP metadata. They were signed years ago, so each sets the check time its tests use. For the signatures of European e-signature documents, which use the same XML-DSig with ETSI extensions, see the XAdES inspector; for the protocol that replaces SAML in most new deployments, the OIDC ID token validator. What a service provider must check, and why, is set out in SAML signature validation: what to check and why.