npm / samlify
samlify
What changed in samlify 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.
24 breaking11 security13 new APIs and options5 behavior and defaults9 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initsamlify 262 changes
Breaking changes 24
RSA-1.5 and TripleDES decryption are refused unless allowInsecureDecryptionAlgorithms is true.
Responses are checked against the SP's audience, destination, and recipient; audience checking can be disabled with wantAudienceCheck: false.
Text containing comments or CDATA is read whole, preventing extracted values from differing from the signed text.
Response and signed SubjectConfirmationData InResponseTo values must agree; supplying undefined or null rejects a response that answers a request.
Passing undefined or null when no request is pending rejects a response that answers a request; omit the option to avoid this check.
Logout requests must come from the expected issuer, target a receiver SingleLogoutService location, be unexpired, and are accepted only once when replayCache is configured.
A message is rejected if its root element does not match the parser.
Redirect and SimpleSign signature checks require octetString, which must match the parsed message, SigAlg, and RelayState.
Redirect-binding messages are limited to 1 MB after inflation.
A context-aware template renderer is available for customTagReplacement callbacks and strict rendering.
Signatures must be enveloped in the element they sign, and every signature must cover its containing element; requests and logout messages require a root signature.
SignatureVerifierOptions.signatureAlgorithm is ignored; use allowedSignatureAlgorithms.
Bearer confirmation is required, confirmation validity windows and every SessionNotOnOrAfter are checked, and assertions without NotOnOrAfter are rejected.
Metadata certificates must be base64 and tagPrefix values must be XML names.
Any invalid signature now fails the message, and setting wantMessageSigned to true requires a signed Response.
Peer metadata must declare a signing certificate, and a certificate in the message must match it; KeyDescriptor use is honored.
Malformed XML, DTDs, and characters outside the XML range are rejected before schema validation.
TypeScript users who imported xmldom's Options type should use DOMParserOptions.
Parse error messages are wrapped by xmldom's ParseError; code matching exact messages should switch to substring or regex matching.
Malformed or non-XML input now fails with a parse error instead of producing a partial document; metadata with two root EntityDescriptor elements is rejected.
Omitting signingAlgorithm now selects RSA-SHA256 instead of RSA-SHA1; callers requiring SHA-1 must pass signatureAlgorithms.RSA_SHA1 explicitly.
Unknown signature-algorithm URIs now throw this error instead of silently downgrading to SHA-1, rejecting malformed algorithms and preventing a verification-downgrade vector.
Promises now reject with Error instances instead of raw strings.
Unknown signature algorithms are rejected.
Security 11
The upgraded XML encryption dependency brings a fix for the Okta EncryptedAssertion layout.
The upgraded XML encryption dependency includes @xmldom/xmldom 0.8.13, which addresses CVE-2026-34601.
SP and IdP settings now restrict accepted signature and digest algorithms on every binding; unset preserves existing behavior.
The new inResponseTo option checks that a login response answers a request you issued; it accepts one ID or an array.
The API is hardened but deprecated and will be removed in v3; use SamlLib.renderTemplate instead.
Setting templateRenderer to strict on the SP or IdP enables a context-aware renderer that rejects placeholders in unsafe positions.
Options now merge the XXE-safe errorHandler baseline instead of replacing it, so empty or partial options no longer silently disable XXE protection; callers may still override it explicitly.
samlify: XML Injection in AttributeValue Allows Privilege Escalation in Signed SAML Assertions
An XXE bypass was fixed.
Addresses XPath injection as part of a security audit.
Adds XXE protection as part of a security audit.
New APIs and options 13
Setting allowUnsolicitedResponse to false on the SP rejects IdP-initiated responses.
The extract now exposes assertionID, signed SubjectConfirmationData, and AudienceRestriction.
Redirect and SimpleSign parse results now include the RelayState covered by the signature.
An SP replayCache with saveIfAbsent(key, expiresAt) rejects assertions already accepted; samlify does not provide a store.
createLoginRequest supports specifying AssertionConsumerServiceIndex per request.
IdP metadata now supports the elementsOrder option.
createLoginRequest supports specifying ForceAuthn per request.
Login and logout requests can specify RelayState per request.
RSASSA-PSS signature algorithms are supported.
SimpleSign binding is supported for logout requests and responses.
IdP configuration now supports tagPrefix.assertion.
IdP configuration now supports tagPrefix.protocol.
Support was added for encrypted assertions, allowing developers to use them with samlify.
Behavior and default changes 5
Braces in template values are emitted as numeric character references, preserving the same text when parsed.
The default is now false; accepting an unsigned logout message logs a warning. The default is planned to become true in v3.
Importing samlify no longer adds browser DOM globals or DOM fetch/BodyInit types to TypeScript projects, including Node-only projects.
setDOMParserOptions accepts xmldom 0.9's onError(level, message) option instead of the deprecated errorHandler; the old object form remains supported through conversion.
SP signatureConfig now has a default when wantMessageSigned is true.
Fixes and other changes 9
Verification now accepts any salt length, including the digest-length salt used by spec-compliant peers.
The body field type is now Record<string, unknown>, restoring TypeScript compatibility with Express and other web framework request objects.
The query field type is now Record<string, unknown>, restoring TypeScript compatibility with Express and other web framework request objects.
Attributes with null or undefined values are omitted from AuthnRequest.
customTagReplacement is invoked even when no explicit template is provided.
The metadata conflict error now surfaces SP and IdP signing flags.
A clear error is thrown when redirect binding has no SSO or SLO endpoint.
createLogoutRequest now passes through SessionIndex.
Maintains the CommonJS build.