Get started
Docs menu

Security

Security review: FAPI 2.0 Security Profile

On this page

Introduction

FAPI 2.0 is the OpenID Foundation's security profile of OAuth 2.0 for high-security applications. It takes its name from the "Financial-grade API" it was first written for, and it now applies to any API that exposes high-value data. See FAPI 2.0 for how a client is held to it.

This review reads FAPI 2.0 Security Profile, Final, 22 February 2025. The profile calls itself a general-purpose high-security profile of OAuth 2.0 that has "been proved by formal analysis to meet the stated attacker model".

It checks Signari against the profile requirement by requirement, and records the defects that the check found. It is for a security reviewer, or for an administrator deciding whether a deployment can meet the profile. Most of the profile's restrictions are a mode a client is held to, not Signari's default. Those rows say per client or profile mode.

§5.3.2.1, requirement by requirement

RequirementSignari
Distribute discovery metadata per OIDD/RFC 8414yes
Reject the resource owner password credentials grantyes
Only support confidential clientsper client: Signari supports public clients generally; a client held to the profile must be confidential
Only issue sender-constrained access tokensper client: a client held to the profile is refused a token unless the request proves a key
Sender-constraining via mTLS or Demonstrating Proof of Possession (DPoP)both implemented
Client authentication via mTLS or private_key_jwtboth implemented
Not expose open redirectorsyes
Accept only the issuer identifier in a client assertion audper client: held to the profile, the issuer alone, as a string; otherwise see below
Not use refresh token rotationper client: held to the profile, a refresh token does not rotate; otherwise Signari rotates it, see below
Authorization codes with a maximum lifetime of 60 secondsyes, exactly 60, and now pinned by TestTheConstantsAConformanceClaimRestsOnHaveNotDrifted, since nothing previously stopped the number drifting
If using DPoP, support Authorization Code Binding to DPoP Keywas missing, now implemented
Accept JSON Web Token (JWT) iat/nbf 0–10s in the future, reject >60swas wrong in both directions, now implemented

Two rows are deliberate differences rather than gaps. Two were defects.

The defect: no authorization code binding to a DPoP key

FAPI 2.0 requires this binding "if using DPoP", for Demonstrating Proof of Possession. RFC 9449 §10.1 says who it binds:

Both mechanisms MUST be supported by an authorization server that supports PAR and DPoP.

Signari supports Pushed Authorization Requests (PAR) and supports DPoP, so that MUST applied, and neither mechanism existed. dpop_jkt appeared nowhere in the codebase.

What it adds to PKCE

Proof Key for Code Exchange (PKCE) binds an authorization code to a secret the client generated. dpop_jkt binds it to the key the resulting token will be bound to, so the whole flow is bound to one key.

An attacker who intercepts an authorization code in the front channel cannot then redeem it with their own DPoP key. The code names the key permitted to redeem it.

§10 notes they are complementary, and that dpop_jkt "only provides similar protections when a unique DPoP key is used for each authorization request".

Both mechanisms, because §10.1 requires both

  • dpop_jkt as an authorization request parameter, and in the PAR POST body.
  • A DPoP header on the PAR request, in which case the authorization server "MUST further behave as if the contained public key's thumbprint was provided using dpop_jkt".

Supporting only the first would drop the binding, with no error, for a client that attaches its DPoP header to every authorization-server request. §10.1 is written for that client.

And when both are present: "the authorization server MUST reject the request if the JWK Thumbprint in dpop_jkt does not match the public key in the DPoP header".

The check first went in the wrong place

The redemption check went in after the PKCE block. That block returns early when a code carries a challenge, which is every code, since PKCE is required by default. So the check never ran.

The test caught it on the first run. Reading the function did not, because the early return is hard to spot. The mutation that moves the check back to the wrong place is now part of the suite:

MutationTest that caught it
Drop the thumbprint comparisonTestACodeBoundToADPoPKeyIsOnlyRedeemableWithThatKey
Move the check after the PKCE early returnsame test

The second defect: clock skew, wrong in both directions (August 2026)

This was checked again because the row above said "partial", and the document did not say which part.

The requirement is one sentence carrying two opposed obligations:

"shall accept JWTs with iat or nbf timestamp between 0 and 10 seconds in the future but shall reject greater than 60 seconds"

Both were wrong, in opposite directions:

  • nbf: any future value was refused, by now.Before(time.Unix(nbf, 0)). A client whose clock ran two seconds fast could not authenticate at all, and the message it got named the assertion rather than the clock. So an interoperability failure looked like a signature problem.
  • iat was parsed into the claims struct and never read. An assertion claiming to be issued an hour in the future was accepted, because the only bound on time was MaxAssertionLifetime, which measures exp against now and says nothing about where the window sits. Future-dating moves the window rather than lengthening it.

Fixing the second found a third problem. MaxAssertionLifetime only bounds the window forwards. So an assertion minted an hour ago, with exp two minutes out, satisfied it, and had been a usable credential for that hour.

Signari now accepts an iat or nbf up to ten seconds in the future, and refuses anything later. The tolerance is ten seconds rather than sixty. The band from 10 to 60 seconds is left to the implementation: "reject greater than 60" does not require accepting 59. Each second of tolerance is a second in which an assertion can be used before its own client says it is valid.

A test for the third fix

Removing the stale-iat bound broke no test, while the other two each had one. So it was given a test, TestAnAssertionIssuedLongAgoIsRefused.

iat stays OPTIONAL, as RFC 7523 §3 says. Every check is conditional on its presence, and TestAnAssertionWithNoIssuedAtStillWorks pins that.

The two deliberate differences

Client assertion audience. FAPI: "shall only accept its issuer identifier value... as a string in the aud claim received in client authentication assertions". Signari accepts three values: the issuer, the token endpoint, and the endpoint being called.

The third was added because a client authenticating at /oauth2/par addresses its assertion to /oauth2/par, and refusing it broke PAR.

Every accepted value names Signari and no other party, so the audience check still works. But a FAPI deployment needs the stricter form, so it is a mode a client is held to, not the default.

Refresh token rotation. FAPI prohibits it; RFC 9700 §2.2.2 requires rotation or sender-constraining for public clients. There is no contradiction, because FAPI mandates sender-constraining, which removes the need. But the two standards differ for a deployment that supports both, and Signari follows RFC 9700 by default.

Currency

This review was re-verified in August 2026 against https://openid.net/specs/fapi-security-profile-2_0-final.html, on openid.net. It is still Final, 22 February 2025, with no errata, and §5.3.2.1 still carries the same fourteen requirements. The profile has not moved, so this review's version reference holds.

Verdict

The review found two MUST-level defects. The first was also an RFC 9449 §10.1 MUST that an earlier DPoP review missed. That review checked the proof and the binding at the resource, but not what binds the code.

The remaining FAPI gaps were profile modes, not behaviours that are wrong by default. They are restrictions a FAPI deployment must turn on (confidential clients only, sender-constrained tokens only, single assertion audience). They are now a selectable profile, held per client with client set-profile. The OpenID Foundation's test plan has not been run against it.

The requirements this review had not listed (August 2026)

The table above covers §5.3.2.1's authorization-server list. Reading the profile's section structure, instead of working from the existing table, showed three groups missing from it. All were checked against the source code.

§5.3.2.1, two rows that were absent

RequirementSignari
"shall return an iss parameter in the authorization response according to [RFC9207]"yes: authorize.go:324 sets it on every response, and authorization_response_iss_parameter_supported is advertised in metadata. This is the mix-up defence from the provider side, and it was implemented without being recorded here
"shall reject authorization requests sent without [RFC9126]"profile mode: require_pushed_authorization is per client (par.go:293), not global. Same standing as the two other profile-mode rows: a FAPI deployment turns it on, a general-purpose one cannot without breaking every client that does not push

§5.3.4, the resource server requirements

None of these were listed. Signari is a resource server for /userinfo, /introspect and the credential endpoint, so all five bind it:

§5.3.4 requirementSignari
1. "shall accept access tokens in the HTTP header as in Section 2.1 of OAuth 2.0 Bearer Token Usage [RFC6750] or Section 7.1 of DPoP [RFC9449]"met: the Authorization header is read under both the Bearer and the DPoP scheme
2. "shall not accept access tokens in the query parameters stated in Section 2.3 of OAuth 2.0 Bearer Token Usage [RFC6750]"met: a token is read from the header, or from the form body of a POST, and never from the query string
3. "shall verify the validity, integrity, expiration and revocation status of access tokens"met: the signature and expiry are verified first. Then the token is refused if it was revoked, its grant was revoked, its session has ended, or its client or subject is no longer active
4. "shall verify that the authorization represented by the access token is sufficient for the requested resource access and otherwise return errors as in Section 3.1 of [RFC6750]"met: a token issued for another resource is invalid_token, and one without the scope the endpoint needs is a 403 with insufficient_scope
5. "shall support and verify sender-constrained access tokens using one or both of the following methods: MTLS as described in [RFC8705], DPoP as described in [RFC9449]"both: a token carrying cnf.jkt needs a DPoP proof made with that key, and one carrying cnf.x5t#S256 needs the certificate it is bound to on the connection

Requirement 2 is a shall not. A mistake there shows only when somebody reads an access log.

Presenting the token in the header and the body is also rejected, not resolved by precedence. Two token values in one request mean a broken client, or an attempt to have the check read one and the logic use the other.

§5.2 and §5.4, the sections this review had not opened

The table above covers §5.3.2.1, and the addendum covers §5.3.4. Two more normative sections bind a server.

§5.2 Network layer protections

This section covers Transport Layer Security (TLS) and Cross-Origin Resource Sharing (CORS):

RequirementSignari
"shall only offer TLS protected endpoints"deployment property: the binary serves plaintext behind a terminating proxy, which the administrator sets up, so Signari cannot assert it
"shall set up TLS connections using TLS version 1.2 or later"Go's default minimum is TLS 1.2; outbound calls use the standard library
§5.2.3: "Servers shall not support CORS for the authorization endpoint"met, and tested: oidc.PathAuthorize is absent from the CORS allow-list with a comment saying it must stay absent, and TestTheAuthorizationEndpointNeverGetsCORS holds it there. The same prohibition appears as RFC 9700 §2.6, which is what that comment cites

The authorization endpoint is reached by navigation, never by fetch. Any script that can read its response is reading a page that may already carry an authorization code.

§5.4 Cryptography and secrets

RequirementSignari
"RSA keys shall have a minimum length of 2048 bits"met: rsa.GenerateKey(rand.Reader, 2048)
"Elliptic curve keys shall have a minimum length of 224 bits"met: ES256 is P-256
"not use or accept the none algorithm"met: every verifier parses with an asymmetric allow-list; none is absent everywhere
§5.4.2 "shall only serve the jwks_uri endpoint over TLS"deployment property, as above
§5.4.2 "should not use the JOSE headers for x5u and jku"met: both refused explicitly in verifiedPayload, alongside an embedded jwk
§5.4.2 "should not serve a JWK set with multiple keys with the same kid"met structurally: keys.NewSet refuses to construct a set with a duplicate kid, so such a set cannot be served
"use PS256, ES256, or EdDSA (using the Ed25519 variant) algorithms"profile mode: see below

The one that is profile mode, and was not previously listed

FAPI's algorithm list is PS256, ES256, EdDSA. RS256 is not on it.

Signari signs with ES256 by default, and supports PS256 and EdDSA, all three of which qualify. But RS256 is also a supported signing algorithm, and clientauth.allowedAlgs accepts RS256/RS384/RS512 for private_key_jwt assertions. A FAPI deployment must not use or accept those.

That puts §5.4.1 in the same category as the three profile-mode rows already in the table above: public clients, mandatory sender-constraining, and global PAR. They are capabilities a FAPI deployment turns off, not defaults Signari gets wrong. This one had not been listed before.

What it would take: the algorithm allow-lists are constants, and narrowing them is a one-line change per site. What is not one line is deciding where to narrow them. Narrowing them globally breaks every existing RS256 client. Narrowing them per client needs a registration attribute and a migration. This is recorded rather than changed, for the same reason as the other three.

§5.4.1 key strength: the floor was not enforced (20 August 2026)

This was reviewed against FAPI 2.0 Security Profile, Final, 22 February 2025, with every normative keyword extracted by section. There are 92 uses, densest at §5.3.2.2 (16), §5.3.2.1 (15) and §5.3.3.1 (15).

"RSA keys shall have a minimum length of 2048 bits." "Elliptic curve keys shall have a minimum length of 224 bits."

Nothing enforced this on a client's registered JSON Web Key Set (JWKS). A client could register a 1024-bit RSA public key, and authenticate with private_key_jwt indefinitely. That key is below every recognised floor since NIST withdrew 1024-bit RSA in 2013, and a well-resourced attacker can factor it.

The client is the party harmed, and the client that registers a weak key is the one least likely to notice. So the authorization server has to check it.

It was also inconsistent with the rest of Signari. The same floor was already enforced on Security Assertion Markup Language (SAML) encryption certificates (internal/saml/encrypt.go:107) and on certificate import in the CLI. Only the path that authenticates clients was missing it.

Enforced against the key that verified the signature, not by filtering the registered set up front. A client mid-rotation, with one strong key and one legacy weak key, keeps working on the strong one. A client that signed with the weak one gets an error naming the key type and the bit length. It does not get the "no registered key verified it" message, which would send an integrator to the wrong place.

Elliptic curve keys need no separate gate in practice: jose.ParseSignedCompact pins the algorithm list, and P-256 upward all clear 224 bits. But the check is written for both, so the floor does not depend on that coincidence holding.

§5.4.3, Handling Duplicate Key Identifiers

Signari already satisfies this requirement:

"when there are multiple keys with the same kid, the verifier shall consider other JWK attributes, such as kty, use, alg, etc., when selecting the verification key"

Signari's verifiers try each candidate key, instead of committing to the first kid match. That is a strictly stronger selector than comparing alg: a key that produces a valid signature is the key that signed it.

internal/ssf/receive.go filters on kid and then tries each match. internal/clientauth/privatekeyjwt.go tries every registered key. Both terminate on a verified signature, so a duplicate kid cannot cause a false rejection.

§5.3.2.2's 303 status code (21 August 2026)

46 redirect sites were converted from 302 to 303 for one SHOULD:

"should use the HTTP 303 status code when redirecting the user agent"

Every authorization response now redirects with 303, and none uses 307.

The cost of 303 is compatibility, not correctness

Nothing found argues that the SHOULD is wrong. What it costs is compatibility. Changing the status code of an authorization response alters behaviour that applications already built against a server may depend on. A server with many such applications has a reason to put the change off.

Signari had no installed base that depended on 302, so that cost did not apply.

A report of 303 breaking a flow

One report exists of 303 breaking an OAuth flow: a Hugging Face forum thread (February 2024) where an authorization endpoint returning 303 was blamed for "the loss of the original window object", so a popup-based client could not programmatically close its auth tab. Libraries like react-use-oauth2 are named.

It is most likely a misattribution, for these reasons:

  • A redirect status code does not sever window.opener. Ordinary cross-origin navigation does not either. The mechanism that does is Cross-Origin-Opener-Policy, which is why Signari does not set it, for the same applications (see the OWASP ASVS review, V3.4.8).
  • The symptom described, a parent unable to read or control the popup, is what happens when a script reads popup.location.search across origins, which throws regardless of status code.
  • The thread is an unresolved forum report, not a maintainer diagnosis, and no follow-up establishes cause.

It is possible and unproven. The risk for Signari is low because 303 differs from 302 in one respect: it requires the method to become GET, where 302 only permits it. Every redirect Signari sends after a POST targets a handler that expects a GET. So 303 forces the behaviour Signari already relied on 302 to choose.

Verdict

Signari keeps 303. No defect was found in it, and the one cost found, compatibility with applications that depend on 302, did not apply.

Second pass: normative extraction (21 August 2026)

The first pass read the profile section by section. This is a different method on the same document. It extracts every normative keyword mechanically, enumerates the requirements, and checks them one at a time.

FAPI 2.0 uses lowercase keywords

An RFC 2119 extraction over this specification returns nothing: zero MUST, zero SHALL, zero SHOULD.

FAPI 2.0 does not use RFC 2119. Its own notational conventions say so:

The keywords "shall", "shall not", "should", "should not", "may", and "can" in this document are to be interpreted as described in ISO Directive Part 2.

The keywords are lowercase. An uppercase-only search works on every RFC and every OpenID Foundation specification reviewed in this repository. Here, it reports a security profile as containing no requirements.

It was the fourth false negative from a search in this review cycle. The search returned a plausible zero rather than a partial result.

The earlier section-by-section pass was unaffected, because it read the prose.

Re-run with ISO keywords: 94 normative uses, 67 distinct "shall" sentences, 25 of them naming the authorization server.

A requirement that looked like a gap

"if using DPoP, shall support the server provided nonce mechanism (as defined in Section 8 of [RFC9449])"

Read on its own, this looks like a requirement on the authorization server, and so like a gap. It is not. The bullet sits under §5.3.3, "Requirements for clients", in a list beginning "Clients ¶ shall support sender-constrained access tokens...". It requires a FAPI client to handle a use_dpop_nonce challenge. It places no obligation on the authorization server to issue one.

This was checked by pulling 2,200 characters of preceding context, instead of trusting the sentence in isolation.

Four server requirements checked concretely

§5.3.2 requirementSignari
"shall not use the HTTP 307 status code when redirecting a request that contains user credentials"never used; responsemode.go cites the rule and uses 303
"shall issue authorization codes with a maximum lifetime of 60 seconds"codeTTL = 60s, exactly at the ceiling
"shall issue ... request_uri with expires_in values of less than 600 seconds"parLifetime = 5 minutes, which has to cover the whole sign-in
NOTE 3: one-time use enforced "at the point of authorization, not at the point of loading an authorization page"was wrong, now implemented. The first page spent the handle, so nobody who was not already signed in could finish a pushed request. A handle is now spent in the transaction that issues its code
"shall support nonce parameter values up to 64 characters in length"no length bound, so any length is accepted

The two lifetime ceilings were met by constants whose comments did not name FAPI. codeTTL's comment reads "RFC 6749 recommends <= 10 minutes; short is free here". That is true of RFC 6749, but somebody following it could raise the value and break FAPI conformance with no error.

TestFAPILifetimeCeilingsHold now connects the constants to the profile. The mutation that raises codeTTL to RFC 6749's allowance fails it, with the profile quoted:

TextCAUGHT   raise codeTTL to RFC 6749's 10 minutes (FAPI §5.3.2.2 caps it at 60s)

Scope

FAPI is a profile a deployment opts into. Most of §5.3.2 is restrictions: confidential clients only, PAR mandatory, sender-constrained tokens only. Signari does not apply them by default, and they remain profile modes rather than defects.

The two lifetime rules are different. They are ceilings Signari already meets at no cost, and without the test a change that broke them would go unnoticed.

Changed Signari v0.2