Medium CVSS 4.3 webkit OOB 🔧 Commit mapped

Overview

Medium
Severity
4.3
CVSS
No
Exploited ITW
Fixed
Fix Status
DescriptionProcessing maliciously crafted web content may lead to an unexpected Safari crash
ComponentWebCore WebAuthn
Bug ClassOOB
Tracker313452
Fix commitce11a67281da (WebKit/WebKit) +19/-3
CWECWE-119 (Buffer bounds error)
CVSS vectorCVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:L
CISA KEVNot listed
Creditedwwwlk
Disclosed2026-08-17

Background

CBOR
Concise Binary Object Representation, the binary map/array format WebAuthn uses for authenticator data and extension outputs.
credProps extension
A WebAuthn client extension whose output is a map that may contain a boolean ‘rk’ (resident key) flag.
Iterator container mismatch
Comparing or dereferencing an iterator against a different container’s end() is undefined behavior and can read invalid memory.

Root Cause Analysis

This fixes a logic error — comparing and dereferencing a hash-map iterator against the wrong container — in WebAuthn CBOR parsing. AuthenticationExtensionsClientOutputs::fromCBOR decodes the top-level CBOR map (decodedMap), finds the ‘credProps’ entry, and then tried to look up the nested ‘rk’ key by REUSING the same iterator variable: it = it->second.getMap().find(cbor::CBORValue(“rk”)), then tested if (it != decodedMap.end() && it->second.isBool()). The find() runs on the nested credProps submap and returns an iterator into THAT submap, but the code compared it against decodedMap.end() — the end of the OUTER map — and reassigned the outer iterator in the process. Comparing iterators from two different containers is undefined behavior, and when ‘rk’ is absent from credProps the submap’s find() returns the submap’s end iterator; testing it against the wrong end and then dereferencing it->second reads past/into an invalid iterator, causing an out-of-bounds read / crash.

The fix takes a stable reference to the nested map (const auto& credPropsMap = it->second.getMap()), searches it with a separate iterator (credPropsIt), and compares against credPropsMap.end() before reading credPropsIt->second.

The restored invariant is that an iterator is only compared and dereferenced against its own container. The regression test decodes {“credProps”: {}} (credProps present, no ‘rk’) and expects a valid result with credProps->rk false.

Key insight
The nested credProps lookup reused the outer iterator and compared the submap’s find() result against the OUTER map’s end(), so a missing ‘rk’ key dereferenced an iterator from the wrong container.

Attack Path

  1. Return a crafted assertion A malicious authenticator/site supplies a WebAuthn response whose CBOR client-extension outputs contain a credProps map with no ‘rk’ key.
  2. Parse the extension outputs WebKit calls AuthenticationExtensionsClientOutputs::fromCBOR, which searches the credProps submap for ‘rk’.
  3. Compare against the wrong end The submap’s end iterator is compared to the outer map’s end (undefined behavior) and then dereferenced.
  4. Crash / OOB read Dereferencing the invalid iterator reads out of bounds, crashing the WebContent process.

Impact Assessment

An out-of-bounds read / crash in the WebContent process when parsing attacker-supplied WebAuthn extension-output CBOR. The primitive is a mis-compared/mis-dereferenced iterator on the parsing path, which the advisory frames as a crash; it is a memory-safety bug reachable wherever WebAuthn assertion/attestation responses are processed.

Changed Functions

FunctionChangeNotes
AuthenticationExtensionsClientOutputs::fromCBOR
Source/WebCore/Modules/webauthn/AuthenticationExtensionsClientOutputs.cpp
modified Searches the nested credProps map with its own iterator (credPropsIt) compared against credPropsMap.end(), instead of reusing the outer iterator and comparing to decodedMap.end().
CBORReaderTest.AuthExtensionsFromCBOR_CredPropsWithoutRk
Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp
added Regression test decoding {"credProps":{}} to ensure a missing 'rk' key no longer misuses the iterator.

Files Changed

  • Source/WebCore/Modules/webauthn/AuthenticationExtensionsClientOutputs.cpp
  • Tools/TestWebKitAPI/Tests/WebCore/CBORReaderTest.cpp

Audit Directions

  • Same file: nested map lookups
    Audit AuthenticationExtensionsClientOutputs and nearby WebAuthn CBOR parsers for find() results compared to a different map’s end() or reused iterator variables across nested maps.
  • CBOR getMap()/find patterns
    Grep for getMap().find(…) followed by comparison to an outer .end(); ensure each comparison uses the same map the find() ran on.

Original Bug Report

The reporter's bug is still restricted on the tracker.