Summary
- RFC 10017, the IETF's August 2026 Best Current Practice, ranks a full Backend for Frontend above token mediation and a browser-only OAuth client because the BFF keeps access tokens, refresh tokens and confidential-client credentials out of JavaScript.
- The BFF kills token extraction and independent token acquisition as that client. It does not kill hostile code sitting in the application's approved origin, which can still issue commands through the user's cookie session. Token custody and command authority are different controls wearing the same badge.
- Leaders need an architecture register, one application per origin, strict script admission, protected cookies and CSRF checks, narrow BFF host/path/method mappings, resource authorization, high-impact confirmation, and evidence of the committed business effect.
RFC 10017, OAuth 2.0 for Browser-Based Applications, published in August 2026 as an IETF Best Current Practice, settles a decade-old argument in one direction: get the token out of JavaScript and into a Backend for Frontend. Then it quietly concedes the part nobody puts on a slide. A stolen token is only one way to spend someone else's authority. The other way is to ask politely, from inside the approved origin, with the cookie the browser was always going to attach.
Picture a payroll application that did everything the security review asked. JavaScript never receives an OAuth access token. The refresh token sits in a server vault. The browser holds one HttpOnly, Secure session cookie. A scanner confirms no bearer value anywhere in Local Storage, IndexedDB, page memory or the developer console.
Then a compromised third-party script asks the application's BFF to change an employee's bank account. The browser attaches the protected cookie. The BFF recognizes the session, retrieves the user's token, bolts it onto the outbound request and forwards the command. The resource server sees an expected client, a valid token, an allowed scope. The token was never stolen. The command still ran. Nobody's dashboard blinked.
That is the authority boundary RFC 10017 clarifies. A BFF is materially safer than parking OAuth credentials in browser code. It is not a declaration that every request originating inside the application is legitimate.
Four attacks, not one token-theft story
Security discussions about browser OAuth usually begin and end with exfiltration. RFC 10017 uses a broader model. Once malicious JavaScript or WebAssembly executes in the application context, it inherits the same browser privileges as legitimate code. It can reach the data and storage the application can reach, talk to same-origin contexts, rewrite execution flow and send requests from the approved origin.
The RFC separates four attackers. A one-time thief copies whatever tokens are lying around. A persistent thief waits for every replacement and quietly defeats the comfort of short access-token lifetimes. A more capable attacker ignores storage entirely and launches a fresh Authorization Code flow, riding the user's authorization-server session to mint an independent token set. The fourth never takes a token at all: it simply makes the live browser send an authorized request.
Those distinctions reprice the familiar defenses. Refresh-token rotation can expose some reuse, but persistent code can grab the newest rotated token and starve the legitimate application of it. A Web Worker can isolate a stored token, but same-origin code may just ask for a fresh one. DPoP can render a copied token useless away from a non-exportable key, but hostile code can run a new browser-only flow with its own key, or simply invoke a live request path. PKCE stops an intercepted authorization code from being redeemed by the wrong client instance; it does not make hostile code in the registered origin distinguishable from the application.
None of that makes these controls useless. Each removes a specific capability. The mistake is letting the name of one successful control stand in for the state of the whole application.
The BFF moves the client — and the liability
RFC 10017 lays out three architectures in decreasing order of security. In a full BFF, a server component becomes the confidential OAuth client. It runs the Authorization Code flow with PKCE, holds access and refresh tokens, binds them to a cookie-based session and proxies every protected-resource call. The browser receives no OAuth token at all.
That blocks three major paths. There is no browser token for a one-time thief to copy. Persistent code cannot keep harvesting replacements that never enter its execution environment. Malicious browser code cannot independently exchange a freshly captured code as the registered confidential client, because it lacks the BFF's credentials. HttpOnly also stops script from reading the session identifier and converting client hijacking into a portable stolen session.
The remaining attack is a different animal. Malicious code sends requests to the BFF from the legitimate origin. The browser is entitled to attach the cookie, and the BFF exists to translate that session into token-bearing resource calls. The attacker never crossed the token boundary. It walked through the command boundary.
Which is why the BFF must be more than a reverse-proxy-shaped convenience. RFC 10017 requires strict outbound control. Approved frontend endpoints should map to known resource hosts, paths and methods. A request parameter must never be allowed to turn /bff/report into a token-bearing fetch to an arbitrary destination. A generic path-forwarding feature quietly expands a protected session into whatever authority the upstream token carries.
Cookie custody has its own rules. The RFC requires Secure and HttpOnly, and recommends SameSite=Strict, path /, no Domain attribute and a suitable host-bound prefix. And because the browser attaches cookies automatically, state-changing BFF routes still need CSRF protection. A token-free JavaScript heap does not repair an endpoint that accepts a forged cross-site command.
The middle architecture exposes exactly what it saves
A token-mediating backend keeps the confidential-client role and the refresh token but hands access tokens back to the browser, which then calls resource servers directly. It avoids proxying every response and can cut server burden. Its protection is correspondingly narrower.
Hostile code cannot steal a refresh token that never leaves the server, and cannot complete a new flow without the backend's credentials. It can still steal the access token presented to JavaScript. And even if storage hides that token, hostile code can ask the mediation endpoint for the latest one through the user's session. The architecture protects duration better than it protects immediate reach.
This pattern also muddies sender constraint. The backend obtains the token; the browser uses it. RFC 10017 does not define a split DPoP responsibility for that arrangement. Leaders should not paper over the gap with an architecture diagram that labels both boxes “PoP enabled.” The accepting servers need one implemented key-custody and proof path that can actually be tested.
The RFC recommends token mediation only when system requirements block a full BFF. That is not a ban. It is a demand: name the cost that justified leaving access tokens in the browser, then limit their audience, scope and life to match.
Browser-only clients remain public clients
In the third pattern, JavaScript is the OAuth client. It holds no credential that can stay confidential from the environment in which the application executes. A shared secret compiled into the bundle does not change that fact, however much the bundle insists.
The browser-only client must use Authorization Code with PKCE, exact registered redirect URIs and appropriate CSRF protection. If the authorization server issues refresh tokens, it must rotate or sender-constrain them and impose a maximum or inactivity lifetime. Strong minimum rules. They still do not remove the four attacks once malicious code runs inside the accepted origin.
Origin is therefore both a security boundary and a concentration of trust. RFC 10017 recommends one application per origin. Several unrelated applications sharing a scheme, host and port share browser powers that security teams may have filed under separate headings. Exact redirect matching, CORS and postMessage origin checks get much easier to reason about when the origin has exactly one owner.
CORS must also stay in its lane. It governs whether browser code can read a cross-origin response. It is not server-side authorization, and it cannot tell approved code from hostile code already running in an allowed origin. Likewise, a postMessage event is not authentic because it arrived through a browser API; both sender and receiver origins need exact verification.
Why the Service Worker does not become a superior authority
A tempting design puts the OAuth flow and the tokens inside a Service Worker. The worker isolates memory and augments outgoing calls without ever handing the application the token. At first glance it looks like a BFF that lives inside the browser.
RFC 10017 rejects that conclusion. Malicious application code can unregister the worker. Existing contexts may keep it alive for a while, but a new browsing context can start without its protection — and the attacker can then launch a fresh flow. The worker successfully guarded one reality layer, the stored tokens, without acquiring unremovable authority over the application origin.
The same limit applies to non-exportable Web Crypto keys. “Non-exportable” constrains the JavaScript API; the Web Crypto specification promises nothing about TPM custody or encrypted filesystem storage. More to the point, a key that cannot be copied can still be used by hostile code in the live environment. Key custody is not code intent.
Evidence must follow the command, not stop at the vault
A useful audit trail begins before OAuth and ends after the resource effect. It should record the application origin and script-release fingerprint, the BFF session identifier in privacy-safe form, CSRF and expected-origin results, the exact BFF endpoint-to-resource mapping, method and destination, a hash of token audience and scopes, the current resource-policy version, object state, idempotency key and commit result. It should not record raw tokens, cookies or client secrets.
Negative tests should exercise each attack separately. Can JavaScript read a token? Can it obtain one through a new flow? Can it ask the token-mediation endpoint for one? Can it command the BFF without ever seeing one? Can it change the outbound host, path or method? Can a valid session repeat an irreversible action after the first response is lost? A single browser scan answers none of those.
Running-Code Primacy supplies the right discipline here. “BFF” is a design label. Its authority comes from the routes, cookies, server credentials, token vault, resource checks and failure behavior actually running. Minimum Initial Specification keeps the shared OAuth mechanics precise while leaving the final command decision with the service that bears the consequence. Reality-layer clarity stops a protected token from becoming symbolic proof of a protected operation.
Member Briefing
Read the full trend briefing
Members read the full briefing with the source notes behind every finding.
Strategic Circle
A daily briefing in your language, built from changes we have verified.
Join for USD 20/monthCancel anytime.
Members also get the full research library, a daily briefing on the networks they follow and the private forum.






