<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Authentication | FirewallSync</title><link>https://firewallsync.com/tags/authentication/</link><description>Practical cybersecurity writing for engineering teams that ship fast.</description><language>en-us</language><image><url>https://firewallsync.com/icon-512.png</url><title>FirewallSync</title><link>https://firewallsync.com/</link></image><lastBuildDate>Sat, 21 Nov 2026 09:00:00 +0000</lastBuildDate><atom:link href="https://firewallsync.com/tags/authentication/index.xml" rel="self" type="application/rss+xml"/><item><title>How Session Hijacking Works Even After MFA</title><link>https://firewallsync.com/posts/how-session-hijacking-works-even-after-mfa/</link><guid>https://firewallsync.com/posts/how-session-hijacking-works-even-after-mfa/</guid><pubDate>Sat, 21 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>MFA protects the login. It says nothing about the session token issued afterward — and several distinct attack techniques exist specifically to steal that token instead of touching the login at all.</description><enclosure url="https://firewallsync.com/posts/how-session-hijacking-works-even-after-mfa/cover_hu15003690938519159819.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/how-session-hijacking-works-even-after-mfa/cover_hu15003690938519159819.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/how-session-hijacking-works-even-after-mfa/cover_hu15003690938519159819.jpg" alt="Close-up of a lit laptop screen" width="1200" height="630"></p><p>Multi-factor authentication secures a single event: the login. Once that login succeeds, the application issues a session token — typically a cookie — and for as long as that token remains valid, it represents the authenticated session without requiring MFA to be checked again. Several distinct attack techniques target exactly this token rather than the login itself, and each bypasses MFA in a genuinely different way, worth understanding separately rather than as one undifferentiated &ldquo;session hijacking&rdquo; category.</p>
<h2 id="infostealer-malware-harvesting-cookies-directly-from-the-browser">Infostealer malware harvesting cookies directly from the browser</h2>
<p>A significant share of real-world session hijacking doesn&rsquo;t involve any sophisticated network-level attack at all — it involves commodity infostealer malware, installed through a malicious download, a compromised software installer, or a phishing attachment, that simply reads session cookies directly out of the browser&rsquo;s local storage and exfiltrates them to the attacker. This requires no interaction with the login flow whatsoever; by the time the malware runs, the user may have been legitimately logged in for hours or days, and the malware simply steals whatever valid session tokens happen to be sitting in browser storage at that moment. This has become one of the most common initial-access vectors in real breach data, precisely because it&rsquo;s commoditized, cheap to deploy at scale, and doesn&rsquo;t require defeating any authentication mechanism directly.</p>
<h2 id="cross-site-scripting-xss-exfiltrating-session-tokens">Cross-site scripting (XSS) exfiltrating session tokens</h2>
<p>If an application has an XSS vulnerability, an attacker who can inject script into a page a victim visits can read any cookie accessible to JavaScript (any cookie not marked <code>HttpOnly</code>) and send it to an attacker-controlled endpoint. This is an application vulnerability being used specifically to defeat session security — the MFA that protected the original login is irrelevant, because the attacker never needs to log in at all; they simply capture and reuse a session token that a legitimate, already-authenticated user&rsquo;s browser handed over involuntarily through the vulnerable page.</p>
<h2 id="adversary-in-the-middle-aitm-phishing-relay">Adversary-in-the-middle (AiTM) phishing relay</h2>
<p>Covered in more depth elsewhere: a phishing proxy sits between the victim and the real login page, relaying the entire authentication flow — including MFA — in real time, and captures the session token issued at the end of that legitimate flow before the victim notices anything wrong. This is distinct from the two techniques above because it does interact with the login and MFA process directly, but it defeats MFA&rsquo;s protection by capturing what comes immediately after MFA succeeds, rather than by defeating MFA itself.</p>
<h2 id="network-level-interception-on-unencrypted-or-improperly-secured-connections">Network-level interception on unencrypted or improperly secured connections</h2>
<p>Where session cookies are transmitted without TLS, or where TLS is improperly implemented (accepting invalid certificates, for example), an attacker positioned on the network path — a shared public Wi-Fi network, a compromised network device — can capture session tokens in transit. This is a less common vector in most modern web applications given widespread HTTPS adoption, but it remains a real risk for legacy internal applications or misconfigured deployments that don&rsquo;t enforce TLS strictly.</p>
<h2 id="why-each-technique-requires-a-different-specific-defense">Why each technique requires a different specific defense</h2>
<p><strong>Against infostealer-based theft:</strong> endpoint protection and application controls that reduce malware installation in the first place, combined with binding sessions to device characteristics so a token copied to a different machine is rejected or challenged.</p>
<p><strong>Against XSS-based theft:</strong> marking session cookies <code>HttpOnly</code> (inaccessible to JavaScript entirely) removes this vector specifically, combined with standard XSS prevention (output encoding, Content Security Policy) addressing the underlying vulnerability.</p>
<p><strong>Against AiTM relay:</strong> phishing-resistant authentication (passkeys/FIDO2) removes the initial credential-and-MFA capture step this technique depends on, since the origin-bound cryptographic challenge can&rsquo;t be relayed through a proxy on a different domain.</p>
<p><strong>Against network interception:</strong> strict TLS enforcement, HSTS, and marking cookies <code>Secure</code> so they&rsquo;re never transmitted over an unencrypted connection.</p>
<p>No single control addresses all four vectors, which is why a session-security posture built around only one of these defenses (commonly, just moving to phishing-resistant MFA, which specifically addresses AiTM but does nothing about infostealer malware or XSS) leaves real gaps against the other techniques.</p>
<h2 id="the-common-thread-shorten-the-tokens-useful-window-regardless-of-theft-method">The common thread: shorten the token&rsquo;s useful window regardless of theft method</h2>
<p>Across all four vectors, one control helps regardless of how the token was obtained: shorter session and token lifetimes limit how long a stolen token remains useful, forcing more frequent re-authentication that gives a narrower window for any stolen token to be exploited before it naturally expires. This doesn&rsquo;t prevent theft through any of the four mechanisms, but it bounds the consequence of all of them simultaneously, which is a meaningfully different and more resilient property than a defense that only addresses one specific theft technique.</p>
<h2 id="a-practical-takeaway">A practical takeaway</h2>
<p>Treating &ldquo;session hijacking&rdquo; as one problem with one fix — commonly, assuming that adopting phishing-resistant MFA solves it — misses that MFA-relay is only one of several distinct ways an attacker can end up holding a valid session token. A resilient posture needs to address the token itself (short lifetimes, <code>HttpOnly</code> and <code>Secure</code> flags, device binding where feasible) as a security boundary in its own right, separate from and in addition to hardening the authentication event that precedes it.</p>
]]></content:encoded></item><item><title>Why SMS MFA Is Being Replaced—and What to Use Instead</title><link>https://firewallsync.com/posts/why-sms-mfa-is-being-replaced-and-what-to-use-instead/</link><guid>https://firewallsync.com/posts/why-sms-mfa-is-being-replaced-and-what-to-use-instead/</guid><pubDate>Fri, 20 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>SMS-based MFA doesn't fail because of a flaw in the code itself. It fails because it depends on the telephone network's identity verification, which was never designed to be a security control.</description><enclosure url="https://firewallsync.com/posts/why-sms-mfa-is-being-replaced-and-what-to-use-instead/cover_hu9372787571675044317.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/why-sms-mfa-is-being-replaced-and-what-to-use-instead/cover_hu9372787571675044317.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/why-sms-mfa-is-being-replaced-and-what-to-use-instead/cover_hu9372787571675044317.jpg" alt="Smartphone showing a lock icon on a yellow background" width="1200" height="630"></p><p>SMS-based one-time codes don&rsquo;t fail because of a flaw in the code itself — a six-digit number sent over SMS is cryptographically no different from one generated by an authenticator app. They fail because the delivery channel depends entirely on the security of the telephone network and carrier identity-verification processes, neither of which were designed with this kind of security use case in mind, and both of which have well-documented, actively exploited weaknesses.</p>
<h2 id="sim-swapping-attacking-the-delivery-channel-not-the-code">SIM swapping: attacking the delivery channel, not the code</h2>
<p>A SIM swap attack doesn&rsquo;t try to intercept or guess the code at all — it targets the carrier&rsquo;s own account-verification process, social-engineering or bribing a carrier representative into transferring a victim&rsquo;s phone number to a SIM card the attacker controls. Once that transfer succeeds, every SMS-based code meant for the victim goes straight to the attacker instead, with the victim&rsquo;s actual security practices being entirely irrelevant to the outcome. This has become an industrialized service on criminal forums, with SIM swaps available for purchase against specific carriers at a set price, rather than requiring a skilled individual attacker for each target.</p>
<h2 id="ss7-interception-a-deeper-protocol-level-weakness">SS7 interception: a deeper protocol-level weakness</h2>
<p>Beyond SIM swapping, the SS7 signaling protocol underlying much of global telecom infrastructure has known weaknesses that allow message interception with the right network-level access, without needing to compromise the victim&rsquo;s SIM at all. This has been demonstrated and exploited against real banking customers, and it&rsquo;s a weakness in the telecom infrastructure itself, not something any individual organization sending SMS codes can mitigate on their own end.</p>
<h2 id="real-time-phishing-relay-defeats-sms-the-same-way-it-defeats-any-otp">Real-time phishing relay defeats SMS the same way it defeats any OTP</h2>
<p>Independent of carrier-level attacks, an adversary-in-the-middle phishing kit can simply ask the victim to type their SMS code into a fake login page and relay it to the real service in real time — this works against any one-time code delivered through any channel, SMS included, because the code itself carries no information about which site it&rsquo;s legitimately being used on. This is the same structural weakness that affects authenticator-app codes and any other OTP-based MFA that isn&rsquo;t cryptographically bound to the origin — SMS just adds the carrier-level attack surface on top of this shared weakness.</p>
<h2 id="what-regulators-and-standards-bodies-actually-say">What regulators and standards bodies actually say</h2>
<p>NIST classified SMS as a &ldquo;restricted&rdquo; authenticator in its digital identity guidelines as early as 2017 — a designation requiring organizations to specifically assess and accept the risk and maintain a migration plan away from it, short of an outright ban. Later revisions to NIST&rsquo;s guidance have continued to discourage it further for higher-assurance use cases, and a growing number of regulators internationally — in banking and financial services particularly — have moved to require phishing-resistant authentication for higher-risk transactions specifically, under which SMS OTP does not qualify. The direction of travel across standards bodies and regulators is consistent even where the specific timelines and requirements differ by jurisdiction and industry.</p>
<h2 id="what-to-actually-migrate-to">What to actually migrate to</h2>
<p><strong>Passkeys (FIDO2/WebAuthn)</strong> are the strongest realistic default for most organizations, providing genuine phishing resistance through origin-bound cryptographic challenges rather than a transmittable code — covered in more depth in comparing passkeys against dedicated hardware keys.</p>
<p><strong>TOTP authenticator apps</strong> (Google Authenticator, Authy, or similar) remain an acceptable intermediate step where passkeys aren&rsquo;t yet supported by a given system — they remove the carrier-dependency and SIM-swap risk entirely, since the code is generated locally on the device from a shared secret rather than transmitted over the telecom network, though they remain vulnerable to real-time phishing relay the same as SMS is, just without the additional carrier-level attack surface.</p>
<p><strong>Hardware security keys</strong> for the highest-sensitivity accounts, for the reasons covered in the passkeys comparison — key material that never leaves a dedicated physical device, for the specific set of accounts where that additional assurance is worth the operational overhead.</p>
<h2 id="migration-practicalities">Migration practicalities</h2>
<p><strong>Prioritize by account sensitivity, not by ease of migration.</strong> Administrative and high-privilege accounts should move off SMS first, even if a broader rollout across the full user base takes longer — the accounts where a successful SIM-swap or interception attack would matter most shouldn&rsquo;t wait for a company-wide rollout to be scheduled.</p>
<p><strong>Don&rsquo;t leave SMS as a silent fallback option after migrating.</strong> A user who has enrolled a passkey but still has SMS configured as a recovery or fallback method hasn&rsquo;t actually closed the gap — an attacker will simply target whichever method is weakest, and a strong primary factor with a weak fallback is still exploitable through the fallback path.</p>
<p><strong>Expect a longer tail than the initial rollout suggests.</strong> Some legacy systems, some third-party integrations, and some lower-priority internal tools may not support modern authentication methods at all, meaning a full SMS-elimination effort often takes longer than the headline migration to passkeys for primary systems — track this explicitly rather than considering the migration complete once the main identity provider is updated.</p>
<p>The reason to move off SMS isn&rsquo;t that it provides zero protection — it&rsquo;s meaningfully better than no second factor at all. It&rsquo;s that meaningfully stronger, similarly convenient alternatives now exist, and the specific attack patterns SMS remains vulnerable to (SIM swapping, SS7 interception) are active, documented, and increasingly accessible to attackers without specialized skill.</p>
]]></content:encoded></item><item><title>Phishing-Resistant MFA: Passkeys vs FIDO2 Security Keys</title><link>https://firewallsync.com/posts/phishing-resistant-mfa-passkeys-vs-fido2-security-keys/</link><guid>https://firewallsync.com/posts/phishing-resistant-mfa-passkeys-vs-fido2-security-keys/</guid><pubDate>Thu, 19 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>Passkeys and FIDO2 security keys share the same underlying cryptographic protocol and the same phishing resistance. Where they differ is storage, portability, and what that means for a rollout.</description><enclosure url="https://firewallsync.com/posts/phishing-resistant-mfa-passkeys-vs-fido2-security-keys/cover_hu15179378669689982879.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/phishing-resistant-mfa-passkeys-vs-fido2-security-keys/cover_hu15179378669689982879.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/phishing-resistant-mfa-passkeys-vs-fido2-security-keys/cover_hu15179378669689982879.jpg" alt="Padlock on top of a computer keyboard" width="1200" height="630"></p><p>Passkeys and dedicated FIDO2 security keys (like a YubiKey) are often presented as competing options, but they share the same underlying cryptographic protocol and the same core security property: both are phishing-resistant because the authentication challenge is cryptographically bound to the actual origin (the domain) being authenticated against, which means neither can be tricked into producing a valid response for a convincing lookalike site the way a password or OTP can. Where they genuinely differ is in where the private key lives and how it moves between devices — and that difference has real operational consequences for a rollout.</p>
<h2 id="the-shared-foundation-why-both-resist-phishing">The shared foundation: why both resist phishing</h2>
<p>Both are built on the WebAuthn/FIDO2 standard, generating a public-private key pair during registration, with the private key never leaving the authenticator (whether that&rsquo;s a phone, a computer&rsquo;s secure enclave, or a dedicated hardware key) and never being transmitted during authentication. The browser and authenticator handle the cryptographic exchange with the actual origin the user is connected to — an attacker&rsquo;s lookalike domain simply cannot produce a valid signed challenge, regardless of how convincing the visual phishing page looks, because the origin binding happens at the protocol level, not through anything a human could be tricked into overlooking.</p>
<h2 id="where-they-diverge-storage-and-portability">Where they diverge: storage and portability</h2>
<p><strong>A dedicated FIDO2 security key</strong> stores its private keys on a physically separate piece of hardware, isolated from the computer or phone being used to authenticate. This means the key material never touches the general-purpose device&rsquo;s storage or memory at all — a fully compromised laptop still can&rsquo;t extract the private key from a hardware key plugged into it, since the key never leaves the hardware token&rsquo;s own secure element.</p>
<p><strong>A passkey</strong>, by contrast, is typically stored on a general-purpose device (a phone, a laptop) and synced across a user&rsquo;s devices through a platform ecosystem — Apple&rsquo;s iCloud Keychain, Google Password Manager, or a third-party password manager supporting passkey sync. This sync is convenient (a user doesn&rsquo;t need to carry a separate physical object, and losing one device doesn&rsquo;t mean losing the credential), but it means the passkey&rsquo;s security now also depends on the security of that sync mechanism and the account protecting it.</p>
<h2 id="what-this-means-for-threat-models">What this means for threat models</h2>
<p>For most organizations, syncable passkeys provide a substantial security improvement over passwords and traditional MFA, with meaningfully lower operational friction than distributing and managing physical hardware keys — the phishing resistance is the same, and the sync mechanism, while a new dependency, is generally well-protected by the platform providers offering it.</p>
<p>For the highest-sensitivity accounts — root cloud administrator access, code-signing credentials, anything where the specific threat model includes a sophisticated attacker who might target the sync ecosystem itself — a dedicated hardware key that never touches network-connected storage at all remains the stronger choice, precisely because it removes the sync mechanism as a dependency entirely.</p>
<h2 id="rollout-considerations-that-actually-differ">Rollout considerations that actually differ</h2>
<p><strong>Cost and logistics.</strong> Passkeys require no additional hardware purchase or distribution — they use devices employees already have. Hardware keys require procurement, distribution, and a process for handling lost or damaged keys, which is real operational overhead, though a worthwhile one for the accounts that justify it.</p>
<p><strong>Recovery.</strong> A lost phone with synced passkeys can often be recovered through the platform&rsquo;s own account recovery, assuming that account itself is well-secured. A lost hardware key typically requires a pre-registered backup key or a separate recovery process, since there&rsquo;s no cloud sync to fall back on — meaning hardware key deployments need a deliberate backup-key strategy from day one, or users get locked out with no graceful recovery path.</p>
<p><strong>Cross-platform and cross-ecosystem use.</strong> Passkey sync currently works most smoothly within a single ecosystem (all-Apple, all-Google); moving a passkey across ecosystems is improving but still has rough edges. A hardware key works identically regardless of which computer or phone it&rsquo;s plugged into or tapped against, making it a more predictable choice for users who regularly switch between different devices or platforms.</p>
<h2 id="a-practical-rollout-approach">A practical rollout approach</h2>
<p>Use syncable passkeys as the default for the broad employee population — the phishing resistance benefit applies universally, the operational overhead is minimal, and it meets most organizations&rsquo; actual risk profile. Reserve dedicated FIDO2 hardware keys for the specific set of highest-privilege accounts (infrastructure administrators, anyone with standing production access, anyone handling signing keys or similarly consequential credentials) where the added assurance of key material that never touches synced cloud storage is worth the additional procurement and recovery-process overhead.</p>
<p>Both are dramatically better than passwords or traditional OTP-based MFA from a phishing-resistance standpoint — the choice between them is about matching the right level of operational rigor to the actual stakes of each account, not about one being fundamentally more secure than the other at the protocol level.</p>
]]></content:encoded></item><item><title>MCP Authentication and Authorization: What a Secure Deployment Should Check</title><link>https://firewallsync.com/posts/mcp-authentication-and-authorization-what-a-secure-deployment-should-check/</link><guid>https://firewallsync.com/posts/mcp-authentication-and-authorization-what-a-secure-deployment-should-check/</guid><pubDate>Sun, 15 Nov 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AI Security</category><description>MCP's authorization spec is built on OAuth 2.1 for a specific reason: most MCP clients are desktop apps and CLI tools that can't securely hold a client secret, and OAuth 2.1's mandatory PKCE was designed for exactly that constraint.</description><enclosure url="https://firewallsync.com/posts/mcp-authentication-and-authorization-what-a-secure-deployment-should-check/cover_hu14153678601396985064.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/mcp-authentication-and-authorization-what-a-secure-deployment-should-check/cover_hu14153678601396985064.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/mcp-authentication-and-authorization-what-a-secure-deployment-should-check/cover_hu14153678601396985064.jpg" alt="Padlock and keys resting on a computer keyboard" width="1200" height="630"></p><p>The MCP specification&rsquo;s authorization framework, revised in 2025, is built on OAuth 2.1 rather than a bespoke authentication scheme — a deliberate choice, since most MCP clients (desktop AI applications, CLI-based agents, browser-based interfaces) are public clients that can&rsquo;t securely store a client secret, and OAuth 2.1&rsquo;s mandatory PKCE requirement exists specifically to secure authorization flows for exactly that class of client, without needing one.</p>
<h2 id="the-roles-map-onto-standard-oauth-21">The roles map onto standard OAuth 2.1</h2>
<p>An MCP server, when exposed over HTTP transport, acts as an OAuth resource server. The MCP client (the AI application) is the OAuth client. A separate authorization server — which can be a dedicated identity provider, or co-hosted with the resource server in simpler deployments — issues access tokens. This is a clean, standard separation of concerns: the authorization server handles authenticating users and issuing tokens, and the MCP server&rsquo;s only job is validating tokens presented to it and enforcing the permissions they encode.</p>
<h2 id="how-the-flow-actually-works">How the flow actually works</h2>
<p>A client connecting to an MCP server without a token receives a 401 response, with a <code>WWW-Authenticate</code> header pointing to a Protected Resource Metadata document (per RFC 9728) that tells the client where to find the appropriate authorization server. The client then runs a standard OAuth 2.1 authorization code flow with PKCE against that authorization server, obtaining an access token that&rsquo;s specifically bound to that MCP server as its intended audience (per RFC 8707&rsquo;s resource indicators). Every subsequent request to the MCP server includes that token as a bearer credential, and the server validates its signature, issuer, expiration, and — critically — its audience before processing any tool call.</p>
<h2 id="audience-validation-is-the-control-that-prevents-token-misuse">Audience validation is the control that prevents token misuse</h2>
<p>This is the detail that separates a correct MCP authorization implementation from a superficial one: the server must verify that a presented token was actually issued for it specifically, not for some other service. Without this check, a token obtained for a different, unrelated API could potentially be presented to and accepted by an MCP server that doesn&rsquo;t verify audience — and conversely, a token issued for the MCP server should never be forwarded on to some other upstream API as if it were valid there, since that upstream service never intended to trust this particular token in the first place. Skipping audience validation is what collapses two independent trust boundaries into one, which is the essence of the confused deputy failure pattern discussed elsewhere in MCP security.</p>
<h2 id="stdio-servers-are-a-deliberately-different-case">STDIO servers are a deliberately different case</h2>
<p>For local, STDIO-transport MCP servers — running as a subprocess on the same machine as the client, communicating over standard input/output — the specification explicitly says OAuth should not be used. The transport itself provides the relevant isolation (the operating system&rsquo;s own process and permission boundaries), and credentials for these servers should instead come from the local environment directly, the same way any local CLI tool typically handles its own configuration. Applying full OAuth flows to a local subprocess server would add complexity without a corresponding security benefit, since the trust boundary being protected doesn&rsquo;t cross a network at all in that scenario.</p>
<h2 id="what-a-secure-deployment-actually-needs-to-check">What a secure deployment actually needs to check</h2>
<p><strong>Separate the authorization server from the resource server in production</strong>, rather than having the MCP server issue its own tokens directly — this separation is what allows proper audience binding and centralized identity management, rather than each MCP server implementing its own ad hoc authentication.</p>
<p><strong>Validate token audience on every request</strong>, not just signature and expiration — a token that&rsquo;s otherwise valid but wasn&rsquo;t issued for this specific server should be rejected, full stop, regardless of how legitimate its origin looks.</p>
<p><strong>Never pass through a received token to an upstream API</strong> unless that upstream API explicitly issued or trusts tokens of that specific type and audience — accepting a client&rsquo;s token and simply forwarding it onward is the token-passthrough pattern the specification&rsquo;s audience-binding requirements exist specifically to prevent.</p>
<p><strong>Enforce fine-grained scopes at the tool-call level, not just at the connection level.</strong> A valid, correctly audience-bound token establishes that this client is allowed to talk to this server — it doesn&rsquo;t by itself answer whether this specific tool call, with these specific parameters, should be permitted for this specific user or agent. That&rsquo;s a separate authorization decision, enforced per tool call, that OAuth scopes can inform but don&rsquo;t automatically resolve on their own.</p>
<p><strong>Use dynamic client registration and discovery as designed</strong>, rather than hardcoding assumptions about a single authorization server — the specification&rsquo;s discovery mechanisms exist to let this configuration be automated and consistent across different MCP servers and clients, and bypassing them tends to reintroduce the kind of ad hoc, per-integration authentication logic OAuth 2.1 adoption was meant to replace.</p>
<h2 id="why-getting-this-right-matters-more-for-mcp-than-for-a-typical-api">Why getting this right matters more for MCP than for a typical API</h2>
<p>A typical API breach exposes data. An MCP server with a broken authorization boundary exposes a channel through which an AI agent — potentially manipulated through prompt injection or tool poisoning — can take real actions using whatever the server&rsquo;s underlying credentials allow. Getting authentication and authorization right at this layer isn&rsquo;t just about preventing unauthorized access to the MCP server itself; it&rsquo;s a load-bearing part of containing what a manipulated or misused agent can actually accomplish once it&rsquo;s connected.</p>
]]></content:encoded></item><item><title>PHP session_regenerate_id: Stop Session Fixation Right</title><link>https://firewallsync.com/posts/php-session-regenerate-id-stop-session-fixation/</link><guid>https://firewallsync.com/posts/php-session-regenerate-id-stop-session-fixation/</guid><pubDate>Wed, 28 Oct 2026 04:45:00 +0000</pubDate><dc:creator>Craig Leslie</dc:creator><category>AppSec &amp; APIs</category><description>Calling session_regenerate_id() at login is the start of PHP session security, not the whole of it. This guide shows the fixation attack strict mode does not stop, a tested helper for timestamp-based rotation, idle and absolute timeouts, and the grace-period shortcut that quietly undoes the fix.</description><enclosure url="https://firewallsync.com/posts/php-session-regenerate-id-stop-session-fixation/cover_hu2986149460493088631.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/php-session-regenerate-id-stop-session-fixation/cover_hu2986149460493088631.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/php-session-regenerate-id-stop-session-fixation/cover_hu2986149460493088631.jpg" alt="Two antique brass skeleton keys on a white background, one pointing up and one down, each tied with a thin pale pink ribbon" width="1200" height="630"></p><p>To stop session fixation in PHP, call <code>session_regenerate_id()</code>, or the timestamp-based rotation shown below, whenever a user&rsquo;s privilege changes. Do it before you store the authenticated user in <code>$_SESSION</code>. Don&rsquo;t destroy the old session on the spot. Mark it with a timestamp and refuse it after a short grace period, and enforce your own idle and absolute timeouts, because PHP&rsquo;s garbage collector is not a timeout. That is what PHP&rsquo;s own manual asks for. Below is a helper that follows it, tested against a fixation attack, plus the one shortcut in the manual&rsquo;s example that brings the attack back if you use it at login.</p>
<p>Every behaviour here was run on PHP 8.3.6 CLI with the built-in web server (<code>php -S</code>) and curl, using the default <code>files</code> save handler. The cookie flags and <code>php.ini</code> settings that go with this code are covered in our <a href="/posts/php-ini-security-hardening-production-settings/">php.ini security hardening guide</a>. This article is about the session lifecycle in your application code.</p>
<h2 id="the-attack-strict-mode-doesnt-stop">The attack strict mode doesn&rsquo;t stop</h2>
<p><code>session.use_strict_mode=1</code> makes PHP reject a session ID it never issued. That stops an attacker inventing an ID such as <code>PHPSESSID=123456</code>. But the <a href="https://www.php.net/manual/en/features.session.security.management.php">PHP manual</a> is explicit about the gap: &ldquo;an attacker can force users to use an initialized session ID which has been created by an attacker.&rdquo; The attacker visits your site, receives a real ID, and plants it in the victim&rsquo;s browser. The manual describes two routes: setting a cookie that the browser&rsquo;s precedence rules let override yours (for example from another subdomain), and JavaScript injection. If your login code keeps that ID, the attacker now holds an authenticated session.</p>
<p>We reproduced it with a minimal app whose login does only <code>$_SESSION['uid'] = 42;</code>, run with strict mode on:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-console" data-lang="console"><span style="display:flex;"><span>$ PHPFLAGS<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;-d session.use_strict_mode=1&#34;</span> ./test.sh naive <span style="color:#ae81ff">8090</span>
</span></span><span style="display:flex;"><span>attacker ID: pmq468mni64u18nhukmh7vqe1v
</span></span><span style="display:flex;"><span>logged in
</span></span><span style="display:flex;"><span>ID after login: unchanged
</span></span><span style="display:flex;"><span>attacker replays old ID: account page for uid 42
</span></span></code></pre></div><p>The test script fetches <code>/</code> to get a real ID, sends <code>/login</code> with that ID as the victim, then replays the ID as the attacker.</p>
<h2 id="what-phps-manual-requires">What PHP&rsquo;s manual requires</h2>
<p>The session security chapter is unusually prescriptive. The rules that matter for application code:</p>
<ul>
<li><strong>Rotate on privilege change, before writing auth state.</strong> &ldquo;Session IDs must be regenerated when user privileges are elevated, such as after authenticating. session_regenerate_id must be called prior to setting the authentication information to $_SESSION.&rdquo; Rotate again on any later privilege change, such as entering an admin area or completing step-up authentication. The <a href="https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html">OWASP Session Management Cheat Sheet</a> makes the same point: renew the ID &ldquo;after any privilege level change&rdquo;.</li>
<li><strong>Don&rsquo;t delete active sessions immediately.</strong> &ldquo;session_regenerate_id(true); and session_destroy must never be called together for an active session.&rdquo; Deleting right away loses sessions when requests overlap or the new cookie never arrives. It also removes your chance to notice that someone used an old ID.</li>
<li><strong>Use timestamps instead.</strong> Set &ldquo;a short-term expiration time (timestamp) in $_SESSION&rdquo; on the old session and refuse it later: &ldquo;a few seconds later for stable networks&hellip; and a few minutes later for unstable networks such as cell phones or Wi-Fi.&rdquo;</li>
<li><strong>Don&rsquo;t rely on <code>session.gc_maxlifetime</code> for expiry.</strong> &ldquo;Attackers may access a victim&rsquo;s session ID periodically to prevent its expiration and keep exploiting it.&rdquo; The setting only controls when data &ldquo;will be seen as &lsquo;garbage&rsquo; and potentially cleaned up&rdquo; (default 1440 seconds).</li>
<li><strong>Treat obsolete-ID access as a signal.</strong> When an expired ID is used, the manual recommends removing &ldquo;authenticated status from all of the user&rsquo;s sessions&rdquo; and forcing re-authentication.</li>
</ul>
<p>The <a href="https://www.php.net/manual/en/function.session-regenerate-id.php"><code>session_regenerate_id()</code> page</a> has two example implementations. Both are labelled &ldquo;not fully working code, but an example!&rdquo;</p>
<h2 id="a-tested-rotation-helper">A tested rotation helper</h2>
<p><code>session_guard.php</code> follows the manual&rsquo;s pattern, with two corrections we found in testing (explained after the code). It targets PHP 8.1 or later (<code>session_create_id()</code> exists from 7.1, and the cookie-options array for <code>setcookie()</code> from 7.3).</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-php" data-lang="php"><span style="display:flex;"><span><span style="color:#f92672">&lt;?</span><span style="color:#a6e22e">php</span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// session_guard.php: timestamp-based session ID rotation, adapted from the
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">// pattern in the PHP manual&#39;s session_regenerate_id() page.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">declare</span>(<span style="color:#a6e22e">strict_types</span><span style="color:#f92672">=</span><span style="color:#ae81ff">1</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">defined</span>(<span style="color:#e6db74">&#39;SESSION_GRACE&#39;</span>)    <span style="color:#f92672">||</span> <span style="color:#a6e22e">define</span>(<span style="color:#e6db74">&#39;SESSION_GRACE&#39;</span>, <span style="color:#ae81ff">60</span>);     <span style="color:#75715e">// old ID usable after rotation (s)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">defined</span>(<span style="color:#e6db74">&#39;SESSION_IDLE&#39;</span>)     <span style="color:#f92672">||</span> <span style="color:#a6e22e">define</span>(<span style="color:#e6db74">&#39;SESSION_IDLE&#39;</span>, <span style="color:#ae81ff">1800</span>);    <span style="color:#75715e">// idle timeout (s)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">defined</span>(<span style="color:#e6db74">&#39;SESSION_ABSOLUTE&#39;</span>) <span style="color:#f92672">||</span> <span style="color:#a6e22e">define</span>(<span style="color:#e6db74">&#39;SESSION_ABSOLUTE&#39;</span>, <span style="color:#ae81ff">28800</span>); <span style="color:#75715e">// absolute timeout (s)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">defined</span>(<span style="color:#e6db74">&#39;SESSION_ROTATE&#39;</span>)   <span style="color:#f92672">||</span> <span style="color:#a6e22e">define</span>(<span style="color:#e6db74">&#39;SESSION_ROTATE&#39;</span>, <span style="color:#ae81ff">900</span>);   <span style="color:#75715e">// periodic rotation (s)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">final</span> <span style="color:#66d9ef">class</span> <span style="color:#a6e22e">ObsoleteSessionAccess</span> <span style="color:#66d9ef">extends</span> <span style="color:#a6e22e">RuntimeException</span> {}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">secure_session_start</span>()<span style="color:#f92672">:</span> <span style="color:#a6e22e">void</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">ini_set</span>(<span style="color:#e6db74">&#39;session.use_strict_mode&#39;</span>, <span style="color:#e6db74">&#39;1&#39;</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">session_start</span>();
</span></span><span style="display:flex;"><span>    $now <span style="color:#f92672">=</span> <span style="color:#a6e22e">time</span>();
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 1. Old ID after rotation: allow a short grace period, then refuse.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">isset</span>($_SESSION[<span style="color:#e6db74">&#39;destroyed&#39;</span>])) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> ($_SESSION[<span style="color:#e6db74">&#39;destroyed&#39;</span>] <span style="color:#f92672">&lt;</span> $now <span style="color:#f92672">-</span> <span style="color:#a6e22e">SESSION_GRACE</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">throw</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">ObsoleteSessionAccess</span>(<span style="color:#e6db74">&#39;obsolete session ID used&#39;</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">isset</span>($_SESSION[<span style="color:#e6db74">&#39;new_session_id&#39;</span>])) {
</span></span><span style="display:flex;"><span>            <span style="color:#75715e">// Cookie for the new ID was probably lost: move the client over.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>            <span style="color:#a6e22e">session_commit</span>();
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">session_id</span>($_SESSION[<span style="color:#e6db74">&#39;new_session_id&#39;</span>]);
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">session_start</span>();
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">return</span>;
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 2. Idle and absolute timeouts, enforced in application code.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">isset</span>($_SESSION[<span style="color:#e6db74">&#39;uid&#39;</span>])) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> ($now <span style="color:#f92672">-</span> ($_SESSION[<span style="color:#e6db74">&#39;last_seen&#39;</span>] <span style="color:#f92672">??</span> <span style="color:#ae81ff">0</span>) <span style="color:#f92672">&gt;</span> <span style="color:#a6e22e">SESSION_IDLE</span>
</span></span><span style="display:flex;"><span>            <span style="color:#f92672">||</span> $now <span style="color:#f92672">-</span> ($_SESSION[<span style="color:#e6db74">&#39;created&#39;</span>] <span style="color:#f92672">??</span> <span style="color:#ae81ff">0</span>) <span style="color:#f92672">&gt;</span> <span style="color:#a6e22e">SESSION_ABSOLUTE</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">secure_logout</span>();
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">session_start</span>();
</span></span><span style="display:flex;"><span>            <span style="color:#66d9ef">return</span>;
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>        $_SESSION[<span style="color:#e6db74">&#39;last_seen&#39;</span>] <span style="color:#f92672">=</span> $now;
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">if</span> ($now <span style="color:#f92672">-</span> ($_SESSION[<span style="color:#e6db74">&#39;rotated&#39;</span>] <span style="color:#f92672">??</span> <span style="color:#ae81ff">0</span>) <span style="color:#f92672">&gt;</span> <span style="color:#a6e22e">SESSION_ROTATE</span>) {
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">secure_regenerate</span>(<span style="color:#66d9ef">true</span>);
</span></span><span style="display:flex;"><span>        }
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// $forward: let a client still holding the old ID be moved to the new one
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">// during the grace period (lost Set-Cookie on a flaky network). Never forward
</span></span></span><span style="display:flex;"><span><span style="color:#75715e">// on a privilege change: whoever holds the old ID would be handed the new one.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">secure_regenerate</span>(<span style="color:#a6e22e">bool</span> $forward)<span style="color:#f92672">:</span> <span style="color:#a6e22e">void</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    $data <span style="color:#f92672">=</span> $_SESSION;                      <span style="color:#75715e">// session_start() below loads an empty session
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    $new <span style="color:#f92672">=</span> <span style="color:#a6e22e">session_create_id</span>();
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> ($forward) {
</span></span><span style="display:flex;"><span>        $_SESSION[<span style="color:#e6db74">&#39;new_session_id&#39;</span>] <span style="color:#f92672">=</span> $new;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>    $_SESSION[<span style="color:#e6db74">&#39;destroyed&#39;</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">time</span>();
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">session_commit</span>();                       <span style="color:#75715e">// old session keeps the markers
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">session_id</span>($new);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">ini_set</span>(<span style="color:#e6db74">&#39;session.use_strict_mode&#39;</span>, <span style="color:#e6db74">&#39;0&#39;</span>); <span style="color:#75715e">// let session_start() accept $new
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#a6e22e">session_start</span>();
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">ini_set</span>(<span style="color:#e6db74">&#39;session.use_strict_mode&#39;</span>, <span style="color:#e6db74">&#39;1&#39;</span>);
</span></span><span style="display:flex;"><span>    $_SESSION <span style="color:#f92672">=</span> $data;
</span></span><span style="display:flex;"><span>    $_SESSION[<span style="color:#e6db74">&#39;rotated&#39;</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">time</span>();
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">secure_login</span>(<span style="color:#a6e22e">int</span> $uid)<span style="color:#f92672">:</span> <span style="color:#a6e22e">void</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">secure_regenerate</span>(<span style="color:#66d9ef">false</span>);               <span style="color:#75715e">// rotate BEFORE marking authenticated
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    $_SESSION[<span style="color:#e6db74">&#39;uid&#39;</span>] <span style="color:#f92672">=</span> $uid;
</span></span><span style="display:flex;"><span>    $_SESSION[<span style="color:#e6db74">&#39;created&#39;</span>] <span style="color:#f92672">=</span> $_SESSION[<span style="color:#e6db74">&#39;last_seen&#39;</span>] <span style="color:#f92672">=</span> <span style="color:#a6e22e">time</span>();
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">function</span> <span style="color:#a6e22e">secure_logout</span>()<span style="color:#f92672">:</span> <span style="color:#a6e22e">void</span>
</span></span><span style="display:flex;"><span>{
</span></span><span style="display:flex;"><span>    $_SESSION <span style="color:#f92672">=</span> [];
</span></span><span style="display:flex;"><span>    $p <span style="color:#f92672">=</span> <span style="color:#a6e22e">session_get_cookie_params</span>();
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">setcookie</span>(<span style="color:#a6e22e">session_name</span>(), <span style="color:#e6db74">&#39;&#39;</span>, [
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#39;expires&#39;</span> <span style="color:#f92672">=&gt;</span> <span style="color:#a6e22e">time</span>() <span style="color:#f92672">-</span> <span style="color:#ae81ff">3600</span>, <span style="color:#e6db74">&#39;path&#39;</span> <span style="color:#f92672">=&gt;</span> $p[<span style="color:#e6db74">&#39;path&#39;</span>], <span style="color:#e6db74">&#39;domain&#39;</span> <span style="color:#f92672">=&gt;</span> $p[<span style="color:#e6db74">&#39;domain&#39;</span>],
</span></span><span style="display:flex;"><span>        <span style="color:#e6db74">&#39;secure&#39;</span> <span style="color:#f92672">=&gt;</span> $p[<span style="color:#e6db74">&#39;secure&#39;</span>], <span style="color:#e6db74">&#39;httponly&#39;</span> <span style="color:#f92672">=&gt;</span> $p[<span style="color:#e6db74">&#39;httponly&#39;</span>], <span style="color:#e6db74">&#39;samesite&#39;</span> <span style="color:#f92672">=&gt;</span> $p[<span style="color:#e6db74">&#39;samesite&#39;</span>] <span style="color:#f92672">?:</span> <span style="color:#e6db74">&#39;Lax&#39;</span>,
</span></span><span style="display:flex;"><span>    ]);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">session_destroy</span>();
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><p>Wire it in by calling <code>secure_session_start()</code> instead of <code>session_start()</code>, <code>secure_login($userId)</code> after you have verified the password and any second factor, and <code>secure_logout()</code> from your logout handler. On <code>ObsoleteSessionAccess</code>, return 401 and log the event.</p>
<h3 id="what-we-tested">What we tested</h3>
<p>Against the same attack, with the helper in place:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-console" data-lang="console"><span style="display:flex;"><span>$ ./test.sh guard <span style="color:#ae81ff">8086</span>
</span></span><span style="display:flex;"><span>attacker ID: jt6upaht8b1i3hcuuk743hivm5
</span></span><span style="display:flex;"><span>logged in
</span></span><span style="display:flex;"><span>ID after login: 24qohqtgd4trsgfuov1tjn20nm
</span></span><span style="display:flex;"><span>attacker replays old ID: anonymous
</span></span></code></pre></div><p>Periodic rotation, with rotation forced on every request and a 2-second grace period:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-console" data-lang="console"><span style="display:flex;"><span>$ ./test2.sh
</span></span><span style="display:flex;"><span>account page for uid 42
</span></span><span style="display:flex;"><span>login ID 10d0f50p49pto2ocoffotrbsv3 rotated to r4428iae8369vin9533ubpb292
</span></span><span style="display:flex;"><span>old ID inside grace: account page for uid 42
</span></span><span style="display:flex;"><span>old ID after grace:  401 obsolete session
</span></span><span style="display:flex;"><span>logout with current ID: logged out
</span></span><span style="display:flex;"><span>current ID after logout: anonymous
</span></span></code></pre></div><p>With a 1-second idle timeout, a request made 3 seconds after login came back anonymous with a new session cookie, and the logged-in session&rsquo;s file was gone from <code>session.save_path</code>. The pre-login session stayed on disk, marked as destroyed, until garbage collection, as the manual intends.</p>
<h3 id="correction-1-never-forward-an-old-id-after-login">Correction 1: never forward an old ID after login</h3>
<p>The manual&rsquo;s second example deals with lost cookies: if the old ID comes back during the grace period, it switches the client to the new ID it stored in the old session. That is reasonable for periodic rotation, where the person holding the old ID is almost always the legitimate user. At login it is a hole. The attacker holds the old, pre-login ID, so forwarding hands them the new, authenticated one.</p>
<p>Our first draft forwarded in both cases, and the fixation test failed: the attacker&rsquo;s replay returned <code>account page for uid 42</code>. The manual hints at this in a comment (&ldquo;Do not try to set session ID again if you would like to remove authentication flag&rdquo;). The helper makes it explicit: <code>secure_regenerate(false)</code> at login, <code>secure_regenerate(true)</code> only for timed rotation. The trade-off is that a user whose login response is lost has to log in again.</p>
<h3 id="correction-2-carry-the-session-data-across">Correction 2: carry the session data across</h3>
<p>In the manual&rsquo;s example, the new session is started with <code>session_id($new); session_start();</code>. In our test on PHP 8.3.6, that started an empty <code>$_SESSION</code>: the authenticated user vanished on the first periodic rotation. The helper copies the data before committing the old session and restores it after starting the new one. At login this also keeps pre-login state, such as a cart.</p>
<h2 id="other-session-rules-worth-enforcing">Other session rules worth enforcing</h2>
<ul>
<li><strong>Timeouts.</strong> OWASP gives common idle timeouts of &ldquo;2-5 minutes for high-value applications and 15-30 minutes for low risk applications&rdquo;. Every session should also have an absolute timeout &ldquo;regardless of session activity&rdquo;. The helper&rsquo;s defaults (30 minutes idle, 8 hours absolute) are examples; set your own.</li>
<li><strong>Locking.</strong> PHP locks session data per request, which attackers can abuse to tie up workers. The manual suggests <code>session_start(['read_and_close' =&gt; true])</code> for requests that only read the session, and <code>session_commit()</code> as soon as you have finished writing.</li>
<li><strong>Remember-me is not a long session.</strong> The manual says not to &ldquo;use long life session IDs for auto-login&rdquo;. Use a separate, single-use random token in its own cookie, and replace it each time it is used.</li>
<li><strong>Track active sessions</strong> if you need &ldquo;log out everywhere&rdquo; or the manual&rsquo;s response to obsolete-ID access. PHP doesn&rsquo;t do this for you. The manual suggests a user-ID-prefixed ID from <code>session_create_id()</code>, which &ldquo;is vital&rdquo; to pair with strict mode. Don&rsquo;t use a confidential value as the prefix.</li>
<li><strong>Sessions don&rsquo;t stop CSRF.</strong> &ldquo;Sessions and authentication do not protect against CSRF attacks.&rdquo; See our <a href="/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/">CSRF defences comparison</a>.</li>
<li><strong>Session files are an attack surface.</strong> October&rsquo;s PHP2Shell attempts tried to plant code through session files. See the <a href="/posts/php2shell-cve-2026-109618-cve-2026-109619-patch-and-hunt/">PHP2Shell patch-and-hunt guide</a>.</li>
</ul>
<h2 id="common-mistakes">Common mistakes</h2>
<table>
  <thead>
      <tr>
          <th>Mistake</th>
          <th>Why it fails</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Setting <code>$_SESSION['uid']</code> before rotating</td>
          <td>The pre-login ID, which an attacker may hold, briefly carries the authenticated state. The manual says to rotate first</td>
      </tr>
      <tr>
          <td><code>session_regenerate_id(true)</code> on every request</td>
          <td>Concurrent requests lose their session, and you can no longer detect old-ID reuse</td>
      </tr>
      <tr>
          <td>Relying on <code>gc_maxlifetime</code> for logout</td>
          <td>Garbage collection is probabilistic, and activity on a stolen ID keeps it alive</td>
      </tr>
      <tr>
          <td>Forwarding old IDs after login</td>
          <td>Gives the attacker the new authenticated ID (our test)</td>
      </tr>
      <tr>
          <td>Rotating only at login</td>
          <td>A stolen post-login ID stays valid until logout or timeout. Add periodic rotation for sensitive apps</td>
      </tr>
  </tbody>
</table>
<h2 id="limits-of-this-article">Limits of this article</h2>
<p>The helper is a tested example, not a drop-in library. It assumes PHP&rsquo;s default <code>files</code> handler. A custom or Redis save handler must implement session ID validation for strict mode to work, as the manual notes for user-defined handlers. It does not implement the cross-session &ldquo;remove authentication from all of the user&rsquo;s sessions&rdquo; response, which needs an active-session registry. If you use a framework, prefer its session layer to this helper, and check that it rotates the ID at login and enforces timeouts. Our tests ran on a single PHP process. We did not load-test concurrent requests during rotation.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Status</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Strict mode does not stop initialized attacker IDs; rotate before setting auth; timestamps instead of immediate deletion; gc_maxlifetime not to be relied on; locking; auto-login; CSRF</td>
          <td><a href="https://www.php.net/manual/en/features.session.security.management.php">PHP manual: Session Management Basics</a> (doc-en <code>reference/session/security.xml</code>)</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Example rotation code, &ldquo;not fully working code&rdquo;, lost-cookie forwarding</td>
          <td><a href="https://www.php.net/manual/en/function.session-regenerate-id.php">PHP manual: session_regenerate_id</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>gc_maxlifetime definition and 1440 default</td>
          <td><a href="https://www.php.net/manual/en/session.configuration.php">PHP manual: session runtime configuration</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Renew on privilege change; idle and absolute timeout ranges</td>
          <td><a href="https://cheatsheetseries.owasp.org/cheatsheets/Session_Management_Cheat_Sheet.html">OWASP Session Management Cheat Sheet</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Fixation succeeds without rotation (strict mode on); helper blocks it; forwarding at login reopens it; new session starts empty</td>
          <td>Our tests, PHP 8.3.6 CLI, <code>php -S</code></td>
          <td>Verified (our test)</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>JWT Security: 9 Mistakes That Can Turn Tokens Into an Attack Path</title><link>https://firewallsync.com/posts/jwt-security-9-mistakes-that-can-turn-tokens-into-an-attack-path/</link><guid>https://firewallsync.com/posts/jwt-security-9-mistakes-that-can-turn-tokens-into-an-attack-path/</guid><pubDate>Sat, 17 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>Most JWT vulnerabilities aren't flaws in the standard — they're implementation shortcuts that trust the token to describe its own validity. Here's what to check.</description><enclosure url="https://firewallsync.com/posts/jwt-security-9-mistakes-that-can-turn-tokens-into-an-attack-path/cover_hu14315574143899214785.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/jwt-security-9-mistakes-that-can-turn-tokens-into-an-attack-path/cover_hu14315574143899214785.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/jwt-security-9-mistakes-that-can-turn-tokens-into-an-attack-path/cover_hu14315574143899214785.jpg" alt="Code editor displaying source code" width="1200" height="630"></p><p>Most JWT vulnerabilities aren&rsquo;t flaws in the JWT standard itself. They come from implementations that trust information inside the token — like which algorithm to use for verification — that should never be trusted from an untrusted source in the first place. These nine account for the large majority of real-world JWT findings.</p>
<h2 id="1-trusting-the-algorithm-specified-in-the-token-header">1. Trusting the algorithm specified in the token header</h2>
<p>A JWT&rsquo;s header includes an <code>alg</code> field declaring which algorithm was used to sign it. If your verification code reads this field and uses it to decide how to verify the signature, an attacker can change it to whatever works in their favor. This single design mistake is behind most of the vulnerabilities below.</p>
<h2 id="2-the-alg-none-bypass">2. The <code>alg: none</code> bypass</h2>
<p>Some JWT libraries historically honored an <code>alg</code> value of <code>none</code>, meaning no signature verification happens at all — an attacker can take a valid token, change the payload (for example, setting a role claim to admin), set the algorithm to <code>none</code>, and drop the signature entirely. Vulnerable versions of widely used libraries, including early versions of the Node.js <code>jsonwebtoken</code> package, accepted this. <strong>Fix:</strong> explicitly reject the <code>none</code> algorithm, and don&rsquo;t rely on a library&rsquo;s default behavior without verifying it.</p>
<h2 id="3-rs256-to-hs256-algorithm-confusion">3. RS256-to-HS256 algorithm confusion</h2>
<p>This is the most severe common JWT attack. If your service issues tokens signed with RS256 (asymmetric — private key signs, public key verifies) but your verification code accepts both RS256 and HS256 without pinning which one to expect, an attacker can take your public key (often available, sometimes even published), sign a forged token using HS256 with that public key as the shared secret, and your verifier — trusting the header&rsquo;s claimed algorithm — will use the same public key to &ldquo;verify&rdquo; it, and it matches. This has affected multiple major JWT libraries historically. <strong>Fix:</strong> always explicitly specify the expected algorithm on the verify call; never let the library infer it from the token.</p>
<h2 id="4-no-expiration-or-expiration-thats-never-actually-checked">4. No expiration, or expiration that&rsquo;s never actually checked</h2>
<p>A JWT without an <code>exp</code> claim, or a verification implementation that decodes the token without checking that claim, is effectively a permanent credential once issued. <strong>Fix:</strong> always set a reasonably short expiration, and confirm your verification library is actually enforcing it rather than assuming decode implies validation.</p>
<h2 id="5-no-revocation-strategy">5. No revocation strategy</h2>
<p>This is a structural property of JWTs, not a bug: a self-contained, signed token remains valid until it expires, because there&rsquo;s no server-side record being checked by default. If a user&rsquo;s access needs to be revoked immediately — account compromise, permission change, logout — a pure JWT approach can&rsquo;t do that on its own. <strong>Fix:</strong> either keep expiration short enough that this window is acceptable, or add an explicit revocation mechanism (a checked blocklist, or a version/session identifier in the token that gets invalidated server-side) for cases where immediate revocation actually matters.</p>
<h2 id="6-sensitive-data-stored-in-the-payload">6. Sensitive data stored in the payload</h2>
<p>The JWT payload is Base64-encoded, not encrypted — anyone who has the token can decode and read every claim inside it, they just can&rsquo;t modify it without invalidating the signature. Storing anything sensitive (internal identifiers you don&rsquo;t want exposed, anything resembling a secret) in the payload treats &ldquo;signed&rdquo; as if it meant &ldquo;confidential,&rdquo; which it doesn&rsquo;t. <strong>Fix:</strong> treat the payload as readable by the token holder and anyone they share it with; if something needs to stay confidential, it doesn&rsquo;t belong in the token.</p>
<h2 id="7-weak-or-hardcoded-signing-secrets">7. Weak or hardcoded signing secrets</h2>
<p>For HS256 tokens, the signing secret needs to be long and genuinely random — a short or guessable secret is brute-forceable offline once an attacker has a valid token to test against. Hardcoding the secret in source code is a related and common mistake that turns any code leak into a token-forging capability. <strong>Fix:</strong> use a cryptographically strong secret (256 bits or more), and load it from a secrets manager or environment configuration, never from source.</p>
<h2 id="8-not-validating-the-issuer-and-audience-claims">8. Not validating the issuer and audience claims</h2>
<p>A token correctly signed by your identity provider for one application can sometimes be replayed against a different application if that second application doesn&rsquo;t check the <code>iss</code> (issuer) and <code>aud</code> (audience) claims — it just sees a validly signed token and accepts it. <strong>Fix:</strong> explicitly validate that a token was issued by the expected issuer and intended for your specific application, not just that the signature checks out.</p>
<h2 id="9-using-jwts-for-something-that-needed-server-side-session-state-anyway">9. Using JWTs for something that needed server-side session state anyway</h2>
<p>Some applications adopt JWTs by default because they&rsquo;re common in tutorials, then end up rebuilding server-side session tracking on top of them to get revocation, activity monitoring, or forced logout working correctly — at which point the self-contained property that made JWTs attractive in the first place is gone, and a traditional server-side session token might have been the simpler, more appropriate choice from the start. <strong>Fix:</strong> choose the token approach based on whether you actually need statelessness, not because it&rsquo;s the default pattern in whatever framework you&rsquo;re using.</p>
<h2 id="the-pattern-underneath-all-nine">The pattern underneath all nine</h2>
<p>Every one of these traces back to trusting something that shouldn&rsquo;t be trusted from an untrusted source — the algorithm the attacker&rsquo;s token claims to use, the assumption that &ldquo;signed&rdquo; means &ldquo;confidential,&rdquo; the assumption that a token issued for one purpose can&rsquo;t be replayed for another. Pin your algorithm explicitly, validate every claim that matters for your use case, and treat the token payload as public information the moment it leaves your server.</p>
]]></content:encoded></item><item><title>API Authentication: API Keys vs OAuth vs JWT</title><link>https://firewallsync.com/posts/api-authentication-api-keys-vs-oauth-vs-jwt/</link><guid>https://firewallsync.com/posts/api-authentication-api-keys-vs-oauth-vs-jwt/</guid><pubDate>Sun, 11 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>These three get compared as competing options, but they solve different problems. Picking the wrong one for your actual use case is where most API auth trouble starts.</description><enclosure url="https://firewallsync.com/posts/api-authentication-api-keys-vs-oauth-vs-jwt/cover_hu2442104377494201177.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/api-authentication-api-keys-vs-oauth-vs-jwt/cover_hu2442104377494201177.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/api-authentication-api-keys-vs-oauth-vs-jwt/cover_hu2442104377494201177.jpg" alt="Single metal key" width="1200" height="630"></p><p>API keys, OAuth, and JWTs get discussed as if choosing between them is a single decision with one right answer. In practice they answer different questions, and most real systems end up using more than one together. Picking the wrong one for a given use case — not picking &ldquo;the wrong technology&rdquo; in the abstract — is where most API authentication problems start.</p>
<h2 id="api-keys-identifies-the-caller-not-the-user">API keys: identifies the caller, not the user</h2>
<p>An API key is a static credential that identifies which application or service is making a request. It answers &ldquo;who is calling this API,&rdquo; not &ldquo;which end user authorized this action.&rdquo; This makes it a reasonable fit for server-to-server integrations and internal tooling, where there&rsquo;s no individual human user to authenticate — but a poor fit for anything acting on behalf of a specific person, because the key itself carries no concept of user identity or consent.</p>
<p>The main operational risk is that API keys are typically long-lived and broad by default. Unless you specifically build scoping and rotation into how you issue them, a leaked key tends to grant more access, for longer, than a leaked OAuth token would.</p>
<h2 id="oauth-delegated-authorization-not-authentication-by-itself">OAuth: delegated authorization, not authentication by itself</h2>
<p>OAuth 2.0 solves a specific problem: letting a user grant a third-party application limited access to their resources on another service, without handing over their password. The output of an OAuth flow is an access token scoped to specific permissions the user actually approved — this is what makes it right for &ldquo;let this app read your calendar&rdquo; scenarios that API keys can&rsquo;t represent at all, since a key has no concept of user-granted, revocable scope.</p>
<p>It&rsquo;s worth being precise here: OAuth is an authorization framework, not an authentication protocol. It tells a resource server what the token is allowed to do, not who the underlying user is. OpenID Connect (OIDC), built on top of OAuth, is what adds actual user identity verification via the ID token — if your system needs &ldquo;who is this person,&rdquo; you need OIDC on top of OAuth, not OAuth alone.</p>
<h2 id="jwt-a-token-format-not-a-protocol">JWT: a token format, not a protocol</h2>
<p>This is the comparison people most often get wrong, because a JWT isn&rsquo;t in the same category as the other two — it&rsquo;s a format for representing claims (like user ID, expiration, and scope) in a compact, signed, self-contained way. OAuth access tokens and OIDC ID tokens are frequently implemented as JWTs, but a JWT can also be used entirely outside OAuth, as your own service&rsquo;s session token format.</p>
<p>The property that matters most: a JWT is self-contained and verifiable without a database lookup, because the signature proves it hasn&rsquo;t been tampered with. That&rsquo;s also its biggest operational risk — a JWT can&rsquo;t be revoked by deleting a server-side record the way a traditional session token can, unless you build a separate revocation mechanism (a blocklist, short expiry with refresh, or similar) on top of it.</p>
<h2 id="where-teams-pick-the-wrong-one">Where teams pick the wrong one</h2>
<ul>
<li><strong>Using a long-lived API key for something that acts on behalf of individual end users</strong>, losing any ability to know or limit what a specific user actually authorized</li>
<li><strong>Building a custom OAuth-like flow instead of implementing actual OAuth</strong>, reinventing a security-critical protocol that already has a well-audited specification and mature libraries</li>
<li><strong>Treating a JWT&rsquo;s short expiry as sufficient security on its own</strong>, without a revocation strategy for the case where a token needs to be invalidated before it naturally expires — a compromised account, a permission downgrade, a logout</li>
</ul>
<h2 id="a-practical-way-to-decide">A practical way to decide</h2>
<ul>
<li><strong>Server-to-server, no individual end user involved</strong> → API key, scoped narrowly, rotated regularly</li>
<li><strong>A user needs to grant a third-party app limited access to their data</strong> → OAuth, with OIDC layered on top if you also need to know who the user is</li>
<li><strong>You need a compact, verifiable token to represent a session or claims internally</strong> → JWT, with an explicit plan for how revocation works before you need it</li>
</ul>
<p>The underlying question isn&rsquo;t &ldquo;which is more secure&rdquo; in the abstract — it&rsquo;s &ldquo;what does this specific request actually need to represent: an application&rsquo;s identity, a user&rsquo;s delegated permission, or a portable set of claims.&rdquo; Each of the three answers a different one of those.</p>
]]></content:encoded></item><item><title>SPF, DKIM and DMARC: What Each Record Does and What Gmail and Outlook Require</title><link>https://firewallsync.com/posts/spf-dkim-and-dmarc-what-each-record-does-and-what-gmail-and-outlook-require/</link><guid>https://firewallsync.com/posts/spf-dkim-and-dmarc-what-each-record-does-and-what-gmail-and-outlook-require/</guid><pubDate>Sat, 10 Oct 2026 06:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Security Operations</category><description>SPF, DKIM and DMARC answer three different questions about a message. Here is what each record checks, how alignment ties them together, what Google and Microsoft require from high-volume senders, and a rollout order that avoids blocking your own mail.</description><enclosure url="https://firewallsync.com/posts/spf-dkim-and-dmarc-what-each-record-does-and-what-gmail-and-outlook-require/cover_hu1945361933663001947.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/spf-dkim-and-dmarc-what-each-record-does-and-what-gmail-and-outlook-require/cover_hu1945361933663001947.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/spf-dkim-and-dmarc-what-each-record-does-and-what-gmail-and-outlook-require/cover_hu1945361933663001947.jpg" alt="Five vintage handwritten postcards with stamps and postmarks spread on a black surface" width="1200" height="630"></p><p>SPF, DKIM and DMARC are three DNS-based email authentication methods, and each answers a different question. SPF asks whether the server that delivered a message is allowed to send for a domain. DKIM asks whether a signature on the message verifies against a public key the signing domain published. DMARC asks whether at least one of those two checks passed <em>for the same domain the reader sees in the From address</em>, and tells receivers what to do if neither did. If you send more than 5,000 messages a day to Gmail or Outlook.com consumer addresses, you need all three. If you send less, they are still how a receiver tells your mail from a forgery.</p>
<p>This article explains what each record checks, where they commonly break, what Google and Microsoft require, and a rollout order that does not block your own mail. It is a research-based explainer: we did not send test mail through Gmail or Outlook.com, and where we could not confirm a detail from a primary source we say so.</p>
<h2 id="what-each-record-checks">What each record checks</h2>
<table>
  <thead>
      <tr>
          <th></th>
          <th>SPF</th>
          <th>DKIM</th>
          <th>DMARC</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Full name</td>
          <td>Sender Policy Framework</td>
          <td>DomainKeys Identified Mail</td>
          <td>Domain-based Message Authentication, Reporting and Conformance</td>
      </tr>
      <tr>
          <td>What it checks</td>
          <td>The connecting server&rsquo;s IP address against the domain&rsquo;s published list</td>
          <td>A cryptographic signature in a message header, checked against a public key in DNS</td>
          <td>That SPF or DKIM passed <strong>and</strong> that the passing domain aligns with the From domain</td>
      </tr>
      <tr>
          <td>Which domain</td>
          <td>The HELO name and the envelope sender (MAIL FROM) domain</td>
          <td>The domain in the signature&rsquo;s <code>d=</code> tag</td>
          <td>The domain in the visible From header</td>
      </tr>
      <tr>
          <td>DNS record</td>
          <td>TXT record at the domain</td>
          <td>TXT record at <code>&lt;selector&gt;._domainkey.&lt;domain&gt;</code></td>
          <td>TXT record at <code>_dmarc.&lt;domain&gt;</code></td>
      </tr>
      <tr>
          <td>Defined in</td>
          <td>RFC 7208 (April 2014)</td>
          <td>RFC 6376 (September 2011)</td>
          <td>RFC 9989 (May 2026), replacing RFC 7489 (March 2015)</td>
      </tr>
  </tbody>
</table>
<p>Two terms need defining. The <strong>envelope sender</strong> is the address given to the receiving mail server in the SMTP conversation, also called MAIL FROM or the reverse-path. It is not the same as the <strong>From header</strong> your mail client displays. RFC 7208 specifies that SPF verifiers check the HELO and MAIL FROM identities, and that checking other identities is not recommended. SPF on its own therefore says nothing about the From address a person reads, which is the gap DMARC closes.</p>
<h3 id="spf">SPF</h3>
<p>An SPF record lists who may send for a domain. A minimal example for a domain that sends through Google Workspace and one other provider:</p>
<pre tabindex="0"><code>example.com.  TXT  &#34;v=spf1 include:_spf.google.com include:mail.provider.example -all&#34;
</code></pre><p>The ending is a qualifier plus the <code>all</code> mechanism. RFC 7208 defines <code>+</code> (pass), <code>-</code> (fail), <code>~</code> (softfail) and <code>?</code> (neutral); with no qualifier, <code>+</code> is assumed. <code>-all</code> says anything not listed should fail. <code>~all</code> (softfail) is weaker. We did not verify how individual receivers treat the two when SPF is combined with DMARC, so do not assume they behave identically.</p>
<p>The constraint that surprises teams is the lookup limit. RFC 7208 section 4.6.4 says implementations must limit DNS-querying terms to 10 per evaluation. The <code>include</code>, <code>a</code>, <code>mx</code>, <code>ptr</code> and <code>exists</code> mechanisms and the <code>redirect</code> modifier count; <code>ip4</code>, <code>ip6</code> and <code>all</code> do not. Exceeding 10 produces a <code>permerror</code>. The same section says implementations should allow no more than two void lookups (queries returning an empty answer or NXDOMAIN) and also returns <code>permerror</code> past that. Each <code>include</code> can itself contain more terms that count, so a record with several marketing, support and billing vendors can pass review and still fail at evaluation. Count the terms after expanding every include.</p>
<h3 id="dkim">DKIM</h3>
<p>DKIM signs selected headers and the body of each message. The signing domain is named in the <code>d=</code> tag and the selector in the <code>s=</code> tag; RFC 6376 combines them to build the DNS name of the public key. Its example is <code>d=example.com</code> with <code>s=foo.bar</code>, which is looked up at <code>foo.bar._domainkey.example.com</code>. Selectors let one domain hold several keys at once, which is how you run separate keys for separate vendors and rotate them without downtime.</p>
<p>Because the signature travels inside the message, DKIM usually survives plain forwarding, whereas SPF is tied to the connecting IP address. That explains the standard advice to deploy both rather than choose one. We did not find, and do not claim, a figure for how often each method survives forwarding in practice.</p>
<h3 id="dmarc-and-alignment">DMARC and alignment</h3>
<p>A DMARC record is published at <code>_dmarc.&lt;domain&gt;</code>:</p>
<pre tabindex="0"><code>_dmarc.example.com.  TXT  &#34;v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com&#34;
</code></pre><p>RFC 7489 defines three policies in the <code>p</code> tag: <code>none</code> (no specific action requested), <code>quarantine</code> (treat failing mail as suspicious) and <code>reject</code> (reject failing mail, ideally during the SMTP transaction). The <code>sp</code> tag sets a different policy for subdomains and, if absent, <code>p</code> applies. The <code>rua</code> tag lists where to send aggregate reports; per RFC 7489, if <code>rua</code> is absent, no aggregate reports are generated.</p>
<p><strong>Alignment</strong> is the part that makes DMARC more than &ldquo;SPF or DKIM passed.&rdquo; RFC 7489 requires that the From domain match the domain that SPF or DKIM authenticated. In <em>relaxed</em> mode, the two only need the same Organizational Domain (for example <code>mail.example.com</code> aligns with <code>example.com</code>). In <em>strict</em> mode, only an exact match of the fully qualified domain names counts. The <code>aspf</code> and <code>adkim</code> tags choose the mode for SPF and DKIM separately and both default to relaxed.</p>
<p>This is why mail from a third-party platform can pass SPF yet fail DMARC. If the vendor sends with its own envelope sender domain, SPF passes for the vendor&rsquo;s domain, which does not align with your From domain. The fix is usually to have the vendor sign with a DKIM key under your domain, or to configure a custom return-path domain, so that at least one method passes <em>and</em> aligns.</p>
<h2 id="what-google-and-microsoft-require">What Google and Microsoft require</h2>
<p>Both providers state requirements for high-volume senders. The thresholds and scope are specific, so read them before assuming they apply to you.</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>Google (Gmail)</th>
          <th>Microsoft (Outlook.com)</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Who is covered</td>
          <td>Senders of more than 5,000 messages per day to Gmail accounts</td>
          <td>Domains sending more than 5,000 emails per day to Outlook.com consumer domains (hotmail.com, live.com, outlook.com)</td>
      </tr>
      <tr>
          <td>Effective</td>
          <td>February 1, 2024</td>
          <td>May 5, 2025</td>
      </tr>
      <tr>
          <td>SPF and DKIM</td>
          <td>Required for the sending domain</td>
          <td>SPF must pass; DKIM must pass</td>
      </tr>
      <tr>
          <td>DMARC</td>
          <td>Required; the enforcement policy &ldquo;can be set to none&rdquo;</td>
          <td>Policy of at least <code>p=none</code>, aligned with SPF or DKIM (both preferred)</td>
      </tr>
      <tr>
          <td>Alignment</td>
          <td>From domain must align with the SPF domain or the DKIM domain</td>
          <td>Same, per the announcement</td>
      </tr>
      <tr>
          <td>Other</td>
          <td>Spam rate in Postmaster Tools kept below 0.30%; TLS; valid forward and reverse DNS; one-click unsubscribe for marketing and subscribed messages</td>
          <td>Non-compliant mail is routed to Junk from May 5, 2025; Microsoft says rejection will follow on a date to be announced</td>
      </tr>
  </tbody>
</table>
<p>Two cautions on that table. First, Google&rsquo;s page also recommends keeping the spam rate below 0.10% and avoiding 0.30% or higher; the two figures are a recommendation and a threshold, not one rule. Second, for Microsoft we read the announcement published April 2, 2025 and updated April 30, 2025. It says rejected messages will carry the code <code>550; 5.7.515 Access denied, sending domain [SendingDomain] does not meet the required authentication level</code>, but we found no later official Microsoft statement giving a rejection date. Third-party sources disagree about whether and when rejection began, so we treat the date as unconfirmed. Planning to the stricter outcome costs little.</p>
<p>These rules apply by volume and recipient, not by who you are. A 200-message-per-day sender is outside the stated thresholds but still benefits from the same records, because the records are what stop other people using your domain.</p>
<h2 id="the-dmarc-update-rfc-9989">The DMARC update: RFC 9989</h2>
<p>In May 2026 the IETF published RFC 9989, which is on the Standards Track and obsoletes RFC 7489 (an Informational document published in March 2015) and RFC 9091. The reporting formats move to companion documents, RFC 9990 and RFC 9991. From the parts of RFC 9989 we read, the changes that affect a record are:</p>
<ul>
<li>The <code>pct</code> tag is replaced by a <code>t</code> tag for DMARC policy test mode.</li>
<li>An <code>np</code> tag sets the policy for non-existent subdomains.</li>
<li>A <code>psd</code> tag lets public suffix operators flag a Public Suffix Domain.</li>
<li>The Organizational Domain is no longer found using the Public Suffix List. A &ldquo;DNS Tree Walk&rdquo; with a limit of eight DNS queries replaces it.</li>
</ul>
<p>We could not read the whole document, including its &ldquo;Changes from RFC 7489&rdquo; appendix, so this is not a complete change list. We also did not test how Gmail, Outlook.com or other receivers treat the new tags. Until a receiver documents otherwise, keep <code>v=DMARC1</code> records that you have verified working, and change tags deliberately rather than all at once.</p>
<h2 id="a-rollout-order-that-does-not-block-your-own-mail">A rollout order that does not block your own mail</h2>
<ol>
<li><strong>Inventory senders.</strong> List every system that sends mail with your domain in the From address: corporate mail, marketing platform, help desk, billing, CRM, monitoring alerts, applications. The shadow senders are the usual cause of surprises.</li>
<li><strong>Publish DMARC at <code>p=none</code> with a <code>rua</code> address.</strong> This changes no delivery behavior and starts aggregate reports. Use a mailbox or reporting service that can parse them; the reports are XML.</li>
<li><strong>Fix alignment per sender.</strong> For each source in the reports, make DKIM sign with your domain or align the return-path. Check the SPF lookup count after each addition.</li>
<li><strong>Move to <code>quarantine</code>, then <code>reject</code>.</strong> Do it when reports show your legitimate sources aligned. Under RFC 7489 the <code>pct</code> tag can apply the policy to a share of mail while you gain confidence; under RFC 9989 the <code>t</code> test-mode tag takes that role, so confirm which your receivers honor.</li>
<li><strong>Set <code>sp</code> (and <code>np</code> if your receivers support it) deliberately</strong> so unused subdomains cannot be spoofed.</li>
<li><strong>Watch the reports continuously.</strong> New vendors appear without anyone telling security. Reports are how you learn about them before a customer does.</li>
</ol>
<p>Email authentication reduces spoofing of <em>your domain</em>. It does not detect phishing from lookalike domains, compromised legitimate accounts, or stolen sessions.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 10, 2026. We did not send test messages or inspect any live DNS records.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Google requirements for senders of more than 5,000 messages per day to Gmail accounts, effective February 1, 2024: SPF, DKIM, DMARC (policy may be none), alignment, spam rate below 0.30%, TLS, one-click unsubscribe, forward and reverse DNS</td>
          <td><a href="https://support.google.com/a/answer/81126">Google, Email sender guidelines</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Google recommends spam rate below 0.10% and avoiding 0.30% or higher</td>
          <td>Same page, monitoring section</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Outlook.com requirements for domains sending more than 5,000 emails per day: SPF, DKIM, DMARC at least p=none; effective May 5, 2025; Junk routing; later rejection date to be announced; 550 5.7.515 text</td>
          <td><a href="https://techcommunity.microsoft.com/blog/microsoftdefenderforoffice365blog/strengthening-email-ecosystem-outlooks-new-requirements-for-high%E2%80%90volume-senders/4399730">Microsoft, Strengthening email ecosystem: Outlook&rsquo;s new requirements for high-volume senders</a> (April 2, 2025, updated April 30, 2025)</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Whether Microsoft has begun rejecting non-compliant mail</td>
          <td>No later official statement found; third-party sources conflict</td>
          <td>Qualified: stated in the article as unconfirmed</td>
      </tr>
      <tr>
          <td>SPF checks HELO and MAIL FROM; 10 DNS-querying terms; which terms count; two void lookups; permerror; qualifiers</td>
          <td><a href="https://datatracker.ietf.org/doc/html/rfc7208">RFC 7208</a> (April 2014)</td>
          <td>Verified (sections 2, 4.6.4 and the qualifier text read; later sections not read)</td>
      </tr>
      <tr>
          <td>DKIM <code>d=</code> and <code>s=</code> tags and key lookup; Standards Track, September 2011</td>
          <td><a href="https://www.rfc-editor.org/rfc/rfc6376.html">RFC 6376</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>DMARC policy values, <code>sp</code>, <code>rua</code>, alignment modes, <code>aspf</code>/<code>adkim</code> defaults, <code>pct</code>; RFC 7489 is Informational, March 2015</td>
          <td><a href="https://datatracker.ietf.org/doc/html/rfc7489">RFC 7489</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>RFC 9989 is Standards Track, May 2026, obsoletes RFC 7489 and RFC 9091; pct replaced by t; np and psd added; DNS Tree Walk with eight-query limit; reporting in RFC 9990 and RFC 9991</td>
          <td><a href="https://www.rfc-editor.org/rfc/rfc9989.html">RFC 9989</a></td>
          <td>Qualified: first part of the document read; appendix of changes not read</td>
      </tr>
      <tr>
          <td>SPF is usually tied to the connecting IP and DKIM travels with the message</td>
          <td>Follows from the RFC 7208 and RFC 6376 definitions; no survey data cited</td>
          <td>Qualified: explanation, not a measured rate</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>What Is Token Theft and Why MFA Doesn't Always Stop It?</title><link>https://firewallsync.com/posts/what-is-token-theft-and-why-mfa-doesnt-always-stop-it/</link><guid>https://firewallsync.com/posts/what-is-token-theft-and-why-mfa-doesnt-always-stop-it/</guid><pubDate>Thu, 08 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>MFA verifies who's logging in, not who's still using the session afterward. Token theft attacks steal what MFA leaves behind: the authenticated session itself.</description><enclosure url="https://firewallsync.com/posts/what-is-token-theft-and-why-mfa-doesnt-always-stop-it/cover_hu12907188549560242146.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/what-is-token-theft-and-why-mfa-doesnt-always-stop-it/cover_hu12907188549560242146.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/what-is-token-theft-and-why-mfa-doesnt-always-stop-it/cover_hu12907188549560242146.jpg" alt="Padlock on a laptop with light trails" width="1200" height="630"></p><p>Multi-factor authentication verifies identity at the moment of login. It says nothing about what happens to the session afterward — and that gap is exactly what token theft attacks exploit. A user can enter their password, complete their MFA prompt correctly, and still hand an attacker full account access, because the thing worth stealing isn&rsquo;t the password or the MFA code anymore. It&rsquo;s the session token issued after both succeed.</p>
<h2 id="how-token-theft-actually-works">How token theft actually works</h2>
<p>The dominant technique is adversary-in-the-middle (AiTM) phishing, using open-source tooling such as Evilginx2, which Microsoft Threat Intelligence <a href="https://www.microsoft.com/en-us/security/blog/2022/07/12/from-cookie-theft-to-bec-attackers-use-aitm-phishing-sites-as-entry-point-to-further-financial-fraud/">documented in a July 12, 2022 report</a> on a campaign it said targeted more than 10,000 organizations from September 2021 and was followed by business email compromise fraud. The attacker doesn&rsquo;t build a fake login page — they proxy the real one. The victim lands on a domain that looks wrong on close inspection, but the page itself is the actual login flow, relayed through the attacker&rsquo;s server in real time.</p>
<p>The victim enters their real username and password, and completes MFA exactly as they normally would — push approval, OTP, whatever the org uses. The legitimate service verifies everything correctly and issues a session cookie or token, because as far as the identity provider is concerned, a real authentication just happened. The attacker&rsquo;s proxy captures that session token in transit before relaying the successful login back to the victim, who notices nothing wrong.</p>
<p>From that point, the attacker doesn&rsquo;t need the password or MFA again. They load the stolen session token directly into their own browser and are treated as an already-authenticated user — because they are one, technically, just not the one the identity provider thinks.</p>
<h2 id="why-traditional-mfa-doesnt-stop-this">Why traditional MFA doesn&rsquo;t stop this</h2>
<p>MFA that relies on a human relaying a value — typing an OTP, tapping &ldquo;approve&rdquo; on a push notification — is phishable by design, because nothing prevents that value from being captured and relayed through a proxy. The code or approval doesn&rsquo;t know which site it&rsquo;s being used on. Microsoft&rsquo;s report describes this as not being a flaw in MFA itself: the attacker obtains an authenticated session cookie, so access follows regardless of the sign-in method used. We have not verified how the technique behaves on specific platforms other than those in that report.</p>
<p>Phishing-resistant authentication (FIDO2/WebAuthn passkeys and security keys) closes this specific gap because the cryptographic challenge is bound to the actual domain — an AiTM proxy sitting on a different origin can&rsquo;t get a valid signed response out of it, even with a perfect visual clone of the login page. But phishing-resistant login doesn&rsquo;t retroactively protect a session token that&rsquo;s already been issued under older MFA methods, which is why detection matters as much as prevention. Microsoft&rsquo;s report recommends phish-resistant MFA (FIDO v2.0 and certificate-based) plus conditional access that evaluates signals such as device compliance and trusted IPs.</p>
<h2 id="what-detection-actually-needs-to-catch">What detection actually needs to catch</h2>
<p>Standard login monitoring looks for failed authentication attempts and unusual login locations. Token theft typically produces neither — the original login succeeded legitimately, and the attacker&rsquo;s subsequent access uses a valid token, not a new login attempt. What it does produce, if you&rsquo;re watching for it:</p>
<ul>
<li><strong>The same session token used from two meaningfully different locations or devices close together in time</strong> — not a new login, but continued use of an existing session from an inconsistent source</li>
<li><strong>Impossible travel on session activity, not just login events</strong> — a session that was active in one region and is suddenly active somewhere geographically implausible minutes later</li>
<li><strong>Anomalous behavior after a legitimate-looking login</strong> — mailbox rule changes, unusual OAuth app consent grants, or access patterns inconsistent with the user&rsquo;s normal activity, occurring shortly after a routine sign-in</li>
</ul>
<h2 id="what-actually-reduces-the-risk">What actually reduces the risk</h2>
<ul>
<li><strong>Shorten session and token lifetimes</strong> so a stolen token has a narrower window of usefulness before it expires and forces re-authentication</li>
<li><strong>Bind sessions to device and network signals</strong> where your identity provider supports it, so a token replayed from a different device or context gets challenged again rather than accepted silently</li>
<li><strong>Move toward phishing-resistant authentication</strong> for the accounts where a compromised session would matter most, since it removes the initial credential-and-code capture step the whole attack depends on</li>
<li><strong>Monitor session and token reuse patterns specifically</strong>, not just login failures — this is the signal that actually exists in this attack, and most detection stacks aren&rsquo;t tuned to look for it</li>
</ul>
<p>Token theft is a reminder that &ldquo;did MFA succeed&rdquo; and &ldquo;is this session legitimate right now&rdquo; are different questions. Most security programs have built strong controls around the first and comparatively little around the second, which is exactly the gap this attack class is built to walk through.</p>
]]></content:encoded></item><item><title>How to Secure OAuth Tokens in Production</title><link>https://firewallsync.com/posts/how-to-secure-oauth-tokens-in-production/</link><guid>https://firewallsync.com/posts/how-to-secure-oauth-tokens-in-production/</guid><pubDate>Wed, 07 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>Most OAuth implementations follow the happy-path tutorial and skip the parts of the spec that exist specifically to stop token theft. Here's what the current best practice actually requires.</description><enclosure url="https://firewallsync.com/posts/how-to-secure-oauth-tokens-in-production/cover_hu17483818409631058725.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/how-to-secure-oauth-tokens-in-production/cover_hu17483818409631058725.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/how-to-secure-oauth-tokens-in-production/cover_hu17483818409631058725.jpg" alt="Blurred laptop screen in a dark room showing JavaScript code in a code editor" width="1200" height="630"></p><p>Many OAuth implementations are built from a tutorial that gets the authorization flow working and stops there. The flow works, tokens get issued, and the implementation ships. What usually gets skipped is everything the specification&rsquo;s security guidance exists specifically to address: what happens when a token or authorization code is intercepted, replayed, or leaked.</p>
<p>The IETF (Internet Engineering Task Force) published <a href="https://www.rfc-editor.org/rfc/rfc9700.html">RFC 9700, &ldquo;Best Current Practice for OAuth 2.0 Security&rdquo;</a> (BCP 240), in January 2025, consolidating years of real-world attack patterns into concrete implementation guidance. It&rsquo;s worth treating as the actual checklist, not the original OAuth 2.0 RFCs from over a decade earlier. Where this article says &ldquo;must&rdquo; or &ldquo;should&rdquo;, it uses the RFC&rsquo;s own strength of wording, and says so when a point is general practice rather than something the RFC specifies.</p>
<h2 id="pkce-required-for-public-clients-recommended-for-everyone-else">PKCE: required for public clients, recommended for everyone else</h2>
<p>Proof Key for Code Exchange (PKCE, <a href="https://www.rfc-editor.org/rfc/rfc7636.html">RFC 7636</a>) was originally associated mainly with mobile and single-page apps that can&rsquo;t keep a client secret confidential (so-called public clients). RFC 9700 section 2.1.1 says public clients &ldquo;MUST use PKCE&rdquo; and that for confidential clients (such as server-side apps that can authenticate to the authorization server) its use is &ldquo;RECOMMENDED&rdquo;. PKCE protects against authorization code injection even when a client also holds a secret, so enabling it for backend clients too is a sensible hardening step. If your authorization server accepts a code exchange without a <code>code_verifier</code> for a public client, that is a gap to close now; for confidential clients, treat it as a gap worth closing, not a spec violation.</p>
<h2 id="avoid-the-implicit-grant">Avoid the implicit grant</h2>
<p>The implicit grant (<code>response_type=token</code>) returns access tokens directly in the URL fragment of the browser redirect, which exposes them to browser history, referrer headers and logging, as RFC 9700 describes in its discussion of token leakage. Section 2.1.2 says clients &ldquo;SHOULD NOT&rdquo; use it, or other response types that issue access tokens in the authorization response, unless access token injection is prevented and the leakage vectors are mitigated. The OAuth 2.1 specification omits the grant, but as of this writing OAuth 2.1 is still an IETF Internet-Draft (a work in progress), not a published standard. If any client in your stack still uses the implicit grant, plan a migration to the authorization code flow with PKCE.</p>
<h2 id="sender-constrained-tokens-change-what-stolen-means">Sender-constrained tokens change what &ldquo;stolen&rdquo; means</h2>
<p>A bearer token, which is what most implementations issue, is usable by anyone who has a copy of it — there&rsquo;s no check that the party presenting it is the party it was issued to. RFC 9700 says authorization and resource servers &ldquo;SHOULD&rdquo; use sender-constraining mechanisms, naming mutual TLS (<a href="https://www.rfc-editor.org/rfc/rfc8705.html">RFC 8705</a>) and DPoP, Demonstrating Proof of Possession (<a href="https://www.rfc-editor.org/rfc/rfc9449.html">RFC 9449</a>). Sender-constraining a token means binding it cryptographically to the client that requested it, so a token copied out of logs or intercepted in transit cannot be used without the client&rsquo;s private key. It doesn&rsquo;t stop leakage, but it reduces what a leaked token is worth, provided the attacker has not also stolen the key.</p>
<h2 id="refresh-token-rotation-and-what-to-do-when-reuse-is-detected">Refresh token rotation, and what to do when reuse is detected</h2>
<p>A refresh token that never changes is a long-lived credential wearing a short-lived token&rsquo;s reputation. Refresh token rotation means issuing a new refresh token with every refresh and invalidating the previous one. RFC 9700 (section 2.2.2) says refresh tokens issued to public clients &ldquo;MUST&rdquo; be either sender-constrained or rotated; confidential clients authenticate to the authorization server, which already limits replay. The part teams skip: what happens when a rotated-out refresh token gets used anyway. RFC 9700 (section 4.14.2) explains that this signals a breach, because either the attacker or the legitimate client is presenting an invalidated token. The authorization server cannot tell which party it is, so it revokes the active refresh token. Revoking everything issued under the same authorization grant, and forcing the user to reauthenticate, is the natural implementation of that, but it is our interpretation rather than explicit RFC wording.</p>
<h2 id="where-tokens-actually-leak-in-practice">Where tokens actually leak in practice</h2>
<p>Beyond the protocol-level attacks the RFC addresses, tokens can leak through mundane paths: logged in application or proxy logs, cached in browser storage longer than intended, or sent to a resource server over a redirect chain that includes a third-party domain. As general practice (not a requirement we verified in RFC 9700), audit logging configuration specifically for token values, redact them by default rather than relying on stripping them per log line, and keep access token lifetimes short so a leaked token has a narrow window of usefulness. What counts as &ldquo;short&rdquo; depends on your risk tolerance; there is no single figure that fits every system.</p>
<h2 id="a-practical-checklist">A practical checklist</h2>
<ul>
<li>PKCE enforced for every public client (required by RFC 9700) and enabled for confidential clients (recommended)</li>
<li>No implicit grant unless token injection and leakage are demonstrably mitigated; migrate remaining usage</li>
<li>Refresh tokens for public clients rotated on every use or sender-constrained, with reuse of an old token treated as a compromise signal</li>
<li>Sender-constrained tokens (DPoP or mTLS) where the resource server supports it</li>
<li>Access token lifetimes short enough to limit blast radius from an undetected leak</li>
<li>Logging configuration audited to confirm tokens are redacted, not just assumed to be</li>
</ul>
<p>None of this replaces basic hygiene — scoping tokens to the minimum permissions they need, and treating a leaked token with broad scope as a bigger incident than one scoped narrowly. The protocol-level protections reduce the chance of theft and what a stolen token is worth; they don&rsquo;t remove the need to limit what any single token can do in the first place.</p>
]]></content:encoded></item><item><title>CSRF Protection: SameSite Cookies, Tokens and Fetch Metadata Compared</title><link>https://firewallsync.com/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/</link><guid>https://firewallsync.com/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/</guid><pubDate>Wed, 07 Oct 2026 08:35:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>SameSite cookies reduce cross-site request forgery but do not end it. Here is what each defense stops, where each one fails, and a header check you can add in a few lines.</description><enclosure url="https://firewallsync.com/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/cover_hu11107870620667495162.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/cover_hu11107870620667495162.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/csrf-protection-samesite-cookies-tokens-and-fetch-metadata-compared/cover_hu11107870620667495162.jpg" alt="Laptop on a desk showing code in an editor" width="1200" height="630"></p><p>Cross-site request forgery (CSRF) is still possible in 2026, but the defaults have moved in your favor. If your session cookie is explicitly set to <code>SameSite=Lax</code> or <code>Strict</code>, every state-changing endpoint uses POST or another non-GET method, and you reject requests the browser labels as cross-origin, the classic attack is closed. Each of those three conditions is one that real applications miss, so this article goes through what each defense stops and where it fails.</p>
<h2 id="what-the-attack-needs">What the attack needs</h2>
<p>A CSRF attack has three ingredients: a victim logged in to your site, a browser that attaches the victim&rsquo;s cookies to requests automatically, and a request that an attacker&rsquo;s page can make the browser send. The attacker&rsquo;s page never sees the response. It only needs the side effect: an email address changed, a transfer submitted, an API key created.</p>
<p>Every defense below works by breaking one of the last two ingredients. Either the cookie is not attached, or the server can tell the request did not come from its own pages.</p>
<h2 id="the-four-defenses-compared">The four defenses compared</h2>
<table>
  <thead>
      <tr>
          <th></th>
          <th>SameSite cookies</th>
          <th>CSRF token</th>
          <th>Fetch Metadata check</th>
          <th>Custom header requirement</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Where it runs</td>
          <td>Browser decides whether to send the cookie</td>
          <td>Server compares a secret value</td>
          <td>Server reads <code>Sec-Fetch-Site</code></td>
          <td>Server requires a header a plain form cannot send</td>
      </tr>
      <tr>
          <td>What you change</td>
          <td>One cookie attribute</td>
          <td>Every form and state-changing request</td>
          <td>One middleware</td>
          <td>Client code and one server check</td>
      </tr>
      <tr>
          <td>Granularity</td>
          <td>Site (registrable domain plus scheme)</td>
          <td>Session</td>
          <td>Origin or site, your choice</td>
          <td>Origin, enforced by CORS</td>
      </tr>
      <tr>
          <td>Protects GET endpoints that change state</td>
          <td>No, with Lax</td>
          <td>Only if you check tokens on GET</td>
          <td>Only if you check GET</td>
          <td>Only if required on GET</td>
      </tr>
      <tr>
          <td>Stops a sibling subdomain</td>
          <td>No</td>
          <td>Yes, if tied to the session</td>
          <td>Yes, if you reject <code>same-site</code></td>
          <td>Yes, unless CORS allows that origin</td>
      </tr>
      <tr>
          <td>Works without browser support</td>
          <td>No</td>
          <td>Yes</td>
          <td>No, needs a fallback</td>
          <td>Yes</td>
      </tr>
      <tr>
          <td>Server state needed</td>
          <td>None</td>
          <td>Session, or a signing key</td>
          <td>None</td>
          <td>None</td>
      </tr>
  </tbody>
</table>
<p>&ldquo;Site&rdquo; and &ldquo;origin&rdquo; are different things, and the gap between them is where several bypasses live. An origin is the scheme, host and port together: <code>https://app.example.com</code>. A site is the scheme plus the registrable domain: <code>https://example.com</code>. Two subdomains of one company are different origins on the same site.</p>
<h2 id="samesite-what-it-does-and-the-three-gaps">SameSite: what it does and the three gaps</h2>
<p>MDN describes the three values of the cookie&rsquo;s <code>SameSite</code> attribute:</p>
<ul>
<li><strong>Strict</strong> sends the cookie only for requests originating from the same site.</li>
<li><strong>Lax</strong> also sends it on cross-site requests that are top-level navigations using a safe method. In practice that means following a link, not submitting a cross-site POST form.</li>
<li><strong>None</strong> sends it everywhere, and requires the <code>Secure</code> attribute.</li>
</ul>
<p>For a session cookie, <code>Lax</code> means an attacker&rsquo;s page can no longer submit a hidden POST form with your user&rsquo;s session attached. That removes the textbook attack. Three gaps remain.</p>
<p><strong>Gap 1: GET requests that change state.</strong> <code>Lax</code> deliberately allows cookies on cross-site top-level GET navigations, so that links to your site work for logged-in users. If <code>/account/delete?confirm=1</code> works as a GET, a link is enough. OWASP&rsquo;s cheat sheet is blunt about the fix: never use GET for state changes.</p>
<p><strong>Gap 2: the default is weaker than the explicit setting.</strong> Some browsers apply <code>Lax</code> when a cookie has no <code>SameSite</code> attribute at all. MDN notes that &ldquo;when <code>Lax</code> is applied as a default, a more permissive version is used&rdquo;, in which cookies are also sent on cross-site POST requests &ldquo;as long as they were set no more than two minutes before the request was made.&rdquo; That means a cookie issued moments ago, for example right after login, is exposed. Browsers also differ on whether they apply the default at all. The fix costs one attribute: set <code>SameSite=Lax</code> or <code>Strict</code> explicitly.</p>
<p><strong>Gap 3: same-site is not same-origin.</strong> <code>SameSite</code> compares sites. A request from <code>https://blog.example.com</code> to <code>https://app.example.com</code> is same-site, so the cookie is sent whatever the setting. If any subdomain can run attacker-controlled script, through an abandoned DNS record, a user-content host or a cross-site scripting flaw in a marketing page, <code>SameSite</code> gives no protection against it. OWASP lists this registrable-domain behavior among the reasons it treats <code>SameSite</code> as defense in depth and not a standalone defense.</p>
<h2 id="csrf-tokens-still-the-reference-defense">CSRF tokens: still the reference defense</h2>
<p>A CSRF token is a secret value the server gives its own pages and expects back on state-changing requests. An attacker&rsquo;s page cannot read it, so it cannot include it.</p>
<p>OWASP&rsquo;s cheat sheet describes two patterns:</p>
<ul>
<li><strong>Synchronizer token.</strong> The server stores a random token in the user&rsquo;s session and compares it on each protected request. It should be sent in a hidden form field or a custom header, not in a cookie or URL.</li>
<li><strong>Signed double-submit cookie.</strong> For applications without server-side session storage. The token is an HMAC (a keyed hash) computed over the session identifier plus a random value, sent both as a cookie and in the request. OWASP recommends this signed form and warns that the naive version, a bare random value in a cookie compared with a request field, can be defeated by an attacker who is able to set cookies from a subdomain.</li>
</ul>
<p>OWASP&rsquo;s ordering of advice is: use your framework&rsquo;s built-in CSRF protection if it has one; otherwise add tokens to state-changing requests and validate them on the server; consider Fetch Metadata headers with a fallback; then add defense-in-depth measures such as <code>SameSite</code>.</p>
<p>Tokens cost more to maintain than the alternatives. Every form, every JavaScript request and every cached page has to carry the right token, and &ldquo;invalid CSRF token&rdquo; errors after a session expires are a familiar support ticket. That maintenance cost is why the header-based approach below has gained ground. This is our assessment of the trade-off, not OWASP&rsquo;s wording.</p>
<h2 id="fetch-metadata-let-the-browser-tell-you">Fetch Metadata: let the browser tell you</h2>
<p>Browsers attach a set of <code>Sec-Fetch-*</code> headers to requests. The one that matters here is <code>Sec-Fetch-Site</code>, which MDN defines as indicating &ldquo;the relationship between a request initiator&rsquo;s origin and the origin of the requested resource.&rdquo; Its values:</p>
<table>
  <thead>
      <tr>
          <th>Value</th>
          <th>Meaning</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td><code>same-origin</code></td>
          <td>The page making the request has the same scheme, host and port as the server</td>
      </tr>
      <tr>
          <td><code>same-site</code></td>
          <td>Same site, different origin, for example another subdomain</td>
      </tr>
      <tr>
          <td><code>cross-site</code></td>
          <td>A different site</td>
      </tr>
      <tr>
          <td><code>none</code></td>
          <td>A user-initiated action, such as typing a URL or opening a bookmark</td>
      </tr>
  </tbody>
</table>
<p>Two properties make it usable as a security control. It is a forbidden request header, so page JavaScript cannot set or alter it. And MDN lists it as available across browsers since March 2023.</p>
<p>One limit matters: MDN notes the header is only sent to potentially trustworthy URLs, which in practice means HTTPS. Over plain HTTP it is absent.</p>
<p>The check itself is short: for any request that is not GET, HEAD or OPTIONS, reject it unless <code>Sec-Fetch-Site</code> is <code>same-origin</code> or <code>none</code>.</p>
<h3 id="what-gos-standard-library-does">What Go&rsquo;s standard library does</h3>
<p>Go 1.25, released in August 2025, added <code>net/http.CrossOriginProtection</code>. The release notes describe it as rejecting &ldquo;non-safe cross-origin browser requests&rdquo; using Fetch metadata, and say it &ldquo;doesn&rsquo;t require tokens or cookies&rdquo;. Its logic, as we read the Go 1.25 source, is a useful reference whatever language you use:</p>
<ol>
<li>GET, HEAD and OPTIONS are always allowed.</li>
<li>If <code>Sec-Fetch-Site</code> is present, the request is allowed only when the value is <code>same-origin</code> or <code>none</code>.</li>
<li>If <code>Sec-Fetch-Site</code> is absent but <code>Origin</code> is present, the <code>Origin</code> host is compared with the <code>Host</code> header, and the request is allowed if they match.</li>
<li>If neither header is present, the request is allowed, on the reasoning that it is either same-origin or not from a browser.</li>
<li>Explicitly trusted origins and bypass patterns are exempt.</li>
</ol>
<p>Notice that step 2 rejects <code>same-site</code>. That closes Gap 3: a sibling subdomain is treated as untrusted unless you list it. Google&rsquo;s older web.dev guidance on Fetch Metadata, published in June 2020, allows <code>same-site</code> in its example policy. Which is right for you depends on whether you trust everything hosted under your domain. If you are unsure, reject <code>same-site</code> and add specific origins back.</p>
<h3 id="a-working-example-in-python">A working example in Python</h3>
<p>The same logic as a Flask <code>before_request</code> hook. We ran this with Flask 3.1 on Python 3.13; it is a minimal illustration, not a drop-in library.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> urllib.parse <span style="color:#f92672">import</span> urlsplit
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> flask <span style="color:#f92672">import</span> Flask, abort, request
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>app <span style="color:#f92672">=</span> Flask(__name__)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>SAFE_METHODS <span style="color:#f92672">=</span> {<span style="color:#e6db74">&#34;GET&#34;</span>, <span style="color:#e6db74">&#34;HEAD&#34;</span>, <span style="color:#e6db74">&#34;OPTIONS&#34;</span>}
</span></span><span style="display:flex;"><span><span style="color:#75715e"># Origins other than our own that may send state-changing requests, e.g. a separate admin UI.</span>
</span></span><span style="display:flex;"><span>TRUSTED_ORIGINS <span style="color:#f92672">=</span> {<span style="color:#e6db74">&#34;https://admin.example.com&#34;</span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">is_cross_origin</span>(req) <span style="color:#f92672">-&gt;</span> bool:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;True when a browser tells us the request came from another origin.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> req<span style="color:#f92672">.</span>headers<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;Origin&#34;</span>) <span style="color:#f92672">in</span> TRUSTED_ORIGINS:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">False</span>
</span></span><span style="display:flex;"><span>    site <span style="color:#f92672">=</span> req<span style="color:#f92672">.</span>headers<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;Sec-Fetch-Site&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> site <span style="color:#f92672">is</span> <span style="color:#f92672">not</span> <span style="color:#66d9ef">None</span>:
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># same-origin: our own pages. none: typed URL or bookmark.</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> site <span style="color:#f92672">not</span> <span style="color:#f92672">in</span> (<span style="color:#e6db74">&#34;same-origin&#34;</span>, <span style="color:#e6db74">&#34;none&#34;</span>)
</span></span><span style="display:flex;"><span>    origin <span style="color:#f92672">=</span> req<span style="color:#f92672">.</span>headers<span style="color:#f92672">.</span>get(<span style="color:#e6db74">&#34;Origin&#34;</span>)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> origin <span style="color:#f92672">is</span> <span style="color:#66d9ef">None</span>:
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># Neither header: not a current browser (curl, server-to-server).</span>
</span></span><span style="display:flex;"><span>        <span style="color:#75715e"># CSRF needs a browser that attaches the victim&#39;s cookies.</span>
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">False</span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e"># Older browser: compare the Origin host with the Host we were addressed as.</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> urlsplit(origin)<span style="color:#f92672">.</span>netloc <span style="color:#f92672">!=</span> req<span style="color:#f92672">.</span>host
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">@app.before_request</span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">reject_cross_origin_writes</span>():
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> request<span style="color:#f92672">.</span>method <span style="color:#f92672">in</span> SAFE_METHODS:
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> is_cross_origin(request):
</span></span><span style="display:flex;"><span>        abort(<span style="color:#ae81ff">403</span>, <span style="color:#e6db74">&#34;cross-origin request rejected&#34;</span>)
</span></span></code></pre></div><p>We tested it with Flask&rsquo;s test client against a POST route and a GET route:</p>
<table>
  <thead>
      <tr>
          <th>Request</th>
          <th>Headers sent</th>
          <th>Result</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>POST from the application&rsquo;s own page</td>
          <td><code>Sec-Fetch-Site: same-origin</code></td>
          <td>200</td>
      </tr>
      <tr>
          <td>POST from another site</td>
          <td><code>Sec-Fetch-Site: cross-site</code></td>
          <td>403</td>
      </tr>
      <tr>
          <td>POST from a sibling subdomain</td>
          <td><code>Sec-Fetch-Site: same-site</code></td>
          <td>403</td>
      </tr>
      <tr>
          <td>POST from the listed admin origin</td>
          <td><code>Sec-Fetch-Site: same-site</code>, trusted <code>Origin</code></td>
          <td>200</td>
      </tr>
      <tr>
          <td>POST with no <code>Sec-Fetch-Site</code>, matching <code>Origin</code></td>
          <td><code>Origin</code> equals host</td>
          <td>200</td>
      </tr>
      <tr>
          <td>POST with no <code>Sec-Fetch-Site</code>, foreign <code>Origin</code></td>
          <td><code>Origin</code> differs</td>
          <td>403</td>
      </tr>
      <tr>
          <td>POST with no <code>Sec-Fetch-Site</code>, <code>Origin: null</code></td>
          <td>Sandboxed or opaque origin</td>
          <td>403</td>
      </tr>
      <tr>
          <td>POST with neither header</td>
          <td>As sent by curl</td>
          <td>200</td>
      </tr>
      <tr>
          <td>GET from another site</td>
          <td><code>Sec-Fetch-Site: cross-site</code></td>
          <td>200</td>
      </tr>
  </tbody>
</table>
<p>The last two rows are the limits, and they are deliberate:</p>
<ul>
<li><strong>Requests with neither header pass.</strong> A command-line client or another server does not carry a victim&rsquo;s browser cookies, so there is nothing to forge. This does mean the check is not an authentication or anti-automation control.</li>
<li><strong>GET is not checked.</strong> The hook protects nothing if a GET route changes state.</li>
<li><strong>The <code>Host</code> comparison trusts your proxy setup.</strong> Behind a reverse proxy, the application must see the hostname the browser used. OWASP&rsquo;s cheat sheet advises accepting a forwarded host header only from proxies you control.</li>
<li><strong>Plain HTTP gets the weaker path.</strong> Without HTTPS the browser omits <code>Sec-Fetch-Site</code> and the check falls back to <code>Origin</code>.</li>
</ul>
<h2 id="what-none-of-these-stop">What none of these stop</h2>
<p><strong>Cross-site scripting.</strong> OWASP states that cross-site scripting (XSS) vulnerabilities can bypass CSRF protections. Script running in your own origin sends requests that are genuinely same-origin, can read tokens from the page, and gets the right <code>Sec-Fetch-Site</code> value. CSRF defenses assume your own pages are not hostile.</p>
<p><strong>Client-side CSRF.</strong> OWASP describes a variant where your own JavaScript builds a request from attacker-influenced input, such as a URL fragment. The request is same-origin and carries a valid token, so server-side checks pass. The fix is validating what the script uses to build requests.</p>
<p><strong>Login CSRF.</strong> An attacker can submit a login form with their own credentials, leaving the victim signed in to the attacker&rsquo;s account. OWASP recommends protecting login forms too, using a pre-session, and regenerating the session after authentication.</p>
<h2 id="what-to-do">What to do</h2>
<p>This table is our recommendation, built on the sources above.</p>
<table>
  <thead>
      <tr>
          <th>Your situation</th>
          <th>Recommended setup</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Framework with built-in CSRF protection (for example Django, Rails, ASP.NET)</td>
          <td>Leave it on. Set the session cookie&rsquo;s <code>SameSite</code> explicitly. Audit for GET routes that change state</td>
      </tr>
      <tr>
          <td>Go 1.25 or later</td>
          <td>Wrap handlers with <code>http.CrossOriginProtection</code>; list trusted origins explicitly</td>
      </tr>
      <tr>
          <td>No built-in protection, HTTPS everywhere</td>
          <td>Add the Fetch Metadata check with the <code>Origin</code> fallback; set <code>SameSite=Lax</code> or <code>Strict</code>; keep or add tokens on the highest-risk actions</td>
      </tr>
      <tr>
          <td>Cookie-authenticated JSON API</td>
          <td>The Fetch Metadata check, plus rejecting state-changing requests that are not <code>application/json</code>, plus a restrictive CORS policy that never combines a wildcard origin with credentials</td>
      </tr>
      <tr>
          <td>Token-only API (<code>Authorization</code> header, no cookies)</td>
          <td>Classic CSRF does not apply. Confirm no cookie-based path exists</td>
      </tr>
      <tr>
          <td>Untrusted or user-controlled subdomains</td>
          <td>Treat <code>same-site</code> as cross-site everywhere; do not rely on <code>SameSite</code> cookies</td>
      </tr>
  </tbody>
</table>
<p>Three checks apply in every row:</p>
<ol>
<li>Search your routes for GET handlers with side effects and convert them.</li>
<li>Set <code>SameSite</code> explicitly on session cookies, with <code>Secure</code> and <code>HttpOnly</code>.</li>
<li>Fix XSS first. It defeats everything on this page.</li>
</ol>
<p>The session cookie being protected here is the same one an attacker wants to steal outright. For the token side of that problem, see <a href="/posts/how-to-secure-oauth-tokens-in-production/">how to secure OAuth tokens in production</a>, and for the credentials behind the session, <a href="/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/">password hashing parameters</a>. If you arrived looking for the server-side attack with the similar name, that is <a href="/posts/ssrf-explained-how-server-side-request-forgery-works-and-how-to-prevent-it/">SSRF, explained here</a>.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 7, 2026. Browser behavior changes between releases, so confirm the SameSite defaults for the browsers you support against MDN&rsquo;s compatibility data. We tested the Python example with Flask&rsquo;s test client, not in real browsers.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>SameSite Strict, Lax and None definitions; None requires Secure; default-Lax two-minute POST allowance</td>
          <td><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Set-Cookie">MDN, Set-Cookie</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Sec-Fetch-Site values; forbidden request header; available across browsers since March 2023; sent only to potentially trustworthy URLs</td>
          <td><a href="https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Sec-Fetch-Site">MDN, Sec-Fetch-Site</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>OWASP ordering of defenses; synchronizer and signed double-submit patterns; SameSite as defense in depth; never use GET for state changes; XSS bypasses CSRF protections; client-side and login CSRF</td>
          <td><a href="https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html">OWASP CSRF Prevention Cheat Sheet</a>, as published October 7, 2026</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Go 1.25 added CrossOriginProtection; released August 2025</td>
          <td><a href="https://go.dev/doc/go1.25">Go 1.25 release notes</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>CrossOriginProtection logic (safe methods, Sec-Fetch-Site, Origin and Host fallback, neither header allowed)</td>
          <td><a href="https://github.com/golang/go/blob/release-branch.go1.25/src/net/http/csrf.go">Go 1.25 source, net/http/csrf.go</a></td>
          <td>Verified: our reading of the source</td>
      </tr>
      <tr>
          <td>web.dev example policy allows same-site</td>
          <td><a href="https://web.dev/articles/fetch-metadata">web.dev, Protect your resources from web attacks with Fetch Metadata</a>, June 4, 2020</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Python example behavior in the results table</td>
          <td>Run in our build environment with Flask 3.1 on Python 3.13</td>
          <td>Verified: test client only, not real browsers</td>
      </tr>
      <tr>
          <td>Browsers differ on applying Lax by default</td>
          <td>MDN compatibility notes for Set-Cookie</td>
          <td>Qualified: we did not list per-browser behavior</td>
      </tr>
      <tr>
          <td>Framework examples with built-in CSRF protection</td>
          <td>General knowledge of Django, Rails and ASP.NET; OWASP names .NET and Go 1.25</td>
          <td>Qualified: check your framework&rsquo;s documentation</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Passkeys vs Passwords: What Actually Changes for Security Teams?</title><link>https://firewallsync.com/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/</link><guid>https://firewallsync.com/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/</guid><pubDate>Tue, 06 Oct 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>Passkeys aren't just a more convenient password. They remove an entire attack category at the protocol level, but only if recovery and enrollment are governed correctly.</description><enclosure url="https://firewallsync.com/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/cover_hu5782018246401639556.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/cover_hu5782018246401639556.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/cover_hu5782018246401639556.jpg" alt="Smartphone showing a security lock icon on a desk" width="1200" height="630"></p><p>Passwords and passkeys get compared as if they&rsquo;re two options on the same axis, usually framed as &ldquo;convenience versus security.&rdquo; That framing undersells what actually changes. A password is a shared secret: both the user and the server know a value derived from it, and anything either party can be tricked into revealing can be replayed. A passkey, built on the FIDO2/WebAuthn standard, removes the shared secret entirely and replaces it with a public-private key pair, where the private key never leaves the user&rsquo;s device.</p>
<h2 id="why-this-isnt-just-a-stronger-password">Why this isn&rsquo;t just &ldquo;a stronger password&rdquo;</h2>
<p>The practical difference shows up during a phishing attempt. A password (or a one-time code from SMS or an authenticator app) can be typed into a convincing fake login page, and the attacker relays it to the real site in real time — this is how adversary-in-the-middle phishing kits defeat traditional MFA. A passkey can&rsquo;t be phished this way, because the cryptographic challenge generated during login is bound to the actual origin (the domain) the browser is talking to. If a user lands on a lookalike domain, the browser and authenticator simply won&rsquo;t produce a valid signed assertion for it — there&rsquo;s no code or value for the user to accidentally hand over, because nothing reusable is ever transmitted.</p>
<p>This is why NIST&rsquo;s SP 800-63B digital identity guidelines specifically describe WebAuthn as phishing-resistant through this verifier-origin binding, rather than relying on the user noticing something looks wrong.</p>
<h2 id="where-the-protection-actually-breaks">Where the protection actually breaks</h2>
<p>Passkeys only preserve this property end to end. Two places commonly undo it:</p>
<p><strong>Recovery paths.</strong> If losing a passkey means falling back to an email link or an SMS code to regain access, the account&rsquo;s real security level is whatever that fallback provides, not what the passkey provides. Attackers target the weakest link in the chain, and a phishing-resistant primary factor with a phishable recovery path is still a phishable account.</p>
<p><strong>Enrollment.</strong> A passkey is only as trustworthy as the process that registered it. If an attacker can register their own passkey on a compromised account (through a stolen session, a support-desk social engineering call, or a weak initial verification step), the passkey itself does nothing to stop them going forward — it just becomes their credential now, not the legitimate user&rsquo;s.</p>
<h2 id="what-actually-changes-operationally-for-a-security-team">What actually changes operationally for a security team</h2>
<ul>
<li><strong>Help desk load shifts, it doesn&rsquo;t disappear.</strong> Password resets get replaced by device-loss and recovery-flow support requests. If your recovery flow is weak, this becomes a new social-engineering target rather than a solved problem.</li>
<li><strong>Device and platform coverage matters.</strong> Passkeys sync differently across Apple, Google, and Microsoft ecosystems, and cross-platform sync behavior affects how you think about account recovery and device offboarding when someone leaves.</li>
<li><strong>Not every login surface supports it yet.</strong> Legacy internal tools, some enterprise SaaS admin panels, and API-based service accounts often can&rsquo;t use WebAuthn at all, so passkeys typically roll out unevenly across an org&rsquo;s actual login surface rather than replacing passwords everywhere at once.</li>
<li><strong>It doesn&rsquo;t replace authorization controls.</strong> A phishing-resistant login says nothing about what that authenticated session can then do — least-privilege access control still matters exactly as much after passkeys as before.</li>
</ul>
<h2 id="rollout-priority-not-rollout-completeness">Rollout priority, not rollout completeness</h2>
<p>Given uneven support, the highest-value place to start is the accounts where phishing has the most consequence: administrators, finance roles, and anyone with standing access to sensitive systems — not a company-wide simultaneous cutover. Pair the rollout with hardening the recovery path (no email or SMS fallback for high-privilege accounts) and verifying enrollment requires strong initial proof of identity. Without both of those, you&rsquo;ve changed the login screen without actually closing the attack path it was meant to close.</p>
]]></content:encoded></item><item><title>ZITADEL Account-Takeover Flaws CVE-2026-105207, -105209 and -105215: Fixed Versions and What to Check</title><link>https://firewallsync.com/posts/zitadel-account-takeover-cve-2026-105207-cve-2026-105209-cve-2026-105215-fixed-versions/</link><guid>https://firewallsync.com/posts/zitadel-account-takeover-cve-2026-105207-cve-2026-105209-cve-2026-105215-fixed-versions/</guid><pubDate>Tue, 06 Oct 2026 06:35:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>Three critical ZITADEL flaws let attackers take over accounts through external identity provider linking, passkey enrollment and forged login callbacks. Fixes shipped between July and September 2026, but the CVE records only appeared on October 4, and ZITADEL 3.x has no fix for the worst one.</description><enclosure url="https://firewallsync.com/posts/zitadel-account-takeover-cve-2026-105207-cve-2026-105209-cve-2026-105215-fixed-versions/cover_hu14719302590193262893.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/zitadel-account-takeover-cve-2026-105207-cve-2026-105209-cve-2026-105215-fixed-versions/cover_hu14719302590193262893.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/zitadel-account-takeover-cve-2026-105207-cve-2026-105209-cve-2026-105215-fixed-versions/cover_hu14719302590193262893.jpg" alt="Account settings screen showing a verification prompt" width="1200" height="630"></p><p>If you run ZITADEL, the open-source identity platform, check the version number today. Three critical flaws, each of which lets an attacker take over someone else&rsquo;s account, were fixed in releases between mid-July and early September 2026, but their CVE records were published on October 4, 2026. Anything older than 4.17.3 is affected by at least one of them, and ZITADEL 3.x has no fix for the most serious one.</p>
<p>This article lays out which versions are affected by each flaw, what each requires from an attacker, and which questions to ask of your own logs. It is based on ZITADEL&rsquo;s GitHub security advisories and the CVE records; we did not install ZITADEL or test any of the flaws.</p>
<h2 id="the-three-flaws">The three flaws</h2>
<p>All three are authorization or verification failures around how an account gets tied to a login method. The details come from ZITADEL&rsquo;s advisories, and the dates and CVSS 4.0 scores from the CVE records, which were published by VulnCheck, acting as CVE Numbering Authority (the organization authorized to issue the CVE IDs).</p>
<table>
  <thead>
      <tr>
          <th></th>
          <th>CVE-2026-105207</th>
          <th>CVE-2026-105209</th>
          <th>CVE-2026-105215</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Advisory</td>
          <td>GHSA-g8gj-gq47-xgf4</td>
          <td>GHSA-pq2q-2c6r-75c4</td>
          <td>GHSA-738m-7888-jfv8</td>
      </tr>
      <tr>
          <td>Flaw</td>
          <td>External identity provider (IdP) links are created without verifying a primary factor or the caller&rsquo;s permission</td>
          <td>Passkey or passwordless enrollment codes are issued after checking only the organization named in a request header, not the target user&rsquo;s organization</td>
          <td>Login V1&rsquo;s &ldquo;external account not found&rdquo; registration endpoint trusts client-supplied identity fields without a completed IdP callback</td>
      </tr>
      <tr>
          <td>Result</td>
          <td>Account takeover</td>
          <td>Account takeover across organizations</td>
          <td>Account pre-hijacking</td>
      </tr>
      <tr>
          <td>What the attacker needs</td>
          <td>The victim&rsquo;s login name; no account, no interaction</td>
          <td>User-write permission in any one organization on the same instance</td>
          <td>The victim&rsquo;s external user ID, known or predictable; the victim must later sign in with that IdP</td>
      </tr>
      <tr>
          <td>Affected versions</td>
          <td>4.0.0 to 4.17.2; 3.0.0 to 3.4.15</td>
          <td>4.0.0 to 4.17.0; 3.0.0 to 3.4.14</td>
          <td>4.0.0 to 4.16.1; 3.0.0 to 3.4.13</td>
      </tr>
      <tr>
          <td>Fixed in</td>
          <td>4.17.3 and later; no 3.x fix</td>
          <td>4.17.1 and later; 3.4.15 and later</td>
          <td>4.16.2 and later; 3.4.14 and later</td>
      </tr>
      <tr>
          <td>Login UI affected</td>
          <td>Login V2 and the User Service V2 API; Login V1 unaffected</td>
          <td>Not described as specific to one login UI; concerns issuing enrollment codes</td>
          <td>Login V1 only; Login V2 unaffected</td>
      </tr>
      <tr>
          <td>Advisory score</td>
          <td>9.8 Critical</td>
          <td>9.6 Critical</td>
          <td>9.1 Critical</td>
      </tr>
      <tr>
          <td>CVSS 4.0 score in CVE record</td>
          <td>9.3</td>
          <td>9.3</td>
          <td>9.3</td>
      </tr>
      <tr>
          <td>CVE record published</td>
          <td>October 4, 2026</td>
          <td>October 4, 2026</td>
          <td>October 4, 2026</td>
      </tr>
  </tbody>
</table>
<p>An IdP (identity provider) is an external service such as a company directory or social login that vouches for a user&rsquo;s identity. A passkey is a phishing-resistant sign-in credential bound to a device, covered in our comparison of <a href="/posts/passkeys-vs-passwords-what-actually-changes-for-security-teams/">passkeys and passwords</a>.</p>
<h3 id="what-each-one-means-in-practice">What each one means in practice</h3>
<p><strong>CVE-2026-105207 is the broadest.</strong> ZITADEL&rsquo;s advisory says an attacker who knows only a victim&rsquo;s login name can bind their own external identity to the victim&rsquo;s account through the Login V2 identify-only session, then sign in as the victim. The same weakness is reachable through the API endpoint that adds IdP links, so changing the login screen does not close it. The advisory says it needs no authentication, no privileges and no user interaction. If your instance allows external IdP sign-in at all, treat this as the priority.</p>
<p><strong>CVE-2026-105209 matters most for multi-tenant setups.</strong> If you use separate ZITADEL organizations for separate customers or business units on one instance, an administrator in one organization could obtain an enrollment code for a user in another and register their own authenticator. The attacker needs a legitimate foothold first, so for a single-organization company the realistic threat is an insider or a compromised administrator account. For a service that gives each customer an organization, a customer administrator is a possible attacker.</p>
<p><strong>CVE-2026-105215 is a pre-hijack.</strong> The attacker creates an account in advance, bound to the victim&rsquo;s external identity. The victim&rsquo;s first genuine sign-in through that IdP then lands in the attacker-prepared account. It needs the victim&rsquo;s external user ID, which the advisory says may be known or predictable, and only Login V1 is affected.</p>
<h2 id="when-the-fixes-actually-shipped">When the fixes actually shipped</h2>
<p>The CVE records were published on October 4, 2026; two of them (CVE-2026-105209 and CVE-2026-105215) were updated on October 5. The fixes are older. The &ldquo;public&rdquo; dates in the CVE records are July 29, August 14 and September 4, 2026 for CVE-2026-105215, CVE-2026-105209 and CVE-2026-105207, respectively. ZITADEL&rsquo;s releases page lists 3.4.15 and 4.17.1 as released August 14, 2026 and 4.17.3 as released September 4, 2026, which matches. It lists 4.16.2 and 3.4.14 as released July 29, 2026, which also matches.</p>
<p>Two consequences follow. First, an organization that kept to a routine upgrade cadence may already be on a fixed build without having seen any alert. Second, an organization that skipped those releases has been exposed for weeks to flaws whose fixes were public, and the CVE publication on October 4 makes the technical detail easier for others to find. Whether anyone used them in that window is something we found no reporting on.</p>
<h3 id="where-the-sources-disagree-or-are-unclear">Where the sources disagree or are unclear</h3>
<ul>
<li><strong>Version ranges for CVE-2026-105207.</strong> ZITADEL&rsquo;s advisory lists 3.0.0 through 3.4.15 and 4.0.0 through 4.17.2 as affected, with 4.17.3 as the fix. The CVE record&rsquo;s text agrees, but its structured data also contains a second block that lists versions up to and including 4.19.4 as affected. That contradicts the advisory, which names 4.17.3 as the fixed release, and would flag a patched 4.19.4 server in any scanner that reads that field. We treat the advisory as authoritative and note the record&rsquo;s data as inconsistent; we have not seen a correction.</li>
<li><strong>Severity numbers.</strong> A widely circulated summary lists the three flaws as 9.8, 9.6 and 9.1. Those are the CVSS 3.1 scores. On CVSS 4.0, which the CVE records also carry, all three score 9.3. The two are different scales and should not be compared against each other.</li>
<li><strong>What &ldquo;latest&rdquo; is.</strong> The newest release we found on October 6 was 4.19.4, dated October 1, 2026. The release notes for 4.19.2 (September 28, 2026) say it addresses three further vulnerabilities: two rated High, both account takeover issues (advisories GHSA-x4c7-fpcx-w9q6 and GHSA-jh92-5mrj-p2w2), and one rated Low (GHSA-w4gv-rcwj-w6r5). We did not review those advisories in detail, and they are separate from the three CVEs covered here.</li>
</ul>
<h2 id="what-to-do-in-order">What to do, in order</h2>
<p>This sequence is our recommendation, built on ZITADEL&rsquo;s advisories.</p>
<h3 id="1-find-every-instance-and-its-version">1. Find every instance and its version</h3>
<p>Include development, staging and any instance that serves a single customer. Record whether it runs 3.x or 4.x, and whether Login V1, Login V2 or both are enabled, since that decides which flaws apply.</p>
<h3 id="2-upgrade-to-4173-or-later-preferably-the-newest-4x">2. Upgrade to 4.17.3 or later, preferably the newest 4.x</h3>
<p>Fixing all three requires at least 4.17.3. Given the further fixes in 4.19.2, aim for the newest 4.x release. One upgrade requirement to plan for: the 4.19.2 release notes say Login V2 now requires session cookie signing, that the <code>ZITADEL_SESSION_COOKIE_SECRET</code> environment variable (at least 32 characters) must be set before upgrading, and that users have to sign in again afterward. If you are on 3.x, plan the move to 4.x now: the advisory for CVE-2026-105207 says the 3.x line reached end-of-life on August 31, 2026 and will not be patched, so staying on 3.x leaves that flaw open. Test the upgrade first, because a major-version move can change login behavior.</p>
<h3 id="3-if-you-must-wait-apply-the-partial-workarounds-and-limit-exposure">3. If you must wait, apply the partial workarounds and limit exposure</h3>
<p>ZITADEL lists two partial workarounds. Disabling external IdP account linking reduces the CVE-2026-105207 route through Login V2 but not the API route. Disabling manual account creation on external IdPs reduces CVE-2026-105215 but turns off legitimate self-service registration. For CVE-2026-105209 the advisory says no configuration workaround fully addresses it. Our own suggestion, not ZITADEL&rsquo;s: where an instance is only used by staff, restricting it to a VPN or an allowlist of source addresses reduces the number of people who can reach the vulnerable endpoints, though it does not help against CVE-2026-105209, where the attacker is already an authenticated administrator.</p>
<h3 id="4-look-for-takeovers-that-already-happened">4. Look for takeovers that already happened</h3>
<p>Upgrading removes the flaw, not an attacker who has already taken an account. We did not verify ZITADEL&rsquo;s log or event names, so use your own audit logs and match these questions to what they record:</p>
<ul>
<li><strong>IdP links.</strong> Have any existing accounts gained an external IdP link that the owner did not create, especially since August 2026? A takeover through CVE-2026-105207 leaves a new link on the victim&rsquo;s account.</li>
<li><strong>Passkey and passwordless enrollment.</strong> Were enrollment codes issued by an administrator in organization A for a user in organization B? Did any account register a new authenticator it did not request?</li>
<li><strong>Accounts created through external sign-in that no real person used.</strong> Pre-hijack accounts are created through the registration endpoint, with an external identity attached before the real person arrives.</li>
<li><strong>Sign-ins that follow one of those changes</strong> from an unfamiliar address or device.</li>
</ul>
<p>If you find a suspicious link or authenticator, remove it, revoke the account&rsquo;s active sessions and review what the account could reach. Our guide to <a href="/posts/how-to-detect-and-rotate-leaked-api-keys-before-attackers-use-them/">detecting leaked keys and rotating them</a> covers the follow-up for any secrets those accounts could read.</p>
<h3 id="5-keep-the-logs">5. Keep the logs</h3>
<p>Make sure identity-provider events are retained somewhere an attacker with administrator rights in one tenant cannot erase them. The reasoning is in our piece on <a href="/posts/logging-for-incidents-not-for-dashboards/">logging for incidents rather than dashboards</a>.</p>
<h2 id="what-this-says-about-identity-systems-generally">What this says about identity systems generally</h2>
<p>The three flaws share one pattern, which is our reading, not ZITADEL&rsquo;s: the system trusted a claim about who was acting without checking it where the change happened. In CVE-2026-105207 it was a link request, in CVE-2026-105209 a header naming an organization, and in CVE-2026-105215 identity fields supplied by the browser. When you review any identity platform, including a hosted one, ask where an account&rsquo;s credentials can be added or changed, and what is checked at that exact step.</p>
<p>The timing is also a lesson. These are fixed-before-disclosed flaws, and the organizations hurt are those that treat identity software as set-and-forget. Put your identity provider on the same patch watchlist as your edge devices, and rank it using the approach in our <a href="/posts/the-vulnerability-backlog-that-never-shrinks/">vulnerability backlog</a> piece.</p>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 6, 2026. We did not install ZITADEL, test any flaw or review its source code. ZITADEL&rsquo;s advisories and releases page were read through a page-summarizing tool; the CVE records were read directly from the CVE Program API. The affected-version lists, workarounds and release dates below should be checked against the primary pages before you act on them.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>CVE-2026-105207: unauthenticated account takeover via IdP linking; affects 4.0.0 to 4.17.2 and 3.0.0 to 3.4.15; fixed in 4.17.3; 3.x end-of-life; Login V1 unaffected</td>
          <td><a href="https://github.com/zitadel/zitadel/security/advisories/GHSA-g8gj-gq47-xgf4">GHSA-g8gj-gq47-xgf4</a>; <a href="https://cveawg.mitre.org/api/cve/CVE-2026-105207">CVE record</a></td>
          <td>Qualified: CVE record&rsquo;s structured data contains an inconsistent second range</td>
      </tr>
      <tr>
          <td>CVE-2026-105209: cross-organization takeover via passkey enrollment; affects 4.0.0 to 4.17.0 and 3.0.0 to 3.4.14; fixed in 4.17.1 and 3.4.15; no complete workaround</td>
          <td><a href="https://github.com/zitadel/zitadel/security/advisories/GHSA-pq2q-2c6r-75c4">GHSA-pq2q-2c6r-75c4</a>; <a href="https://cveawg.mitre.org/api/cve/CVE-2026-105209">CVE record</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>CVE-2026-105215: pre-hijacking in Login V1; affects 4.0.0 to 4.16.1 and 3.0.0 to 3.4.13; fixed in 4.16.2 and 3.4.14; Login V2 unaffected</td>
          <td><a href="https://github.com/zitadel/zitadel/security/advisories/GHSA-738m-7888-jfv8">GHSA-738m-7888-jfv8</a>; <a href="https://cveawg.mitre.org/api/cve/CVE-2026-105215">CVE record</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Advisory scores 9.8, 9.6, 9.1; CVE records carry CVSS 3.1 scores of 9.8, 9.6, 9.1 and CVSS 4.0 scores of 9.3</td>
          <td>The three advisories and CVE records above</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>CVE records published October 4, 2026 by VulnCheck; public dates July 29, August 14 and September 4, 2026</td>
          <td>CVE records above</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>4.16.2 and 3.4.14 released July 29, 2026; 3.4.15 and 4.17.1 released August 14, 2026; 4.17.3 released September 4, 2026; 4.19.2 (September 28, 2026) addresses three further vulnerabilities and requires a Login V2 session cookie secret; 4.19.4 dated October 1, 2026</td>
          <td><a href="https://github.com/zitadel/zitadel/releases">ZITADEL releases</a>; <a href="https://github.com/zitadel/zitadel/releases/tag/v4.19.2">4.19.2 release notes</a></td>
          <td>Verified: as read October 6, 2026</td>
      </tr>
      <tr>
          <td>Partial workarounds: disable external IdP linking (105207, Login V2 only); disable manual account creation on external IdPs (105215)</td>
          <td>GHSA-g8gj-gq47-xgf4; GHSA-738m-7888-jfv8</td>
          <td>Qualified: vendor advisory; not tested</td>
      </tr>
      <tr>
          <td>Not in CISA KEV (catalog 2026.10.04); CISA enrichment lists exploitation &ldquo;none&rdquo; for CVE-2026-105209 and CVE-2026-105215 as of October 5, 2026</td>
          <td><a href="https://github.com/cisagov/kev-data/blob/main/known_exploited_vulnerabilities.json">CISA KEV data</a>; CVE records</td>
          <td>Qualified: point-in-time; no CISA enrichment seen for CVE-2026-105207</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>Argon2id vs bcrypt vs scrypt: OWASP Parameters to Use</title><link>https://firewallsync.com/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/</link><guid>https://firewallsync.com/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/</guid><pubDate>Sun, 04 Oct 2026 06:35:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>AppSec &amp; APIs</category><description>Use Argon2id for new systems, keep bcrypt if you already have it and handle its 72-byte limit, and use PBKDF2 only when FIPS requires it. The harder part is choosing parameters your login servers can afford.</description><enclosure url="https://firewallsync.com/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/cover_hu9040332994792319567.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/cover_hu9040332994792319567.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/password-hashing-argon2id-vs-bcrypt-vs-scrypt-which-to-use-and-with-what-parameters/cover_hu9040332994792319567.jpg" alt="Heavy steel bank vault door with a large circular locking wheel" width="1200" height="630"></p><p>For a new application, hash passwords with Argon2id. If your platform has no good Argon2id library, use scrypt. If you already use bcrypt with a work factor of 10 or more, you can keep it, provided you deal with its 72-byte input limit. Use PBKDF2 only when you need FIPS-validated cryptography. That ordering is from the OWASP <a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html">Password Storage Cheat Sheet</a>, and the rest of this article is about the parameters, because choosing the algorithm is the easy part.</p>
<h2 id="what-a-password-hash-has-to-do">What a password hash has to do</h2>
<p>A password hashing function turns a password into a value you can store and later compare against, without storing the password. OWASP&rsquo;s reasoning for hashing rather than encrypting is that hashing is &ldquo;a one-way function&rdquo;, so there is no key that turns the database back into passwords. (For where encryption is the right tool, see <a href="/posts/symmetric-vs-asymmetric-encryption-when-to-use-each/">symmetric vs asymmetric encryption</a>.)</p>
<p>One-way is not enough. If your user table leaks, an attacker guesses candidate passwords, hashes each guess and compares. The defense is to make every guess expensive. Three properties do that:</p>
<ul>
<li><strong>A unique salt per password.</strong> A salt is a random value mixed into each hash, so identical passwords produce different hashes and each account has to be attacked separately.</li>
<li><strong>A tunable work factor.</strong> A setting that makes each hash slower, which you raise as hardware improves.</li>
<li><strong>Memory hardness.</strong> A requirement that each hash uses a set amount of RAM. This matters because graphics cards and custom chips run enormous numbers of cheap computations in parallel, and memory is the resource that is hard to multiply.</li>
</ul>
<p>General-purpose hashes such as SHA-256 have none of the last two. On the machine we used for the timings below, plain Python computed 1,000,000 SHA-256 hashes in about 0.43 seconds on one core. A single Argon2id hash at OWASP&rsquo;s minimum setting took about 25 milliseconds on the same machine. That gap is the point of the exercise.</p>
<h2 id="the-four-options-compared">The four options compared</h2>
<table>
  <thead>
      <tr>
          <th></th>
          <th>Argon2id</th>
          <th>scrypt</th>
          <th>bcrypt</th>
          <th>PBKDF2</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Specified in</td>
          <td>RFC 9106 (September 2021)</td>
          <td>RFC 7914 (August 2016)</td>
          <td>Provos and Mazières, USENIX 1999</td>
          <td>NIST SP 800-132</td>
      </tr>
      <tr>
          <td>Tunable time cost</td>
          <td>Yes (<code>t</code>, iterations)</td>
          <td>Yes (<code>N</code>)</td>
          <td>Yes (work factor)</td>
          <td>Yes (iterations)</td>
      </tr>
      <tr>
          <td>Tunable memory cost</td>
          <td>Yes (<code>m</code>), independent of time</td>
          <td>Yes, but tied to <code>N</code> and <code>r</code></td>
          <td>No memory setting</td>
          <td>No memory setting</td>
      </tr>
      <tr>
          <td>Input length limit</td>
          <td>No practical limit</td>
          <td>No practical limit</td>
          <td>72 bytes in most implementations</td>
          <td>No practical limit</td>
      </tr>
      <tr>
          <td>OWASP position</td>
          <td>First choice</td>
          <td>Use when Argon2id is not available</td>
          <td>Legacy systems</td>
          <td>When FIPS compliance is required</td>
      </tr>
      <tr>
          <td>OWASP minimum</td>
          <td>19 MiB, 2 iterations, parallelism 1</td>
          <td>N=2^17, r=8, p=1</td>
          <td>Work factor 10</td>
          <td>600,000 iterations with HMAC-SHA-256</td>
      </tr>
  </tbody>
</table>
<p>Argon2 won the Password Hashing Competition, an open contest that ran from 2012 and announced its winner in July 2015. It has three variants. RFC 9106 states that &ldquo;Argon2id MUST be supported by any implementation&rdquo;, and OWASP recommends that variant because &ldquo;it provides a balanced approach to resisting both side-channel and GPU-based attacks.&rdquo; Unless you have a specific reason, do not choose Argon2i or Argon2d.</p>
<h2 id="parameters-the-numbers-and-where-they-come-from">Parameters: the numbers and where they come from</h2>
<h3 id="argon2id">Argon2id</h3>
<p>Argon2id has three settings: memory <code>m</code> (in kibibytes), iterations <code>t</code>, and parallelism <code>p</code> (the number of lanes, which maps to threads).</p>
<p>OWASP lists five combinations that it says give an equal level of defense, trading memory for CPU time:</p>
<table>
  <thead>
      <tr>
          <th>Memory <code>m</code></th>
          <th>Iterations <code>t</code></th>
          <th>Parallelism <code>p</code></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>47104 KiB (46 MiB)</td>
          <td>1</td>
          <td>1</td>
      </tr>
      <tr>
          <td>19456 KiB (19 MiB)</td>
          <td>2</td>
          <td>1</td>
      </tr>
      <tr>
          <td>12288 KiB (12 MiB)</td>
          <td>3</td>
          <td>1</td>
      </tr>
      <tr>
          <td>9216 KiB (9 MiB)</td>
          <td>4</td>
          <td>1</td>
      </tr>
      <tr>
          <td>7168 KiB (7 MiB)</td>
          <td>5</td>
          <td>1</td>
      </tr>
  </tbody>
</table>
<p>RFC 9106 recommends considerably more:</p>
<table>
  <thead>
      <tr>
          <th>RFC 9106 option</th>
          <th>Memory</th>
          <th>Iterations</th>
          <th>Lanes</th>
          <th>Salt</th>
          <th>Output</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>First recommended</td>
          <td>2 GiB</td>
          <td>1</td>
          <td>4</td>
          <td>128 bits</td>
          <td>256 bits</td>
      </tr>
      <tr>
          <td>Second recommended</td>
          <td>64 MiB</td>
          <td>3</td>
          <td>4</td>
          <td>128 bits</td>
          <td>256 bits</td>
      </tr>
  </tbody>
</table>
<p>These two sources are not in conflict. OWASP states a minimum. The RFC states what its authors recommend when memory is available. A reasonable reading: treat the OWASP row as the floor you must not go below, and the RFC&rsquo;s second option as the target if your servers can carry it.</p>
<p>Your library has an opinion too. The Python library <code>argon2-cffi</code> (version 25.1.0) defaults to 64 MiB, 3 iterations and parallelism 4, which its documentation identifies as the RFC 9106 low-memory profile. Other libraries default to other values, so read the defaults rather than assuming them.</p>
<h3 id="scrypt">scrypt</h3>
<p>scrypt has a CPU and memory cost <code>N</code>, a block size <code>r</code> and a parallelization setting <code>p</code>. Memory and time are both driven by <code>N</code>, so you cannot raise one without the other. OWASP&rsquo;s equivalent options:</p>
<table>
  <thead>
      <tr>
          <th><code>N</code></th>
          <th>Memory (per OWASP)</th>
          <th><code>r</code></th>
          <th><code>p</code></th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>2^17</td>
          <td>128 MiB</td>
          <td>8</td>
          <td>1</td>
      </tr>
      <tr>
          <td>2^16</td>
          <td>64 MiB</td>
          <td>8</td>
          <td>2</td>
      </tr>
      <tr>
          <td>2^15</td>
          <td>32 MiB</td>
          <td>8</td>
          <td>3</td>
      </tr>
      <tr>
          <td>2^14</td>
          <td>16 MiB</td>
          <td>8</td>
          <td>5</td>
      </tr>
      <tr>
          <td>2^13</td>
          <td>8 MiB</td>
          <td>8</td>
          <td>10</td>
      </tr>
  </tbody>
</table>
<h3 id="bcrypt">bcrypt</h3>
<p>bcrypt has one setting, the work factor (also called cost or rounds). Each increase of one doubles the work. OWASP says the work factor &ldquo;should be as large as verification server performance will allow, with a minimum of 10.&rdquo;</p>
<p>bcrypt has no memory setting. That is the main technical reason it is no longer the first choice: its cost can only be raised in time, not in RAM.</p>
<h3 id="pbkdf2">PBKDF2</h3>
<p>OWASP&rsquo;s iteration counts depend on the inner hash: 600,000 for PBKDF2-HMAC-SHA256, 220,000 for PBKDF2-HMAC-SHA512, and 1,400,000 for PBKDF2-HMAC-SHA1 (legacy only). Like bcrypt, PBKDF2 has no memory cost.</p>
<h3 id="what-nist-requires">What NIST requires</h3>
<p>NIST SP 800-63B-4, the current US federal digital identity guideline, does not name an algorithm in its password verifier requirements. It says passwords &ldquo;SHALL be salted and hashed using a suitable password hashing scheme&rdquo;, that the cost factor &ldquo;SHOULD be as high as practical without negatively impacting verifier performance&rdquo;, and that the salt &ldquo;SHALL be at least 32 bits in length&rdquo;. It points to NIST SP 800-132, the PBKDF2 specification, for approved schemes, which is why PBKDF2 is the answer when a contract requires FIPS-validated cryptography.</p>
<h2 id="what-these-settings-cost-measured-timings">What these settings cost: measured timings</h2>
<p>We ran each configuration on one machine to show relative cost. This is a single measurement on a small cloud virtual machine with 2 virtual CPUs, using Python 3.13, <code>argon2-cffi</code> 25.1.0, <code>bcrypt</code> 5.0.0 and the standard library&rsquo;s <code>hashlib</code>. Each figure is the median of five or seven runs. Your hardware will give different absolute numbers; measure on your own login servers.</p>
<table>
  <thead>
      <tr>
          <th>Configuration</th>
          <th>Time per hash (this machine)</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Argon2id, 19 MiB, t=2, p=1 (OWASP minimum)</td>
          <td>about 25 ms</td>
      </tr>
      <tr>
          <td>Argon2id, 46 MiB, t=1, p=1 (OWASP alternative)</td>
          <td>about 48 ms</td>
      </tr>
      <tr>
          <td>Argon2id, 64 MiB, t=3, p=4 (RFC 9106 second option)</td>
          <td>about 115 ms</td>
      </tr>
      <tr>
          <td>bcrypt, work factor 10</td>
          <td>about 68 ms</td>
      </tr>
      <tr>
          <td>bcrypt, work factor 12</td>
          <td>about 274 ms</td>
      </tr>
      <tr>
          <td>bcrypt, work factor 14</td>
          <td>about 1,064 ms</td>
      </tr>
      <tr>
          <td>scrypt, N=2^17, r=8, p=1</td>
          <td>about 404 ms</td>
      </tr>
      <tr>
          <td>PBKDF2-HMAC-SHA256, 600,000 iterations</td>
          <td>about 150 ms</td>
      </tr>
  </tbody>
</table>
<p>Three things to take from this:</p>
<ul>
<li>The OWASP &ldquo;minimums&rdquo; are not equal in server cost. On this machine the scrypt minimum took roughly 16 times as long as the Argon2id minimum. Do not read these timings as a ranking of attacker cost either: the algorithms differ in how well they resist specialized hardware, which is the reason memory-hard functions are preferred.</li>
<li>bcrypt&rsquo;s doubling is visible. Two steps of work factor, from 10 to 12 and from 12 to 14, each multiplied the time by about four.</li>
<li>OWASP&rsquo;s guidance is that &ldquo;calculating a hash should take less than one second.&rdquo; bcrypt at work factor 14 exceeded that here.</li>
</ul>
<h3 id="size-memory-for-concurrency-not-for-one-login">Size memory for concurrency, not for one login</h3>
<p>Time is only half the budget. Argon2id and scrypt allocate their memory for every hash in progress, so the number that matters is memory multiplied by simultaneous logins.</p>
<p>A worked example, with assumed figures: if a login service peaks at 50 password verifications in progress at once, Argon2id at 19 MiB needs about 950 MiB for hashing at that moment, and at 64 MiB it needs 3,200 MiB (about 3.1 GiB). Neither figure includes the rest of the application.</p>
<p>This has a security side. An unauthenticated login endpoint that allocates 64 MiB per request is a way to exhaust a server. Cap concurrent hash operations with a queue or semaphore, and rate limit login attempts before they reach the hashing step. OWASP also warns that some PBKDF2 implementations make very long passwords much more expensive to hash, so set a maximum password length. NIST SP 800-63B-4 says verifiers should accept at least 64 characters, which makes 64 the floor for that maximum, not the ceiling.</p>
<h2 id="the-bcrypt-72-byte-limit">The bcrypt 72-byte limit</h2>
<p>OWASP&rsquo;s wording: &ldquo;bcrypt has a maximum length input length of 72 bytes for most implementations, so you should enforce a maximum password length of 72 bytes.&rdquo;</p>
<p>Two details make this more than trivia.</p>
<p>First, the limit is in bytes, not characters. A passphrase in a script that uses three bytes per character in UTF-8 reaches 72 bytes at 24 characters.</p>
<p>Second, implementations disagree on what happens past the limit. Some truncate silently, which means two long passwords that share their first 72 bytes are treated as the same password. The Python <code>bcrypt</code> library, in the 5.0.0 release we tested, refuses instead: hashing a 73-byte input raised <code>ValueError: password cannot be longer than 72 bytes, truncate manually if necessary</code>. Find out which behavior your library has before a long passphrase finds out for you.</p>
<p>The common workaround is to hash the password with a fast hash first and feed the result to bcrypt. OWASP describes this as dangerous if done naively, for two reasons: a raw hash can contain a NULL byte, which truncates the input in some bcrypt implementations, and an unkeyed pre-hash enables &ldquo;password shucking&rdquo;, where an attacker tests hashes leaked from another site directly against yours. The construction OWASP gives avoids both by using a keyed hash and encoding the output:</p>
<pre tabindex="0"><code>bcrypt(base64(hmac-sha384(data: password, key: pepper)), salt, cost)
</code></pre><p>If you are writing new code, this is a good argument for Argon2id, which has no such limit.</p>
<h2 id="a-working-example">A working example</h2>
<p>This is Python using <code>argon2-cffi</code> 25.1.0. We ran this code; it is a minimal illustration of the hash, verify and upgrade flow, not a complete authentication system.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-python" data-lang="python"><span style="display:flex;"><span><span style="color:#f92672">from</span> argon2 <span style="color:#f92672">import</span> PasswordHasher
</span></span><span style="display:flex;"><span><span style="color:#f92672">from</span> argon2.exceptions <span style="color:#f92672">import</span> VerifyMismatchError, VerificationError, InvalidHashError
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e"># OWASP minimum: m=19456 KiB (19 MiB), t=2, p=1. Raise these if your servers allow.</span>
</span></span><span style="display:flex;"><span>ph <span style="color:#f92672">=</span> PasswordHasher(time_cost<span style="color:#f92672">=</span><span style="color:#ae81ff">2</span>, memory_cost<span style="color:#f92672">=</span><span style="color:#ae81ff">19456</span>, parallelism<span style="color:#f92672">=</span><span style="color:#ae81ff">1</span>)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">hash_password</span>(password: str) <span style="color:#f92672">-&gt;</span> str:
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> ph<span style="color:#f92672">.</span>hash(password)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">def</span> <span style="color:#a6e22e">verify_password</span>(stored_hash: str, password: str) <span style="color:#f92672">-&gt;</span> tuple[bool, str <span style="color:#f92672">|</span> <span style="color:#66d9ef">None</span>]:
</span></span><span style="display:flex;"><span>    <span style="color:#e6db74">&#34;&#34;&#34;Return (ok, new_hash). new_hash is set when the stored hash should be replaced.&#34;&#34;&#34;</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">try</span>:
</span></span><span style="display:flex;"><span>        ph<span style="color:#f92672">.</span>verify(stored_hash, password)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">except</span> (VerifyMismatchError, VerificationError, InvalidHashError):
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">False</span>, <span style="color:#66d9ef">None</span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> ph<span style="color:#f92672">.</span>check_needs_rehash(stored_hash):
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">True</span>, ph<span style="color:#f92672">.</span>hash(password)
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">return</span> <span style="color:#66d9ef">True</span>, <span style="color:#66d9ef">None</span>
</span></span></code></pre></div><p><code>hash_password</code> returns a string of this shape:</p>
<pre tabindex="0"><code>$argon2id$v=19$m=19456,t=2,p=1$vAqAbNgPClqje7Xsyzs9bA$K4vezmEN/bOYW9Jwno28K7vgP4vbehiavrZMUlDyZ5Y
</code></pre><p>Everything needed to verify the password later is in that one string: the variant, the version, the three parameters, the salt and the hash. That is why you do not need a separate salt column, and why you can change parameters later without breaking existing accounts.</p>
<p>Notes on the choices:</p>
<ul>
<li><code>verify</code> raises an exception on a mismatch rather than returning <code>False</code>. The code catches the three documented exception types and treats all of them as a failed login.</li>
<li><code>check_needs_rehash</code> compares the parameters stored in the hash with the ones the <code>PasswordHasher</code> is configured with. When you raise the settings, every user is upgraded at their next successful login. In our test, a hash created with weaker settings verified successfully and came back with a replacement hash at the current settings.</li>
<li>Do not compare hash strings yourself, and do not write your own salt generation. The library does both.</li>
</ul>
<h2 id="changing-algorithm-without-a-password-reset">Changing algorithm without a password reset</h2>
<p>You cannot convert a bcrypt hash into an Argon2id hash, because you do not have the password. You do have it at one moment: during a successful login. OWASP describes this as the most common approach, &ldquo;to wait until the user next authenticates, then re-hash their password.&rdquo;</p>
<p>The steps:</p>
<ol>
<li>Store hashes in a format that identifies the algorithm. The <code>$argon2id$</code> and <code>$2b$</code> prefixes already do this.</li>
<li>At login, verify against whichever algorithm the stored hash uses.</li>
<li>On success, if the stored hash is not at the current algorithm and settings, hash the password again and overwrite the stored value.</li>
</ol>
<p>The gap is accounts that never log in. They keep the old hash indefinitely. There are two ways to close it. One is to expire those hashes after a set period and require a reset. The other, which OWASP describes for upgrading legacy hashes, is to wrap them: run the old hash through the new algorithm now, so the database holds for example <code>argon2id(old_hash)</code>, and replace it with a direct hash at the next login. Wrapping protects every account immediately but means your verify code has to handle the layered form until each user returns.</p>
<h2 id="should-you-add-a-pepper">Should you add a pepper?</h2>
<p>A pepper is a secret key applied to every password in addition to its salt. Unlike a salt, it is not stored with the hash. OWASP: &ldquo;The pepper should not be public and should not be stored along with the generated hash.&rdquo;</p>
<p>NIST SP 800-63B-4 recommends the same idea in different words: verifiers &ldquo;SHOULD perform an additional iteration of a keyed hashing or encryption operation using a secret key known only to the verifier&rdquo;, and that key &ldquo;SHALL be stored separately from the hashed passwords&rdquo;, ideally in a hardware security module.</p>
<p>What it buys you: an attacker who steals only the database, for example through SQL injection or a leaked backup, cannot test guesses at all without the key. What it costs: a key you must store, protect and plan to rotate. It does not help if the attacker compromises the application server that holds the key. Treat it as a second layer on top of a properly configured hash, not a replacement for one.</p>
<h2 id="common-mistakes">Common mistakes</h2>
<ul>
<li><strong>Using a fast hash with a salt.</strong> Salted SHA-256 or MD5 is still fast to guess against. The salt only prevents reuse of work across accounts.</li>
<li><strong>Leaving parameters at whatever a tutorial used.</strong> Work factors that were reasonable years ago are low now. Review them on a schedule, and use rehash-on-login to roll changes out.</li>
<li><strong>Raising memory without checking concurrency.</strong> See the sizing example above.</li>
<li><strong>Ignoring bcrypt truncation.</strong> Enforce a 72-byte maximum or use the keyed pre-hash construction.</li>
<li><strong>Encrypting passwords instead of hashing them.</strong> Encryption is reversible by anyone with the key, including an attacker who obtains it.</li>
<li><strong>Treating the hash as the whole defense.</strong> A strong hash slows offline guessing after a breach. It does nothing about phishing or credential stuffing against the live login form. That is the job of multi-factor authentication, covered in <a href="/posts/mfa-fatigue-attacks-what-actually-stops-them/">MFA fatigue attacks and what stops them</a>.</li>
</ul>
<h2 id="a-short-decision-guide">A short decision guide</h2>
<table>
  <thead>
      <tr>
          <th>Your situation</th>
          <th>What to do</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>New application, no compliance constraint</td>
          <td>Argon2id. Start at the RFC 9106 second option (64 MiB, t=3, p=4) if capacity allows, and never below OWASP&rsquo;s 19 MiB, t=2, p=1</td>
      </tr>
      <tr>
          <td>No maintained Argon2id library for your platform</td>
          <td>scrypt at N=2^17, r=8, p=1 or an OWASP equivalent</td>
      </tr>
      <tr>
          <td>Existing bcrypt at work factor 10 or more</td>
          <td>Keep it, enforce the 72-byte limit, raise the work factor as far as login latency allows, plan a rehash-on-login move to Argon2id</td>
      </tr>
      <tr>
          <td>Existing bcrypt below work factor 10</td>
          <td>Raise the work factor now and rehash on login</td>
      </tr>
      <tr>
          <td>FIPS-validated cryptography required</td>
          <td>PBKDF2-HMAC-SHA256 at 600,000 iterations or more</td>
      </tr>
      <tr>
          <td>Unsalted or fast hashes (MD5, SHA-1, SHA-256)</td>
          <td>Wrap existing hashes in Argon2id immediately, then replace at next login</td>
      </tr>
  </tbody>
</table>
<h2 id="sources-and-verification">Sources and verification</h2>
<p>Checked on October 4, 2026. Recommended parameters change as hardware improves, so confirm them against the linked sources before relying on this page later. The timings are our own measurements on one machine and are illustrative.</p>
<table>
  <thead>
      <tr>
          <th>Important claim</th>
          <th>Source</th>
          <th>Verification</th>
      </tr>
  </thead>
  <tbody>
      <tr>
          <td>Algorithm order: Argon2id, then scrypt, bcrypt for legacy systems, PBKDF2 for FIPS; all minimum parameters and equivalent configurations</td>
          <td><a href="https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html">OWASP Password Storage Cheat Sheet</a>, as published October 4, 2026</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Argon2id must be supported; first and second recommended options; 128-bit salt</td>
          <td><a href="https://www.rfc-editor.org/rfc/rfc9106.html">RFC 9106</a>, September 2021</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>scrypt parameters N, r and p</td>
          <td><a href="https://www.rfc-editor.org/rfc/rfc7914.html">RFC 7914</a>, August 2016</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>bcrypt introduced with an adaptable cost</td>
          <td><a href="https://www.usenix.org/legacy/events/usenix99/provos.html">Provos and Mazières, &ldquo;A Future-Adaptable Password Scheme&rdquo;</a>, USENIX 1999</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Argon2 announced as Password Hashing Competition winner in July 2015</td>
          <td><a href="https://www.password-hashing.net/">password-hashing.net</a></td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>NIST requirements for salting, cost factor, salt length, keyed hash and password length</td>
          <td><a href="https://pages.nist.gov/800-63-4/sp800-63b.html">NIST SP 800-63B-4</a>, password verifier requirements</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td><code>argon2-cffi</code> defaults match the RFC 9106 low-memory profile</td>
          <td><a href="https://argon2-cffi.readthedocs.io/en/stable/api.html">argon2-cffi API reference</a>, version 25.1.0, and the installed library</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>bcrypt 72-byte limit; pre-hashing risks; recommended keyed construction</td>
          <td>OWASP Password Storage Cheat Sheet</td>
          <td>Verified</td>
      </tr>
      <tr>
          <td>Python <code>bcrypt</code> 5.0.0 raises an error above 72 bytes</td>
          <td>Run in our build environment</td>
          <td>Verified for that version only</td>
      </tr>
      <tr>
          <td>Timings table</td>
          <td>Measured on a 2 vCPU virtual machine, Python 3.13</td>
          <td>Qualified: one machine, illustrative</td>
      </tr>
      <tr>
          <td>Concurrency memory example</td>
          <td>Arithmetic on assumed figures (50 concurrent logins)</td>
          <td>Qualified: example, not a measurement</td>
      </tr>
  </tbody>
</table>
]]></content:encoded></item><item><title>MFA Fatigue Attacks: What Actually Stops Them</title><link>https://firewallsync.com/posts/mfa-fatigue-attacks-what-actually-stops-them/</link><guid>https://firewallsync.com/posts/mfa-fatigue-attacks-what-actually-stops-them/</guid><pubDate>Fri, 25 Sep 2026 09:00:00 +0000</pubDate><dc:creator>FirewallSync Editorial</dc:creator><category>Identity &amp; Access</category><description>Push-notification bombing keeps working because most MFA rollouts treat every factor as equally trustworthy. Here's what actually closes the gap.</description><enclosure url="https://firewallsync.com/posts/mfa-fatigue-attacks-what-actually-stops-them/cover_hu11399287156490859215.jpg" type="image/jpeg" length="0"/><media:content url="https://firewallsync.com/posts/mfa-fatigue-attacks-what-actually-stops-them/cover_hu11399287156490859215.jpg" medium="image" type="image/jpeg" width="1200" height="630"/><content:encoded><![CDATA[<p><img src="https://firewallsync.com/posts/mfa-fatigue-attacks-what-actually-stops-them/cover_hu11399287156490859215.jpg" alt="Person holding a smartphone showing a fingerprint prompt" width="1200" height="630"></p><p>MFA fatigue attacks — also called push bombing — don&rsquo;t exploit a technical flaw. They exploit the fact that most MFA rollouts treat &ldquo;any second factor&rdquo; as good enough, when the factor&rsquo;s design determines whether an exhausted employee at 11pm taps &ldquo;approve&rdquo; just to make the notifications stop.</p>
<h2 id="number-matching-isnt-optional-anymore">Number matching isn&rsquo;t optional anymore</h2>
<p>Plain push approval (&ldquo;tap yes or no&rdquo;) is the weakest form of MFA still in wide use, precisely because it asks the user to make zero cognitive effort. Number matching — where the user has to type a code shown on the login screen into the push prompt — adds just enough friction to break the autopilot response that makes bombing effective. If your identity provider supports it, this is a config change, not a project, and it should be the default for every account, not an opt-in.</p>
<h2 id="phishing-resistant-factors-change-the-incentive-not-just-the-defense">Phishing-resistant factors change the incentive, not just the defense</h2>
<p>Number matching reduces bombing success rates, but it doesn&rsquo;t touch attacks that pair the push spam with a live phishing page relaying real-time codes. FIDO2 security keys and passkeys remove this entire class of attack because the cryptographic challenge is bound to the origin domain — there&rsquo;s no code to relay. Rolling these out for admin and finance roles first (the accounts actually worth targeting) gets you most of the risk reduction without a company-wide hardware rollout.</p>
<h2 id="rate-limit-and-alert-on-push-volume-not-just-failed-logins">Rate-limit and alert on push volume, not just failed logins</h2>
<p>Most detection stacks are tuned to flag failed authentication attempts, but a bombing attack looks like a string of <em>successful</em> prompt deliveries with no failures at all — the attacker already has valid credentials, they&rsquo;re just waiting for a mis-tap. Add a specific alert for unusual push notification volume per user per hour, independent of your failed-login alerting, and rate-limit repeated prompts to the same device to cut off the exhaustion tactic entirely.</p>
]]></content:encoded></item></channel></rss>