WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
312411
Fix leaks from Security APIs by using adoptCF() for CFErrorRef out parameters
https://bugs.webkit.org/show_bug.cgi?id=312411
Summary
Fix leaks from Security APIs by using adoptCF() for CFErrorRef out parameters
David Kilzer (:ddkilzer)
Reported
2026-04-15 13:48:36 PDT
Several Security framework APIs (`SecTrustSerialize`, `SecTrustDeserialize`, `SecTrustCopyPropertyListRepresentation`, `SecTrustCreateFromPropertyListRepresentation`, `SecKeyCreateRandomKey`, `SecKeyCreateWithData`) return +1 retained `CFErrorRef` objects through their out parameters, but the APIs are missing the `CF_RETURNS_RETAINED` annotation on those parameters (
rdar://161546781
). Newer functions in the same headers (`SecTrustCopyTrustStoreContentDigest`, `SecTrustGetAssetVersionNumber`, etc.) already have the annotation, but these older APIs have not been updated. WebKit callers store the raw `CFErrorRef` in a local variable, check it for errors, but never release it -- leaking the error object on every error path. This affects both production code (`CoreIPCSecTrust.mm`, `WKRemoteObjectCoder.mm`, `VirtualAuthenticatorUtils.mm`) and test code (`IPCSerialization.mm`, `Challenge.mm`, `WebTransport.mm`, `_WKWebAuthenticationPanel.mm`, `TestControllerCocoa.mm`).
Attachments
Add attachment
proposed patch, testcase, etc.
Radar WebKit Bug Importer
Comment 1
2026-04-15 13:52:08 PDT
<
rdar://problem/174864243
>
David Kilzer (:ddkilzer)
Comment 2
2026-04-15 16:46:39 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/62860
EWS
Comment 3
2026-04-17 08:35:25 PDT
Committed
311454@main
(12b5e059d376): <
https://commits.webkit.org/311454@main
> Reviewed commits have been landed. Closing PR #62860 and removing active labels.
EWS
Comment 4
2026-04-29 21:33:57 PDT
Committed
305413.773@safari-7624-branch
(ffded96c95cd): <
https://commits.webkit.org/305413.773@safari-7624-branch
> Reviewed commits have been landed. Closing PR #5126 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug