I've just released swift-webauthn 1.0.0-beta.4, which fixes a high-severity denial-of-service vulnerability. If your server uses swift-webauthn to register passkeys or security keys, please update. The full write up can be found on the GHSA-6hhq-f689-wcc5 advisory.
Impact
A single crafted registration response crashes the process that handles it. An attacker only needs to start a registration, which most relying parties allow before anyone has signed in, so no account or credentials are required. Confidentiality and integrity aren't affected. Each request takes the server down until it's restarted, and the attack can be repeated as often as the attacker likes. This occurred due to a branch for raw U2F public keys when the first byte was 0x04 which would then read the key as a 65 byte uncompressed EC point. There was no checking so you could just pass a single byte causing the crash. The branch wasn't used and now the key is read as a COSE key correctly.
What you need to do
Update to 1.0.0-beta.4:
.package(url: "https://github.com/brokenhandsio/swift-webauthn.git", from: "1.0.0-beta.4"),
1.0.0 Beta 4 also includes a number of other updates, notably the move to swift-cbor 1.0.0 RC 1. See the release notes for details.
There's no practical workaround so you should update straight away.
Thank you to EQSTLab for reporting this and to dimitribouniol for coordinating.
I also found the same crash independently while fuzzing the library with swift-fuzz. If you run any library that handles untrusted user input, I highly recommend you adopt fuzzing to catch issues like this.