Skip to content

Security

Properties of the crate. HTTP-POST SSO requires caller-owned replay storage. The signature trust model is XML signatures.

  • #![forbid(unsafe_code)] on the crate root.
  • DOCTYPE and XXE rejection, with bounded XML parsing before authentication.
  • XML escaping for generated templates, metadata endpoint locations, and SAML attribute values.
  • Response checks for issuer, status, assertion time window, audience, destination, recipient, bearer subject confirmation, and InResponseTo.
  • Logout checks for issuer and request/response correlation.
  • Signed metadata must cover the signed root when MetadataTrustPolicy::RequireSignature is selected.
  • Signed AuthnRequest messages must cover the request root when signed requests are required.
  • Detached Redirect and SimpleSign signatures are bound to the fields the flow parser consumes.
  • HTTP-Redirect raw DEFLATE output is limited.
  • Inbound SAML XML signatures trust metadata-pinned keys only. Inline <KeyInfo> is not a trust anchor.
  • Signed-reference placement is strict: each reference targets the document element, an ancestor of the signature, or a sibling of the signature.
  • An Assertion or Signature nested under SubjectConfirmationData is rejected.
  • Only content covered by a verified reference is returned for extraction.
  • Local digest and reference coverage is required.
  • Explicit XML HMAC truncation requires at least 160 bits, with higher minimums of 192 bits for HMAC-SHA384 and 256 bits for HMAC-SHA512.
  • The adapter skips X.509 chain and time checks because metadata certificates are pinned key material. Signature, digest, reference, duplicate-ID, and wrapping checks stay on.
  • RSA-v1.5 key-transport decryption is refused before any key is decrypted unless XmlEncryptionPolicy::rsa15_key_transport is Rsa15KeyTransportPolicy::AllowDecryption.

Schema validation is optional defence in depth through XmlPolicy::schema_validator, scoped to each local role. It covers received protocol XML, SOAP envelopes, and decrypted protocol documents. Import metadata with IdpDescriptor::from_metadata_xml_with_xml_policy or SpDescriptor::from_metadata_xml_with_xml_policy to apply the callback there too. See XML schema validation for its scope.

Report a suspected vulnerability in private. Until GitHub Security Advisories are enabled for the repository, open a minimal public issue that does not include exploit details, and ask for a private disclosure channel. The policy text is SECURITY.md.