Use after free in Chromoting (CVE-2026-11224)
A use-after-free vulnerability exists in the Chrome Remote Desktop host's PamAuthorizer class, where a method dereferences 'this' after calling into an owned underlying authenticator that can synchronously destroy the wrapper. An attacker could potentially exploit this pre-authentication heap use-after-free to achieve control-flow hijack in the host process.
Originally disclosed on Chrome VRP
- Fix shipped in 50 days
Crash information
Type of crash: host process. remoting_me2me_host (Chrome Remote Desktop Linux host daemon). Not a browser tab or renderer crash. Reproduced inside the remoting_unittests ASAN binary, which links the production pam_authorization_factory_posix.cc source file unmodified.
Crash State (symbolized stack trace from ASAN):
==565990==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf11023f138 at pc 0x55f20edd5719 bp 0x7ffe375e3a70 sp 0x7ffe375e3a68
READ of size 4 at 0x7bf11023f138 thread T0
#0 remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
remoting/host/pam_authorization_factory_posix.cc:137:7
#1 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:119:3
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
#3 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc
#4 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11
#5 testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30
#6 testing::internal::UnitTestImpl::RunAllTests()
third_party/googletest/src/googletest/src/gtest.cc:6062:44
#7 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc
#8 base::TestSuite::Run() base/test/test_suite.cc:440:16
#9 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
base/functional/bind_internal.h:740:12
#10 base::OnceCallback<int ()>::Run() && base/functional/callback.h:155:12
#11 base::(anonymous namespace)::LaunchUnitTestsInternal(...)
base/test/launcher/unit_test_launcher.cc:189:38
#12 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>, unsigned long)
base/test/launcher/unit_test_launcher.cc:337:10
#13 main remoting/base/run_all_unittests.cc:60:10
0x7bf11023f138 is located 40 bytes inside of 48-byte region [0x7bf11023f110,0x7bf11023f140)
freed by thread T0 here:
#0 operator delete(void*, unsigned long) (remoting_unittests+0xf7151a2)
#1 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:74:5
(unique_ptr destructor chain, frees the PamAuthorizer wrapper)
#2 base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#3 remoting::(anonymous namespace)::TestUnderlyingAuthenticator::GetNextMessage()
remoting/host/pam_authorization_factory_posix_unittest.cc:76:27
#4 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:117:46
#5 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
previously allocated by thread T0 here:
#0 operator new(unsigned long) (remoting_unittests+0xf71459d)
#1 remoting::PamAuthorizationFactory::CreateAuthenticator(
const std::string& local_jid, const std::string& remote_jid)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:756:26
(PamAuthorizer constructed inside CreateAuthenticator)
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:156:19
SUMMARY: AddressSanitizer: heap-use-after-free
remoting/host/pam_authorization_factory_posix.cc:137:7
in remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
Crash-state fingerprint (top three frames, standard ClusterFuzz-style notation):
remoting::PamAuthorizer::MaybeCheckLocalLogin
remoting::PamAuthorizer::GetNextMessage
remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody
Registers and exception record are not applicable. This is a sanitizer-detected memory safety violation on Linux, not a hardware exception. ASAN aborts the process after printing the report above. The full, unredacted report (with shadow memory map and all 14 frames of each stack) is attached as asan-pam-uaf-20260414-152259.log.
Client ID: Not applicable. This is not a crash from a running Chrome browser with uploaded crash reports, so there is no Client ID or crash/ hash. The crash is reproduced from source, locally, against tip-of-tree Chromium. Build configuration:
- Target:
remoting_unittests - Output dir:
out/fuzz_asan - GN args:
is_asan=true use_libfuzzer=true is_debug=false is_component_build=false optimize_for_fuzzing=true - Toolchain: bundled Chromium clang (
CR_CLANG_REVISION=llvmorg-23-init-10931-g20b6ec66-1) - Host: Linux x86_64
Executive summary
PamAuthorizer is a Linux-only authenticator wrapper used by the Chrome Remote Desktop host (remoting_me2me_host). It owns a child underlying_ std::unique_ptr<protocol::Authenticator> and forwards calls to it. Two of its methods, GetNextMessage() and OnMessageProcessed(), dereference this after calling into underlying_, on the assumption that the child cannot cause this to be destroyed mid-call.
That assumption is wrong. Authenticators in this subsystem can synchronously cause their owning session (and therefore the wrapping PamAuthorizer) to be torn down from inside their own method bodies, via the state_change_after_accepted notification chain, or via any other synchronous state transition that the negotiating/session layer reacts to by destroying the Authenticator.
This is the same base::Unretained(this) plus "owned, so Unretained is safe" shape that crbug.com/501376612 identified and fixed in five sibling files in commit 174583c9fcf83:
remoting/protocol/negotiating_authenticator_base.ccremoting/protocol/negotiating_host_authenticator.ccremoting/protocol/validating_authenticator.ccremoting/protocol/pairing_authenticator_base.ccremoting/protocol/pairing_host_authenticator.cc
The fix in that commit replaced base::Unretained(this) with weak_factory_.GetWeakPtr() and added a WeakPtr re-check after the underlying call returns. The same shape in pam_authorization_factory_posix.cc was missed, including the incorrect safety comment:
// |underlying_| is owned, so Unretained() is safe here.
I built remoting_unittests with ASAN against current HEAD, added a unit test that drives the production callsite (PamAuthorizationFactory::CreateAuthenticator then PamAuthorizer::GetNextMessage then underlying_->GetNextMessage), and had the test trigger synchronous destruction of the PamAuthorizer from inside the underlying's GetNextMessage(). ASAN fires with a heap-use-after-free pointing at line 137 of the production source file, called from line 119.
Technical details
The buggy code
remoting/host/pam_authorization_factory_posix.cc:
116: JingleAuthentication PamAuthorizer::GetNextMessage() {
117: JingleAuthentication result = underlying_->GetNextMessage();
118: // PAM check may be performed once the state has transitioned to ACCEPTED.
119: MaybeCheckLocalLogin(); // UAF: `this` may be freed
120: return result; // by the line 117 call.
121: }
136: void PamAuthorizer::MaybeCheckLocalLogin() {
137: if (local_login_status_ == NOT_CHECKED && state() == ACCEPTED) { // read of freed `this`
...
And the same shape in the async path:
100: void PamAuthorizer::ProcessMessage(const JingleAuthentication& message,
101: base::OnceClosure resume_callback) {
102: // Always delegate to the underlying authenticator and let it manage its own
103: // state machine.
104: // |underlying_| is owned, so Unretained() is safe here.
105: underlying_->ProcessMessage(
106: message,
107: base::BindOnce(&PamAuthorizer::OnMessageProcessed, base::Unretained(this),
108: std::move(resume_callback)));
109: }
111: void PamAuthorizer::OnMessageProcessed(base::OnceClosure resume_callback) {
112: MaybeCheckLocalLogin(); // same UAF via BindOnce(Unretained(this))
113: std::move(resume_callback).Run();
114: }
Compare with the parent fix in sibling files (commit 174583c9fcf83), which removed the "owned, so Unretained() is safe here" comment and replaced base::Unretained(this) with weak_factory_.GetWeakPtr() plus an early-return check after the underlying call.
Why this can die inside underlying_->GetNextMessage()
Authenticator instances can be destroyed synchronously from inside their own methods through the NotifyStateChangeAfterAccepted then on_state_change_after_accepted_ callback chain. In production, that chain reaches the session / connection-manager layer, which reacts by tearing down the connection, destroying the top-level Authenticator it owns, which cascades into destroying the PamAuthorizer wrapper and, via its std::unique_ptr, the underlying_ that is still on the stack. That is the failure mode the parent fix addressed in the sibling classes. PamAuthorizer sits in the same ownership position and uses the same shape.
Proof
End-to-end ASAN reproduction built against tip-of-tree:
==565990==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf11023f138
READ of size 4 at 0x7bf11023f138 thread T0
#0 remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
remoting/host/pam_authorization_factory_posix.cc:137:7
#1 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:119:3
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
freed by thread T0 here:
#0 operator delete(void*, unsigned long)
#1 ... unique_ptr destructor chain ...
#3 remoting::(anonymous namespace)::TestUnderlyingAuthenticator::GetNextMessage()
#4 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:117:46
previously allocated by thread T0 here:
#0 operator new(unsigned long)
#1 remoting::PamAuthorizationFactory::CreateAuthenticator(...)
SUMMARY: AddressSanitizer: heap-use-after-free
remoting/host/pam_authorization_factory_posix.cc:137:7
in remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
The freed by stack ends inside underlying_->GetNextMessage() (line 117). The READ stack is line 119, the next statement after that call returns. That is the temporal relationship that commit 174583c9fcf83 fixed in the sibling authenticators.
Reproduction steps
Environment used: current Chromium HEAD (Linux x64), ASAN build (is_asan=true, use_libfuzzer=true, is_debug=false).
-
Apply the attached test (added to
remoting/host/BUILD.gnsource_set("unit_tests"), andpam_authorization_factory_posix.ccalso added to that source_set so its symbols are linked intoremoting_unittests):remoting/host/pam_authorization_factory_posix_unittest.ccdefines aTestUnderlyingAuthenticatorwhoseGetNextMessage()runs a trigger that synchronously drops the only strong reference to the wrappingPamAuthorizer(astd::unique_ptr<protocol::Authenticator>). It then callspam->GetNextMessage()through a saved raw pointer. This models what theon_state_change_after_accepted_chain does in production: the underlying authenticator's method runs a synchronous callback that tears down the owning session, destroying the wrapper.Full test source is attached as
pam_authorization_factory_posix_unittest.ccin the submission package. -
Build:
autoninja -C out/fuzz_asan remoting_unittests -
Run:
out/fuzz_asan/remoting_unittests \ --gtest_filter='PamAuthorizerUafTest.GetNextMessage_FreesThisDuringUnderlyingCall' -
ASAN report (verbatim from my local run, see
asan-pam-uaf-20260414-152259.log):
==565990==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf11023f138 at pc 0x55f20edd5719
READ of size 4 at 0x7bf11023f138 thread T0
#0 PamAuthorizer::MaybeCheckLocalLogin()
remoting/host/pam_authorization_factory_posix.cc:137:7
#1 PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:119:3
#2 PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
0x7bf11023f138 is located 40 bytes inside of 48-byte region [0x7bf11023f110,0x7bf11023f140)
freed by thread T0 here:
#0 operator delete(void*, unsigned long)
#3 TestUnderlyingAuthenticator::GetNextMessage()
remoting/host/pam_authorization_factory_posix_unittest.cc:76:27
#4 PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:117:46
previously allocated by thread T0 here:
#0 operator new(unsigned long)
#1 PamAuthorizationFactory::CreateAuthenticator(...)
SUMMARY: AddressSanitizer: heap-use-after-free
remoting/host/pam_authorization_factory_posix.cc:137:7
in PamAuthorizer::MaybeCheckLocalLogin()
- Applying the analogous fix (replace
base::Unretained(this)withweak_factory_.GetWeakPtr()inProcessMessage, and add a WeakPtr self-check between lines 117 and 119 inGetNextMessage, paralleling the sibling fix in commit174583c9fcf83) causes the test to pass with no ASAN report.
Impact
Attack surface: the Chrome Remote Desktop host authentication handshake.
PamAuthorizer wraps the top-level host authenticator for Linux CRD hosts. It processes authentication messages from the remote (attacker-controlled) client during the connection-initiation handshake, before PAM has authorized the user, i.e. pre-auth. The GetNextMessage / OnMessageProcessed entry points are driven by the XMPP/ICE signaling that a remote client sends. Any path that synchronously destroys the session's Authenticator from inside a state-change notification (connection rejection, policy failure, timeout racing with an accept, remote disconnect mid-handshake) can trip this UAF on the host process.
Why this is exploitable and impactful:
-
Pre-authentication heap UAF in a host process. The
remoting_me2me_hostdaemon runs as the logged-in user (and, for curtain-mode / it2me flows, as a service process). A UAF on its heap during handshake is exploitable for control-flow hijack given a typical heap grooming setup.PamAuthorizeris a small (~48 byte) object allocated from the general heap, it holds a vtable pointer, and the freed region is reused by subsequent allocations triggered by the same handshake turn (strings, protobufs, callback state). Because the bug is on the read side of a vtable-dispatched virtual call path (state()at line 137 is a virtual call into the freed object), overwriting the freed region with attacker-shaped data before line 137 runs produces a controlled virtual dispatch. -
Reachable from the network by a remote peer. The
GetNextMessage/ProcessMessagechain is what the Chromoting signaling subsystem calls in response tosession-initiate/session-accept/session-infostanzas received from the other end of the XMPP connection. The attacker controls message framing and can force the authenticator through its state machine, including the synchronous destroy path. -
Not mitigated by sandboxing. The Chrome Remote Desktop host is not the renderer sandbox; it is a long-running host binary that holds PAM tokens, opens X11 sockets and writes remote input into the local session. A UAF here compromises the user's entire desktop session, not a sandboxed tab.
-
No user interaction required after pairing. Once a host has been registered for a user, incoming connection attempts drive this code path without any local confirmation for
me2memode. A prior-paired (or policy-permitted) remote endpoint that has been compromised becomes a stepping-stone to the host's heap. -
The bug class has recent precedent and a just-landed partial fix. crbug.com/501376612 (fixed by
174583c9fcf83on 2026-04-11) acknowledged the shape of this vulnerability in five sibling files.
Attachments
pam_authorization_factory_posix_unittest.cc, the unit test that drives the production callsiteasan-pam-uaf-20260414-152259.log, the verbatim ASAN report from the local run- Reference: commit
174583c9fcf83("Fix more potential UaF instances", 2026-04-11), the parent fix that missed this file
CREDIT INFORMATION Externally reported security bugs may appear in Chrome release notes. If this bug is included, how would you like to be credited? Reporter credit: David Bors, Catalin Iovita
Context
Chrome Remote Desktop on Linux runs a host daemon called remoting_me2me_host. Before a remote client is allowed to drive the local desktop, the host runs an authentication handshake, and on Linux the host wraps its top-level authenticator in a class called PamAuthorizer, defined in remoting/host/pam_authorization_factory_posix.cc. PamAuthorizer is a thin wrapper: it owns a child underlying_ of type std::unique_ptr<protocol::Authenticator> and forwards authentication calls to it. After the underlying authenticator reports that the state has moved to ACCEPTED, the wrapper performs a PAM check of the local login through MaybeCheckLocalLogin().
The report describes a heap use-after-free in that wrapper, reproduced under AddressSanitizer against tip-of-tree Chromium. The crash is in the host process, not in a browser tab or renderer. It was reproduced inside the remoting_unittests ASAN binary, which links the production pam_authorization_factory_posix.cc source file unmodified.
Setup
The crash was reproduced locally from source, so there is no Client ID and no crash hash from an uploaded browser crash report. The build configuration given in the report is:
- Target:
remoting_unittests - Output dir:
out/fuzz_asan - GN args:
is_asan=true use_libfuzzer=true is_debug=false is_component_build=false optimize_for_fuzzing=true - Toolchain: bundled Chromium clang (
CR_CLANG_REVISION=llvmorg-23-init-10931-g20b6ec66-1) - Host: Linux x86_64
The reproduction needs a unit test added to remoting/host/BUILD.gn in source_set("unit_tests"), with pam_authorization_factory_posix.cc also added to that source set so its symbols are linked into remoting_unittests. The test file is remoting/host/pam_authorization_factory_posix_unittest.cc.
Finding it
PamAuthorizer dereferences this after calling into underlying_, on the assumption that the child cannot cause this to be destroyed in the middle of the call. The same base::Unretained(this) plus "owned, so Unretained is safe" shape had already been identified and fixed in five sibling files by crbug.com/501376612, in commit 174583c9fcf83:
remoting/protocol/negotiating_authenticator_base.ccremoting/protocol/negotiating_host_authenticator.ccremoting/protocol/validating_authenticator.ccremoting/protocol/pairing_authenticator_base.ccremoting/protocol/pairing_host_authenticator.cc
That commit replaced base::Unretained(this) with weak_factory_.GetWeakPtr() and added a WeakPtr re-check after the underlying call returns. The same shape in pam_authorization_factory_posix.cc was missed, including the incorrect safety comment.
The buggy code in remoting/host/pam_authorization_factory_posix.cc:
116: JingleAuthentication PamAuthorizer::GetNextMessage() {
117: JingleAuthentication result = underlying_->GetNextMessage();
118: // PAM check may be performed once the state has transitioned to ACCEPTED.
119: MaybeCheckLocalLogin(); // UAF: `this` may be freed
120: return result; // by the line 117 call.
121: }
136: void PamAuthorizer::MaybeCheckLocalLogin() {
137: if (local_login_status_ == NOT_CHECKED && state() == ACCEPTED) { // read of freed `this`
...
The same shape appears in the asynchronous path:
100: void PamAuthorizer::ProcessMessage(const JingleAuthentication& message,
101: base::OnceClosure resume_callback) {
102: // Always delegate to the underlying authenticator and let it manage its own
103: // state machine.
104: // |underlying_| is owned, so Unretained() is safe here.
105: underlying_->ProcessMessage(
106: message,
107: base::BindOnce(&PamAuthorizer::OnMessageProcessed, base::Unretained(this),
108: std::move(resume_callback)));
109: }
111: void PamAuthorizer::OnMessageProcessed(base::OnceClosure resume_callback) {
112: MaybeCheckLocalLogin(); // same UAF via BindOnce(Unretained(this))
113: std::move(resume_callback).Run();
114: }
Exploitation
Step 1: Add a test that drives the production callsite
The test defines a TestUnderlyingAuthenticator whose GetNextMessage() runs a trigger that synchronously drops the only strong reference to the wrapping PamAuthorizer (a std::unique_ptr<protocol::Authenticator>). It then calls pam->GetNextMessage() through a saved raw pointer. This models what the on_state_change_after_accepted_ chain does in production: the underlying authenticator's method runs a synchronous callback that tears down the owning session, destroying the wrapper. The test drives the production path PamAuthorizationFactory::CreateAuthenticator, then PamAuthorizer::GetNextMessage, then underlying_->GetNextMessage. The full test source is attached to the submission as pam_authorization_factory_posix_unittest.cc.
Step 2: Build
autoninja -C out/fuzz_asan remoting_unittests
Step 3: Run the test
out/fuzz_asan/remoting_unittests \
--gtest_filter='PamAuthorizerUafTest.GetNextMessage_FreesThisDuringUnderlyingCall'
Step 4: Read the ASAN report
The run produces the following report, verbatim from the local run (also attached as asan-pam-uaf-20260414-152259.log):
==565990==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf11023f138 at pc 0x55f20edd5719 bp 0x7ffe375e3a70 sp 0x7ffe375e3a68
READ of size 4 at 0x7bf11023f138 thread T0
#0 remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
remoting/host/pam_authorization_factory_posix.cc:137:7
#1 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:119:3
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
#3 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc
#4 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11
#5 testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30
#6 testing::internal::UnitTestImpl::RunAllTests()
third_party/googletest/src/googletest/src/gtest.cc:6062:44
#7 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc
#8 base::TestSuite::Run() base/test/test_suite.cc:440:16
#9 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
base/functional/bind_internal.h:740:12
#10 base::OnceCallback<int ()>::Run() && base/functional/callback.h:155:12
#11 base::(anonymous namespace)::LaunchUnitTestsInternal(...)
base/test/launcher/unit_test_launcher.cc:189:38
#12 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>, unsigned long)
base/test/launcher/unit_test_launcher.cc:337:10
#13 main remoting/base/run_all_unittests.cc:60:10
0x7bf11023f138 is located 40 bytes inside of 48-byte region [0x7bf11023f110,0x7bf11023f140)
freed by thread T0 here:
#0 operator delete(void*, unsigned long) (remoting_unittests+0xf7151a2)
#1 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:74:5
(unique_ptr destructor chain, frees the PamAuthorizer wrapper)
#2 base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#3 remoting::(anonymous namespace)::TestUnderlyingAuthenticator::GetNextMessage()
remoting/host/pam_authorization_factory_posix_unittest.cc:76:27
#4 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:117:46
#5 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
previously allocated by thread T0 here:
#0 operator new(unsigned long) (remoting_unittests+0xf71459d)
#1 remoting::PamAuthorizationFactory::CreateAuthenticator(
const std::string& local_jid, const std::string& remote_jid)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:756:26
(PamAuthorizer constructed inside CreateAuthenticator)
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:156:19
SUMMARY: AddressSanitizer: heap-use-after-free
remoting/host/pam_authorization_factory_posix.cc:137:7
in remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
The freed by stack ends inside underlying_->GetNextMessage() at line 117. The READ stack is line 119, the next statement after that call returns. That temporal relationship is exactly what commit 174583c9fcf83 fixed in the sibling authenticators. The freed region is 48 bytes, and the read is 40 bytes into it.
The crash-state fingerprint, in standard ClusterFuzz-style notation, is the top three frames:
remoting::PamAuthorizer::MaybeCheckLocalLogin
remoting::PamAuthorizer::GetNextMessage
remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody
Registers and exception records do not apply: this is a sanitizer-detected memory safety violation on Linux, not a hardware exception. ASAN aborts the process after printing the report. The full, unredacted report, with shadow memory map and all 14 frames of each stack, is attached as asan-pam-uaf-20260414-152259.log.
Step 5: Confirm the fix
Applying the analogous fix, replacing base::Unretained(this) with weak_factory_.GetWeakPtr() in ProcessMessage and adding a WeakPtr self-check between lines 117 and 119 in GetNextMessage, paralleling the sibling fix in commit 174583c9fcf83, causes the test to pass with no ASAN report.
Root cause
PamAuthorizer assumes that its owned child cannot cause this to be destroyed mid-call. That assumption is wrong. Authenticators in this subsystem can synchronously cause their owning session, and therefore the wrapping PamAuthorizer, to be torn down from inside their own method bodies, through the state_change_after_accepted notification chain or through any other synchronous state transition that the negotiating or session layer reacts to by destroying the Authenticator.
Concretely, Authenticator instances can be destroyed synchronously from inside their own methods through the NotifyStateChangeAfterAccepted then on_state_change_after_accepted_ callback chain. In production that chain reaches the session or connection-manager layer, which reacts by tearing down the connection, destroying the top-level Authenticator it owns. That cascades into destroying the PamAuthorizer wrapper and, through its std::unique_ptr, the underlying_ that is still on the stack. PamAuthorizer sits in the same ownership position as the sibling classes and uses the same shape, so the same reasoning applies.
The existing defence was the comment // |underlying_| is owned, so Unretained() is safe here., which is the mistaken premise itself. The parent fix in commit 174583c9fcf83 ("Fix more potential UaF instances", 2026-04-11) removed that comment and replaced base::Unretained(this) with weak_factory_.GetWeakPtr() plus an early-return check after the underlying call in the five sibling files, but missed this one.
Impact
The attack surface is the Chrome Remote Desktop host authentication handshake. PamAuthorizer wraps the top-level host authenticator for Linux CRD hosts. It processes authentication messages from the remote, attacker-controlled client during the connection-initiation handshake, before PAM has authorised the user, so the code is reachable pre-authentication. The GetNextMessage and OnMessageProcessed entry points are driven by the XMPP/ICE signalling that a remote client sends. Any path that synchronously destroys the session's Authenticator from inside a state-change notification (connection rejection, policy failure, a timeout racing with an accept, a remote disconnect mid-handshake) can trip this use-after-free on the host process.
The report gives five reasons why this is exploitable and impactful:
- Pre-authentication heap use-after-free in a host process. The
remoting_me2me_hostdaemon runs as the logged-in user, and for curtain-mode or it2me flows as a service process. A use-after-free on its heap during the handshake is exploitable for control-flow hijack given a typical heap grooming setup.PamAuthorizeris a small (about 48 byte) object allocated from the general heap, it holds a vtable pointer, and the freed region is reused by subsequent allocations triggered by the same handshake turn (strings, protobufs, callback state). Because the bug is on the read side of a vtable-dispatched virtual call path (state()at line 137 is a virtual call into the freed object), overwriting the freed region with attacker-shaped data before line 137 runs produces a controlled virtual dispatch. - Reachable from the network by a remote peer. The
GetNextMessage/ProcessMessagechain is what the Chromoting signalling subsystem calls in response tosession-initiate,session-acceptandsession-infostanzas received from the other end of the XMPP connection. The attacker controls message framing and can force the authenticator through its state machine, including the synchronous destroy path. - Not mitigated by sandboxing. The Chrome Remote Desktop host is not the renderer sandbox. It is a long-running host binary that holds PAM tokens, opens X11 sockets and writes remote input into the local session. A use-after-free here compromises the user's entire desktop session, not a sandboxed tab.
- No user interaction required after pairing. Once a host has been registered for a user, incoming connection attempts drive this code path without any local confirmation for
me2memode. A prior-paired or policy-permitted remote endpoint that has been compromised becomes a stepping-stone to the host's heap. - Recent precedent and a just-landed partial fix. crbug.com/501376612, fixed by
174583c9fcf83on 2026-04-11, acknowledged the shape of this vulnerability in five sibling files.
Fix
Applying the analogous change to the sibling fix in commit 174583c9fcf83, replacing base::Unretained(this) with weak_factory_.GetWeakPtr() in ProcessMessage and adding a WeakPtr self-check between lines 117 and 119 in GetNextMessage, makes the reproduction test pass with no ASAN report. With that change the reproduction test passes with no ASAN report. The report does not state whether this change had landed in the tree at the time of writing.
Variants to test
- Other authenticator wrappers with the same ownership comment. Search the tree for
Unretained(this)next to comments claiming ownership makes it safe, particularly in classes that own a childAuthenticatorand forward calls to it. A positive result is a wrapper that dereferencesthisafter a call into the child, with no WeakPtr check on return. - Synchronous destruction through
on_state_change_after_accepted_. For any authenticator that can be destroyed from inside its own method via the state-change notification chain, check whether the caller reads member state after the call returns. A positive result is a stack where the free happens inside the callee and the read happens in the caller's next statement. - The asynchronous
BindOncepath. Look forbase::BindOncewithbase::Unretained(this)where the bound method runs after a call that can tear down the owning session. A positive result is a callback that fires on a freed object, as inOnMessageProcessed. - Other platforms' host authenticators. A positive result is the same free-then-read ordering under ASAN.
- Handshake state transitions driven by remote stanzas. Exercise
session-initiate,session-acceptandsession-infohandling with rejection, policy failure, timeout racing with accept, and mid-handshake disconnect. A positive result is a host-process ASAN report with a use-after-free in the authenticator wrapper.
What happened, in plain words
Chrome Remote Desktop lets you use one computer from another one, over the internet. On the computer being controlled (the "host"), a small background program runs all the time and waits for someone to connect. Before it lets a remote person take control, it checks who is asking, in a process called a handshake. On Linux, part of that check is done by a piece of code called PamAuthorizer.
This report describes a memory bug in that code. In simple terms, the program throws away a small piece of information and then, a moment later, tries to read it again. Reading memory that has already been given back is called a use-after-free. The report shows how to make this happen reliably with a test, explains why it matters (the host program runs with the user's own permissions and is reachable over the network), and shows a candidate change that makes the test pass.
A few words before we start, because they come up constantly:
- Memory is the working space a program uses to hold data while it runs. The operating system hands out chunks of it on request and takes them back when the program says it is finished with them.
- A pointer is a note that says "the data you want is at this spot in memory". If the data has been given back, the note still points at the old spot, but whatever is there now belongs to someone else.
- A use-after-free is what happens when a program keeps using such a note after the data was returned. It is like keeping the key to a hotel room after checking out: the room may now be occupied by a different guest, and walking in is both wrong and potentially dangerous.
- A daemon is a program that runs in the background without a window, waiting to do a job.
- PAM (Pluggable Authentication Modules) is the standard Linux machinery for checking a user's identity, for example by asking for a password.
Context
Chrome Remote Desktop on Linux runs a host daemon called remoting_me2me_host. "me2me" means "me to me": you connect from one of your own machines to another of your own machines. Before a remote client is allowed to drive the local desktop, the host runs an authentication handshake. On Linux the host wraps its top-level authenticator in a class called PamAuthorizer, defined in remoting/host/pam_authorization_factory_posix.cc.
Some vocabulary for that sentence:
- A class is a blueprint in code that bundles data together with the operations that work on it. When the program actually creates one, the result is called an object.
- An authenticator is the part of the program responsible for deciding whether the other side is allowed in. It exchanges messages with the remote client and moves through states such as "still negotiating" and "accepted".
- A wrapper is an object that sits around another object and passes calls through to it, usually adding a little extra behaviour on the way. Think of a phone case: the phone does the work, the case is what you hold.
PamAuthorizer is a thin wrapper: it owns a child underlying_ of type std::unique_ptr<protocol::Authenticator> and forwards authentication calls to it. After the underlying authenticator reports that the state has moved to ACCEPTED, the wrapper performs a PAM check of the local login through MaybeCheckLocalLogin().
Two more terms from that paragraph:
std::unique_ptris a C++ construct that means "this object is the single owner of that other object, and when I am destroyed, the thing I own is destroyed too". It is like a pet owner: when the owner leaves, the pet goes with them. Because there is exactly one owner, nobody has to argue about who is responsible for cleaning up.ACCEPTEDis one of the named states the handshake can be in. It means the negotiation has succeeded.
The report describes a heap use-after-free in that wrapper, reproduced under AddressSanitizer against tip-of-tree Chromium. The crash is in the host process, not in a browser tab or renderer. It was reproduced inside the remoting_unittests ASAN binary, which links the production pam_authorization_factory_posix.cc source file unmodified.
- The heap is the general-purpose pool of memory a program uses for objects it creates while running, as opposed to the small, strictly organised area used for local variables.
- AddressSanitizer (ASAN) is a tool built into a special version of the program that watches every memory access. When the program touches memory it should not, ASAN stops it and prints a detailed report. It is like a building inspector who follows every worker and shouts the moment someone enters a condemned room.
- Tip-of-tree means the very latest code in the project's main development line, before any release.
- A renderer is the part of a browser that draws a page. Browsers put renderers in a sandbox, a restricted box that limits the damage if they are compromised. The host daemon here is not in that box, which matters later.
- A unit test is a small program written to exercise one specific piece of code and check that it behaves.
remoting_unittestsis the collection of such tests for the remote desktop code.
Setup
The crash was reproduced locally from source, so there is no Client ID and no crash hash from an uploaded browser crash report. When a normal Chrome browser crashes, it can send a report home tagged with an identifier; here the researcher built the program themselves and made it crash on purpose, so none of that applies. The build configuration given in the report is:
- Target:
remoting_unittests - Output dir:
out/fuzz_asan - GN args:
is_asan=true use_libfuzzer=true is_debug=false is_component_build=false optimize_for_fuzzing=true - Toolchain: bundled Chromium clang (
CR_CLANG_REVISION=llvmorg-23-init-10931-g20b6ec66-1) - Host: Linux x86_64
What each line means:
- Target is the name of the thing being built. Here it is the test program.
- Output dir is the folder where the built files land.
- GN args are build settings.
is_asan=trueturns on AddressSanitizer.is_debug=falsebuilds an optimised version rather than a slow debugging one.is_component_build=falseproduces one large program instead of many small shared pieces.optimize_for_fuzzing=trueanduse_libfuzzer=trueare settings aimed at fuzzing, the technique of feeding a program large amounts of generated input to find crashes. - Toolchain is the compiler, the program that turns source code into a runnable program. Chromium ships its own version of the clang compiler, identified by that revision string.
- Host is the machine the build ran on: ordinary 64-bit Linux.
The reproduction needs a unit test added to remoting/host/BUILD.gn in source_set("unit_tests"), with pam_authorization_factory_posix.cc also added to that source set so its symbols are linked into remoting_unittests. The test file is remoting/host/pam_authorization_factory_posix_unittest.cc.
BUILD.gn is a build recipe file: it lists which source files go into which program. A source set is a named group of source files. Symbols are the names of functions and objects inside compiled code; for the test to call the real PamAuthorizer code, that code has to be compiled into the same program, which is why the production file is added to the group.
Finding it
PamAuthorizer dereferences this after calling into underlying_, on the assumption that the child cannot cause this to be destroyed in the middle of the call.
thisis how a C++ object refers to itself inside its own methods. When you call a method on an object,thisis that object.- Dereferencing means following a pointer to actually read or write the data it points at.
The same base::Unretained(this) plus "owned, so Unretained is safe" shape had already been identified and fixed in five sibling files by crbug.com/501376612, in commit 174583c9fcf83:
remoting/protocol/negotiating_authenticator_base.ccremoting/protocol/negotiating_host_authenticator.ccremoting/protocol/validating_authenticator.ccremoting/protocol/pairing_authenticator_base.ccremoting/protocol/pairing_host_authenticator.cc
Some background on that sentence:
base::Unretained(this)is a Chromium helper used when scheduling a callback, meaning "call this method later, and do not keep the object alive in the meantime". It is a promise that the object will still exist when the callback fires. If that promise is broken, the callback runs on memory that may already be gone.- A callback is a piece of code you hand to someone else, to be run later. Like leaving a note saying "when the parcel arrives, open it and call me".
- A commit is a recorded change to the project's code, with an identifier. crbug.com/501376612 is the number of the bug report in Chromium's tracker.
- Sibling files here means other files in the same area of the code that do a similar job.
That commit replaced base::Unretained(this) with weak_factory_.GetWeakPtr() and added a WeakPtr re-check after the underlying call returns. The same shape in pam_authorization_factory_posix.cc was missed, including the incorrect safety comment.
A WeakPtr is a reference that does not keep an object alive and can tell you whether the object still exists. Where Unretained is a promise, a WeakPtr is a question you can ask: "are you still there?". The fix pattern is to ask that question after the call returns, and to stop if the answer is no.
The buggy code in remoting/host/pam_authorization_factory_posix.cc:
116: JingleAuthentication PamAuthorizer::GetNextMessage() {
117: JingleAuthentication result = underlying_->GetNextMessage();
118: // PAM check may be performed once the state has transitioned to ACCEPTED.
119: MaybeCheckLocalLogin(); // UAF: `this` may be freed
120: return result; // by the line 117 call.
121: }
136: void PamAuthorizer::MaybeCheckLocalLogin() {
137: if (local_login_status_ == NOT_CHECKED && state() == ACCEPTED) { // read of freed `this`
...
Line by line:
- Line 116 starts the method
GetNextMessage, which asks the authenticator for the next handshake message. The numbers on the left are line numbers in the file, included so the reader can find the exact spot. - Line 117 calls the same method on the child object
underlying_and stores the answer inresult. The arrow->means "go to the object this pointer refers to and call its method". This is the dangerous call: while it runs, the child may cause the wrapper itself to be destroyed. - Line 118 is a comment, ignored by the computer, explaining that the PAM check happens once the state is
ACCEPTED. - Line 119 calls
MaybeCheckLocalLogin(). The comment beside it marks the use-after-free: by this pointthismay already have been freed by the call on line 117. - Line 120 returns the saved result. The comment notes the same problem: the object may be gone by now.
- Line 121 closes the method.
- Line 136 starts
MaybeCheckLocalLogin. - Line 137 reads two things from the object: the member
local_login_status_and the result ofstate(). If the object has been freed, this is the read of freed memory that ASAN catches.
The same shape appears in the asynchronous path:
100: void PamAuthorizer::ProcessMessage(const JingleAuthentication& message,
101: base::OnceClosure resume_callback) {
102: // Always delegate to the underlying authenticator and let it manage its own
103: // state machine.
104: // |underlying_| is owned, so Unretained() is safe here.
105: underlying_->ProcessMessage(
106: message,
107: base::BindOnce(&PamAuthorizer::OnMessageProcessed, base::Unretained(this),
108: std::move(resume_callback)));
109: }
111: void PamAuthorizer::OnMessageProcessed(base::OnceClosure resume_callback) {
112: MaybeCheckLocalLogin(); // same UAF via BindOnce(Unretained(this))
113: std::move(resume_callback).Run();
114: }
Line by line:
- Lines 100 and 101 start
ProcessMessage, which takes an incoming handshake message and aresume_callback, a piece of code to run when processing is finished.base::OnceClosureis Chromium's name for a callback that can be run exactly once. - Lines 102 and 103 are comments: the wrapper always hands the work to the child and lets the child manage its own state machine, meaning its own set of states and allowed transitions.
- Line 104 is the mistaken safety comment: because the child is owned, the author believed
Unretainedwas safe here. This is the premise the whole bug rests on. - Lines 105 to 108 call
ProcessMessageon the child, passing the message and a callback.base::BindOncepackages up a method to call later together with its arguments.base::Unretained(this)says "do not keep this object alive for the callback".std::move(resume_callback)hands the resume callback over to the child. - Line 109 closes the method.
- Line 111 starts
OnMessageProcessed, the method that will run later. - Line 112 calls
MaybeCheckLocalLogin()onthis. If the object was destroyed in the meantime, this is the same use-after-free, reached through the callback instead of through a direct call. - Line 113 runs the saved resume callback, again on a possibly dead object.
- Line 114 closes the method.
Exploitation
Step 1: Add a test that drives the production callsite
The test defines a TestUnderlyingAuthenticator whose GetNextMessage() runs a trigger that synchronously drops the only strong reference to the wrapping PamAuthorizer (a std::unique_ptr<protocol::Authenticator>). It then calls pam->GetNextMessage() through a saved raw pointer. This models what the on_state_change_after_accepted_ chain does in production: the underlying authenticator's method runs a synchronous callback that tears down the owning session, destroying the wrapper. The test drives the production path PamAuthorizationFactory::CreateAuthenticator, then PamAuthorizer::GetNextMessage, then underlying_->GetNextMessage. The full test source is attached to the submission as pam_authorization_factory_posix_unittest.cc.
Unpacking that:
- A fake child.
TestUnderlyingAuthenticatoris a stand-in for the real child authenticator, written only for the test. It behaves like the real one in the one way that matters: when asked for the next message, it does something that destroys the wrapper. - Synchronously means "right now, before the call returns", as opposed to later on some other schedule. This timing is the whole point: the destruction happens while the wrapper's own method is still on the stack, halfway through its work.
- Dropping the only strong reference. The wrapper is held by a
std::unique_ptr, the single owner. When that owner is reset or destroyed, the wrapper is destroyed immediately. There is no other owner to keep it alive. - A raw pointer is a plain memory address with no ownership attached. The test keeps one so it can still call
pam->GetNextMessage()after the object has been freed, which is exactly the mistake the production code makes. on_state_change_after_accepted_is a notification the authenticator sends when its state changes after acceptance. In the real program, that notification travels up to the session layer, which may decide to tear the connection down, destroying the authenticator and everything it owns, including the wrapper.
The reason for writing a test rather than just reasoning about the code is that a test proves the sequence is possible and gives ASAN a chance to catch it. Reasoning can be wrong; a crash report cannot.
Step 2: Build
autoninja -C out/fuzz_asan remoting_unittests
This command compiles the test program. autoninja is Chromium's build driver, which figures out which files need recompiling and runs the compiler. -C out/fuzz_asan says "work in the output folder out/fuzz_asan", the same folder named in the build settings. remoting_unittests is the target to build. The step exists because the test has to be compiled together with the production source file before it can be run.
Step 3: Run the test
out/fuzz_asan/remoting_unittests \
--gtest_filter='PamAuthorizerUafTest.GetNextMessage_FreesThisDuringUnderlyingCall'
This runs the built program. The first part is the path to the executable. The backslash at the end of the line is a shell convention meaning "the command continues on the next line". --gtest_filter tells the test framework to run only the named test instead of the whole suite, which saves time and keeps the output focused. The name itself describes the scenario: a test in the PamAuthorizerUafTest group, called GetNextMessage_FreesThisDuringUnderlyingCall, meaning "get the next message, and free this object during the underlying call".
Step 4: Read the ASAN report
The run produces the following report, verbatim from the local run (also attached as asan-pam-uaf-20260414-152259.log):
==565990==ERROR: AddressSanitizer: heap-use-after-free on address 0x7bf11023f138 at pc 0x55f20edd5719 bp 0x7ffe375e3a70 sp 0x7ffe375e3a68
READ of size 4 at 0x7bf11023f138 thread T0
#0 remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
remoting/host/pam_authorization_factory_posix.cc:137:7
#1 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:119:3
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
#3 testing::Test::Run() third_party/googletest/src/googletest/src/gtest.cc
#4 testing::TestInfo::Run() third_party/googletest/src/googletest/src/gtest.cc:2892:11
#5 testing::TestSuite::Run() third_party/googletest/src/googletest/src/gtest.cc:3070:30
#6 testing::internal::UnitTestImpl::RunAllTests()
third_party/googletest/src/googletest/src/gtest.cc:6062:44
#7 testing::UnitTest::Run() third_party/googletest/src/googletest/src/gtest.cc
#8 base::TestSuite::Run() base/test/test_suite.cc:440:16
#9 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
base/functional/bind_internal.h:740:12
#10 base::OnceCallback<int ()>::Run() && base/functional/callback.h:155:12
#11 base::(anonymous namespace)::LaunchUnitTestsInternal(...)
base/test/launcher/unit_test_launcher.cc:189:38
#12 base::LaunchUnitTests(int, char**, base::OnceCallback<int ()>, unsigned long)
base/test/launcher/unit_test_launcher.cc:337:10
#13 main remoting/base/run_all_unittests.cc:60:10
0x7bf11023f138 is located 40 bytes inside of 48-byte region [0x7bf11023f110,0x7bf11023f140)
freed by thread T0 here:
#0 operator delete(void*, unsigned long) (remoting_unittests+0xf7151a2)
#1 base::internal::Invoker<...>::RunOnce(base::internal::BindStateBase*)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:74:5
(unique_ptr destructor chain, frees the PamAuthorizer wrapper)
#2 base::OnceCallback<void ()>::Run() && base/functional/callback.h:155:12
#3 remoting::(anonymous namespace)::TestUnderlyingAuthenticator::GetNextMessage()
remoting/host/pam_authorization_factory_posix_unittest.cc:76:27
#4 remoting::(anonymous namespace)::PamAuthorizer::GetNextMessage()
remoting/host/pam_authorization_factory_posix.cc:117:46
#5 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:167:26
previously allocated by thread T0 here:
#0 operator new(unsigned long) (remoting_unittests+0xf71459d)
#1 remoting::PamAuthorizationFactory::CreateAuthenticator(
const std::string& local_jid, const std::string& remote_jid)
gen/third_party/libc++/src/include/__memory/unique_ptr.h:756:26
(PamAuthorizer constructed inside CreateAuthenticator)
#2 remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody()
remoting/host/pam_authorization_factory_posix_unittest.cc:156:19
SUMMARY: AddressSanitizer: heap-use-after-free
remoting/host/pam_authorization_factory_posix.cc:137:7
in remoting::(anonymous namespace)::PamAuthorizer::MaybeCheckLocalLogin()
How to read it, section by section:
- The first line is the headline.
==565990==is the process number.heap-use-after-freeis the verdict.on address 0x7bf11023f138is the memory location involved.pc,bpandspare the program counter, base pointer and stack pointer, the processor's record of where it was executing and where its local working area was. READ of size 4means the program tried to read four bytes.thread T0means the main thread, the program's single line of execution here.- The numbered
#0,#1, ... lines are the call stack: the chain of function calls that led to the bad read, with the most recent call first.#0isMaybeCheckLocalLoginat line 137, the read itself.#1isGetNextMessageat line 119, the caller.#2is the test body. The rest are the test framework and program startup, which are only there to show the full path. - The line about the 48-byte region says the address being read is 40 bytes into a 48-byte block of memory. In other words, the object was small, and the read landed near its end.
- The
freed bysection is the history of how that memory was released.operator deleteis the C++ operation that gives memory back. Theunique_ptrdestructor chain is the owner being destroyed, which frees the wrapper. The call came fromTestUnderlyingAuthenticator::GetNextMessageat line 76 of the test file, which was itself called fromPamAuthorizer::GetNextMessageat line 117 of the production file. That is the crucial detail: the free happened inside the call on line 117. - The
previously allocated bysection is where the memory originally came from.operator newis the C++ operation that requests memory.PamAuthorizationFactory::CreateAuthenticatoris the function that built the wrapper in the first place. - The
SUMMARYrepeats the verdict and points at the exact source line: line 137 of the production file, insideMaybeCheckLocalLogin.
The freed by stack ends inside underlying_->GetNextMessage() at line 117. The READ stack is line 119, the next statement after that call returns. That temporal relationship is exactly what commit 174583c9fcf83 fixed in the sibling authenticators. The freed region is 48 bytes, and the read is 40 bytes into it.
The crash-state fingerprint, in standard ClusterFuzz-style notation, is the top three frames:
remoting::PamAuthorizer::MaybeCheckLocalLogin
remoting::PamAuthorizer::GetNextMessage
remoting::PamAuthorizerUafTest_GetNextMessage_FreesThisDuringUnderlyingCall_Test::TestBody
A fingerprint is a short signature made from the top of a crash's call stack. Two crashes with the same fingerprint are treated as the same bug, which lets a bug tracker group thousands of reports automatically. ClusterFuzz is Google's system for running programs on huge amounts of generated input and grouping the crashes it finds.
Registers and exception records do not apply: this is a sanitizer-detected memory safety violation on Linux, not a hardware exception. Registers are the processor's tiny built-in storage slots, and an exception record is what the operating system writes when the processor itself faults, for example on a division by zero. Neither is involved here, because the processor did nothing wrong: the program read memory that was still mapped and readable, and only the ASAN instrumentation knew it had been freed. ASAN aborts the process after printing the report. The full, unredacted report, with shadow memory map and all 14 frames of each stack, is attached as asan-pam-uaf-20260414-152259.log.
A shadow memory map is ASAN's own bookkeeping: for every chunk of the program's memory it keeps a note saying whether that chunk is currently valid. That is how it can tell instantly that a read is illegal.
Step 5: Confirm the fix
Applying the analogous fix, replacing base::Unretained(this) with weak_factory_.GetWeakPtr() in ProcessMessage and adding a WeakPtr self-check between lines 117 and 119 in GetNextMessage, paralleling the sibling fix in commit 174583c9fcf83, causes the test to pass with no ASAN report.
In plain terms: instead of promising the object will still be alive, the code now asks whether it is alive before touching it, and stops quietly if it is not. The test that used to crash now finishes cleanly, which is the evidence that the diagnosis was right.
Root cause
PamAuthorizer assumes that its owned child cannot cause this to be destroyed mid-call. That assumption is wrong. Authenticators in this subsystem can synchronously cause their owning session, and therefore the wrapping PamAuthorizer, to be torn down from inside their own method bodies, through the state_change_after_accepted notification chain or through any other synchronous state transition that the negotiating or session layer reacts to by destroying the Authenticator.
The everyday comparison: you ask a colleague to fetch a file from a room, and while they are in there they lock the building and switch off the lights. When they come back and you reach for the light switch, the room is no longer yours to use. Ownership of an object does not protect you from code that runs during your call and tears the whole structure down.
Concretely, Authenticator instances can be destroyed synchronously from inside their own methods through the NotifyStateChangeAfterAccepted then on_state_change_after_accepted_ callback chain. In production that chain reaches the session or connection-manager layer, which reacts by tearing down the connection, destroying the top-level Authenticator it owns. That cascades into destroying the PamAuthorizer wrapper and, through its std::unique_ptr, the underlying_ that is still on the stack. PamAuthorizer sits in the same ownership position as the sibling classes and uses the same shape, so the same reasoning applies.
A session here is one live remote-desktop connection and the objects that manage it. The connection-manager layer is the code that decides when a connection should be closed. Cascades means one destruction triggers the next, like a row of dominoes: the session goes, the top-level authenticator it owns goes, the wrapper goes, and the child the wrapper owns goes, all while the wrapper's own method is still running.
The existing defence was the comment // |underlying_| is owned, so Unretained() is safe here., which is the mistaken premise itself. The parent fix in commit 174583c9fcf83 ("Fix more potential UaF instances", 2026-04-11) removed that comment and replaced base::Unretained(this) with weak_factory_.GetWeakPtr() plus an early-return check after the underlying call in the five sibling files, but missed this one.
"UaF" in that commit message is shorthand for use-after-free. "Potential" because the same pattern is dangerous even where nobody had yet demonstrated a crash.
Impact
The attack surface is the Chrome Remote Desktop host authentication handshake. Attack surface means all the ways an outsider can send input into a program. PamAuthorizer wraps the top-level host authenticator for Linux CRD hosts. It processes authentication messages from the remote, attacker-controlled client during the connection-initiation handshake, before PAM has authorised the user, so the code is reachable pre-authentication. Pre-authentication means before any password or credential has been checked: the attacker does not need an account or a valid login to reach this code.
The GetNextMessage and OnMessageProcessed entry points are driven by the XMPP/ICE signalling that a remote client sends. XMPP is a messaging protocol, and ICE is the set of techniques two machines use to establish a direct connection through the internet's obstacles. Signalling is the exchange of setup messages between the two ends before the actual data connection exists. Any path that synchronously destroys the session's Authenticator from inside a state-change notification (connection rejection, policy failure, a timeout racing with an accept, a remote disconnect mid-handshake) can trip this use-after-free on the host process.
The report gives five reasons why this is exploitable and impactful:
-
Pre-authentication heap use-after-free in a host process. The
remoting_me2me_hostdaemon runs as the logged-in user, and for curtain-mode or it2me flows as a service process. A use-after-free on its heap during the handshake is exploitable for control-flow hijack given a typical heap grooming setup.PamAuthorizeris a small (about 48 byte) object allocated from the general heap, it holds a vtable pointer, and the freed region is reused by subsequent allocations triggered by the same handshake turn (strings, protobufs, callback state). Because the bug is on the read side of a vtable-dispatched virtual call path (state()at line 137 is a virtual call into the freed object), overwriting the freed region with attacker-shaped data before line 137 runs produces a controlled virtual dispatch.This paragraph is dense, so here is each piece:
- Curtain mode is a remote desktop mode where the local screen is blanked while someone is connected. it2me means "IT to me", where a support person connects to a user's machine.
- Control-flow hijack means making the program run the attacker's chosen code instead of its own. It is the difference between a burglar who can only look around a house and one who can rewire it.
- Heap grooming means arranging memory allocations so that a freed block is predictably reused by data the attacker controls. Like clearing a shelf so that the next item placed there is yours.
- A vtable is a table of function addresses that C++ uses to decide which version of a method to call on an object. Every object of such a class carries a hidden pointer to its vtable. If an attacker can overwrite that pointer in freed memory, the next method call jumps wherever the attacker says.
- A virtual call is a call resolved through the vtable at runtime rather than fixed at compile time.
state()on line 137 is one, which is why the read is so valuable to an attacker. - Protobufs are Google's format for serialised structured messages, used heavily in this kind of protocol code.
-
Reachable from the network by a remote peer. The
GetNextMessage/ProcessMessagechain is what the Chromoting signalling subsystem calls in response tosession-initiate,session-acceptandsession-infostanzas received from the other end of the XMPP connection. The attacker controls message framing and can force the authenticator through its state machine, including the synchronous destroy path. A stanza is a single structured message in XMPP. Message framing means how the bytes are split into messages, which the sender decides. -
Not mitigated by sandboxing. The Chrome Remote Desktop host is not the renderer sandbox. It is a long-running host binary that holds PAM tokens, opens X11 sockets and writes remote input into the local session. A use-after-free here compromises the user's entire desktop session, not a sandboxed tab. X11 is the traditional Linux display system; a socket here is a local communication channel to it. PAM tokens are the credentials PAM holds after a successful login.
-
No user interaction required after pairing. Once a host has been registered for a user, incoming connection attempts drive this code path without any local confirmation for
me2memode. A prior-paired or policy-permitted remote endpoint that has been compromised becomes a stepping-stone to the host's heap. Pairing is the one-time setup that links a client to a host so later connections need no fresh approval. -
Recent precedent and a just-landed partial fix. crbug.com/501376612, fixed by
174583c9fcf83on 2026-04-11, acknowledged the shape of this vulnerability in five sibling files. In other words, the project had already accepted that this pattern is a real bug and fixed it in five places, but this sixth place was overlooked.
Fix
Applying the analogous change to the sibling fix in commit 174583c9fcf83, replacing base::Unretained(this) with weak_factory_.GetWeakPtr() in ProcessMessage and adding a WeakPtr self-check between lines 117 and 119 in GetNextMessage, makes the reproduction test pass with no ASAN report. With that change the reproduction test passes with no ASAN report. The report does not state whether this change had landed in the tree at the time of writing.
Variants to test
- Other authenticator wrappers with the same ownership comment. Search the tree for
Unretained(this)next to comments claiming ownership makes it safe, particularly in classes that own a childAuthenticatorand forward calls to it. A positive result is a wrapper that dereferencesthisafter a call into the child, with no WeakPtr check on return. - Synchronous destruction through
on_state_change_after_accepted_. For any authenticator that can be destroyed from inside its own method via the state-change notification chain, check whether the caller reads member state after the call returns. A positive result is a stack where the free happens inside the callee and the read happens in the caller's next statement. Callee is the function being called; the caller is the one that called it. - The asynchronous
BindOncepath. Look forbase::BindOncewithbase::Unretained(this)where the bound method runs after a call that can tear down the owning session. A positive result is a callback that fires on a freed object, as inOnMessageProcessed. - Other platforms' host authenticators. A positive result is the same free-then-read ordering under ASAN.
- Handshake state transitions driven by remote stanzas. Exercise
session-initiate,session-acceptandsession-infohandling with rejection, policy failure, timeout racing with accept, and mid-handshake disconnect. A positive result is a host-process ASAN report with a use-after-free in the authenticator wrapper.
Glossary
- AddressSanitizer (ASAN): a tool built into a special build of a program that detects illegal memory accesses and prints a detailed report when one happens.
- Attack surface: all the ways an outsider can send input into a program.
- Authenticator: the part of a program that decides whether the other side of a connection is allowed in.
base::BindOnce: a Chromium helper that packages a method and its arguments to be called later, exactly once.base::Unretained(this): a Chromium helper used when scheduling a callback that says "do not keep this object alive for me", promising the object will still exist when the callback runs.- Callback: a piece of code handed to someone else to be run later.
- Callee: the function being called.
- Caller: the function that makes a call.
- Call stack: the chain of function calls currently in progress, most recent first.
- Class: a blueprint in code that bundles data with the operations that work on it.
- ClusterFuzz: Google's system for running programs on large amounts of generated input and grouping the crashes it finds.
- Commit: a recorded change to a project's code, identified by a hash.
- Connection-manager layer: the code that decides when a connection should be closed.
- Control-flow hijack: making a program run the attacker's chosen code instead of its own.
- Curtain mode: a remote desktop mode where the local screen is blanked while someone is connected.
- Daemon: a program that runs in the background without a window, waiting to do a job.
- Dereference: follow a pointer to read or write the data it points at.
- Exception record: what the operating system writes when the processor itself faults, for example on a division by zero.
- Fingerprint: a short signature made from the top of a crash's call stack, used to group identical crashes.
- Fuzzing: feeding a program large amounts of generated input to find crashes.
- GN args: build settings passed to Chromium's build system.
- Heap: the general-purpose pool of memory a program uses for objects it creates while running.
- Heap grooming: arranging memory allocations so a freed block is predictably reused by data the attacker controls.
- ICE: the set of techniques two machines use to establish a direct connection through the internet's obstacles.
- it2me: "IT to me", a remote desktop mode where a support person connects to a user's machine.
- me2me: "me to me", a remote desktop mode where you connect between two of your own machines.
- Memory: the working space a program uses to hold data while it runs.
- Message framing: how a stream of bytes is split into individual messages.
- Object: an actual instance of a class, created while the program runs.
- PAM (Pluggable Authentication Modules): the standard Linux machinery for checking a user's identity.
- PAM tokens: the credentials PAM holds after a successful login.
- Pairing: the one-time setup that links a client to a host so later connections need no fresh approval.
- Pointer: a note saying where in memory some data lives.
- Pre-authentication: reachable before any password or credential has been checked.
- Protobufs: Google's format for serialised structured messages.
- Raw pointer: a plain memory address with no ownership attached.
- Registers: the processor's tiny built-in storage slots.
- Renderer: the part of a browser that draws a page, usually kept in a restricted sandbox.
- Sandbox: a restricted box that limits the damage if a program inside it is compromised.
- Session: one live remote-desktop connection and the objects that manage it.
- Shadow memory map: ASAN's bookkeeping that records, for every chunk of program memory, whether it is currently valid.
- Signalling: the exchange of setup messages between two machines before the actual data connection exists.
- Sibling files: other files in the same area of the code that do a similar job.
- Source set: a named group of source files in a build recipe.
- Stanza: a single structured message in XMPP.
std::unique_ptr: a C++ construct meaning "this object is the single owner of that other object, and destroys it when it is itself destroyed".- Symbols: the names of functions and objects inside compiled code.
- Synchronous: happening immediately, before the current call returns, rather than later on another schedule.
this: how a C++ object refers to itself inside its own methods.- Tip-of-tree: the very latest code in a project's main development line, before any release.
- Toolchain: the compiler and related tools that turn source code into a runnable program.
- Unit test: a small program written to exercise one specific piece of code and check that it behaves.
- Use-after-free: using memory after it has been given back, so that it may now belong to something else.
- Virtual call: a method call resolved at runtime through an object's vtable rather than fixed at compile time.
- Vtable: a table of function addresses that C++ uses to decide which version of a method to call on an object.
- WeakPtr: a reference that does not keep an object alive and can tell you whether the object still exists.
- Wrapper: an object that sits around another object and passes calls through to it, adding a little extra behaviour.
- X11: the traditional Linux display system.
- XMPP: a messaging protocol used for the setup exchange between the two ends.
ACCEPTED: a named handshake state meaning the negotiation has succeeded.