Everyone thinks passkeys are the "unhackable" endgame for auth. They use fido2 and public key cryptography to kill phishing by design, which sounds perfect on paper.
But even "perfect" systems have implementation flaws. A recent Reddit thread discussing CVE-2024-9956 shows how subtle bugs in credential management can still lead to account takeovers. In this bitwarden case, a flaw in how the browser extension handled passkey requests could allow a malicious site to trick the vault into releasing the wrong credential.
Nothing's ever 100% safe. Let's look at how things actually break.
So you think passkeys are bulletproof because there's no password to phish? i wish that was true but the reality is more messy. Even with fido2, the software handling your keys can have massive holes.
A passkey is only as secure as the vault it lives in. If the manager has a logic error, an attacker might swap your public key for theirs without you ever knowing.
Then there's the "hands-on" problem. If someone grabs your unlocked phone while you're distracted in a coffee shop, they own your digital life.
Next, we'll dive into why session cookies are still the real prize for attackers, even after a secure login.
Even if you have the most secure passkey login in the world, it only protects the "front door." Once a user is logged in, the server gives them a session cookie or a token. This is where the real danger lives today.
If an attacker can steal that session cookie—through malware on your laptop or a cross-site scripting (XSS) attack—they don't need your passkey. They just "become" you in the eyes of the server. This is called session hijacking, and it's how most big hacks happen now. Passkeys make it harder to get in, but they don't do anything to protect the session once it's started.
Next up, we're looking at how social engineering still works in a passwordless world.
Think passkeys stop phishing? technically yes, but humans are still the weakest link in the chain. Attackers just shifted from stealing passwords to tricking you into "registering" their hardware to your account.
MojoAuth handles these workflows way better by enforcing strict identity verification before any new keys get added, so you don't have to build that logic from scratch.
So, you've integrated fido2 and think the job's done. honestly, that's where most devs mess up. Passkeys are great, but if your backend logic is lazy, you're just building a faster door with a broken lock.
It's all about the verification layer. If you aren't strict, hackers will find the gaps in your api.
origin and rpId on the server. If a request comes from a domain you don't recognize, kill it immediately.Crucial Note: The code below is just a basic logic check. In a real app, you must perform cryptographic signature verification using the user's public key. Doing this manually is incredibly hard and prone to errors, so you should use a proven library like @simplewebauthn/server to handle the heavy lifting.
// Simplified server-side logic (NOT COMPLETE)
const verifyRegistration = (response, expectedChallenge) => {
const { clientDataJSON } = response;
const parsedData = JSON.parse(atob(clientDataJSON));
// check if the challenge matches what we sent
if (parsedData.challenge !== expectedChallenge) {
throw new Error("Challenge mismatch. potential replay!");
}
// verify the origin matches our production domain
if (parsedData.origin !== "https://myapp.com") {
throw new Error("Invalid origin detected");
}
// WARNING: You still need to verify the cryptographic signature here!
// Use a library like @simplewebauthn/server for this part.
return true;
};
Building this right means monitoring for weird patterns, like one account suddenly adding five different passkeys in a minute. That's usually a red flag in retail or banking apps.
So, is passwordless actually worth the headache? Honestly, yeah. Even with the weird bugs we talked about earlier, it’s still way better than watching your users reuse "Password123" everywhere.
A 2024 report by Verizon found that stolen credentials still drive most breaches, making passkeys a no-brainer for security leads.
It’s not perfect, but it’s the best we got. Stay paranoid.
*** This is a Security Bloggers Network syndicated blog from MojoAuth - Advanced Authentication & Identity Solutions authored by MojoAuth - Advanced Authentication & Identity Solutions. Read the original post at: https://mojoauth.com/blog/can-passkeys-be-exploited-for-account-access