Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
update SAML default
Thiago Araujo da Silva43e95306ecfe
diff --git a/backend/AGENTS.md b/backend/AGENTS.mdindex ca53b77b5b..c1b439ef66 100644--- a/backend/AGENTS.md+++ b/backend/AGENTS.md@@ -302,7 +302,8 @@ Token detection logic in `inject-identity.ts` checks `x-api-key` header first, t`organizations.ssoMfaTrust` (`SsoMfaTrust` enum, `none` or `signal`) lets a SAML or OIDC login satisfy theorg's MFA enforcement with the MFA the IdP already performed. The SAML and OIDC callbacks derive one verdictper login with `matchIdpMfaSignal` (`services/auth/idp-mfa-signal.ts`): the OIDC claim named by-`oidc_configs.mfaClaimName` contains `mfa`, the SAML `AuthnContextClassRef` is a two-factor class, or the+`oidc_configs.mfaClaimName` contains `mfa`, the SAML `AuthnContextClassRef` is a class whose definition asserts+two factors (possession-only classes such as `Smartcard` and `SoftwarePKI` are not defaults), or theattribute named by `saml_configs.mfaSignalAttribute` contains `mfa`. Both names default to `amr`, and theper-config allowlists extend the built-in values rather than replace them. The verdict travels on the org-lesssession token as `idpMfaOrgId`, the root org whose SSO config produced it (absent when the IdP did not signaldiff --git a/backend/src/services/auth/idp-mfa-signal.test.ts b/backend/src/services/auth/idp-mfa-signal.test.tsindex fb3cf98ca3..a6fc0c7e0b 100644--- a/backend/src/services/auth/idp-mfa-signal.test.ts+++ b/backend/src/services/auth/idp-mfa-signal.test.ts@@ -72,6 +72,8 @@ describe("matchIdpMfaSignal for SAML", () => {["PasswordProtectedTransport (Okta default)", "urn:oasis:names:tc:SAML:2.0:ac:classes:PasswordProtectedTransport"],["MobileTwoFactorUnregistered", "urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorUnregistered"],["Password", "urn:oasis:names:tc:SAML:2.0:ac:classes:Password"],+ ["possession-only Smartcard", "urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard"],+ ["possession-only SoftwarePKI", "urn:oasis:names:tc:SAML:2.0:ac:classes:SoftwarePKI"],["unspecified", "urn:oasis:names:tc:SAML:2.0:ac:classes:unspecified"]])("rejects the single-factor %s context class", (_, classRef) => {expect(saml([classRef]).verified).toBe(false);diff --git a/backend/src/services/auth/idp-mfa-signal.ts b/backend/src/services/auth/idp-mfa-signal.tsindex 41c08abe87..c345cd827d 100644--- a/backend/src/services/auth/idp-mfa-signal.ts+++ b/backend/src/services/auth/idp-mfa-signal.ts@@ -4,14 +4,15 @@ export const DEFAULT_MFA_CLAIM_NAME = "amr";// RFC 8176 value for a completed multi-factor login; Okta, Entra ID, Auth0, Google and Duo all emit it.export const DEFAULT_OIDC_MFA_CLAIM_VALUES = ["mfa"];-// Two-factor SAML classes, the REFEDS MFA profile and Entra ID's satisfied-MFA class. Single-factor classes-// such as PasswordProtectedTransport and MobileTwoFactorUnregistered are deliberately absent.+// Only classes whose definition asserts two factors: SmartcardPKI is a card plus a PIN and TimeSyncToken a+// PIN plus a token code, alongside MobileTwoFactorContract, the REFEDS MFA profile and Entra ID's+// satisfied-MFA class. Possession-only classes such as Smartcard and SoftwarePKI, and single-factor ones such+// as PasswordProtectedTransport and MobileTwoFactorUnregistered, are deliberately absent; an org that knows+// its IdP only issues them after MFA adds them to `mfaAuthnContexts`.export const DEFAULT_SAML_MFA_AUTHN_CONTEXTS = ["urn:oasis:names:tc:SAML:2.0:ac:classes:MobileTwoFactorContract","urn:oasis:names:tc:SAML:2.0:ac:classes:TimeSyncToken",- "urn:oasis:names:tc:SAML:2.0:ac:classes:Smartcard","urn:oasis:names:tc:SAML:2.0:ac:classes:SmartcardPKI",- "urn:oasis:names:tc:SAML:2.0:ac:classes:SoftwarePKI","https://refeds.org/profile/mfa","http://schemas.microsoft.com/claims/multipleauthn"];