# Marking Your Own Homework (Check Point Remote Access VPN IKEv1 Authentication Bypass CVE-2026-50751)

Check Point IKEv1 gateway trusts a client-supplied VPNExtFeatures Vendor ID bitmask to skip certificate signature verification, letting attackers authenticate as any provisioned user with a self-signed cert and garbage signature.

- Payout: Real-world hack
- Severity: critical
- Program: Check Point Remote Access VPN
- Analysis by: McCaulay Hudson
- Disclosed: 2026-06-12
- CVE: CVE-2026-50751
- Write-up quality: 9/10
- Original: https://labs.watchtowr.com/marking-your-own-homework-check-point-remote-access-vpn-ikev1-authentication-bypass-cve-2026-50751/
- Library page: https://bugbountylibrary.com/r/blog%3Alabs-watchtowr-com-marking-your-own-homework-check-point-remote-access-vpn-ikev1-authentication-bypass-cve-2026-50751
- Tags: area:devices domain:network impact:ato impact:internal-access kind:incident platform:research sev:critical tech:evm technique:incomplete-fix technique:reverse-engineering technique:source-review vuln:access-control vuln:auth-bypass

**Target:** Check Point Security Gateway iked daemon (IKEv1 Main Mode, UDP 500/4500 and TCP 443 Visitor Mode)
**Root cause:** processVendorIDPayload writes attacker-supplied 4 bytes after the VPNExtFeatures VID magic into state+0x4bc4 auth flags; verify_peer_auth and process_auth_pl short-circuit signature verification when bit 0x4/0x2 is set, so the client decides whether its own cert/signature is checked.
**Steps:**
1. Diff R82.10 T19 vs T19+sk185033; note process_cert_payloads lost its process_machine_certs int parameter and now reads policy from state+0x4bd4.
2. In process_auth_pl, observe check_sig = peer_flags & 2 gates processSigPayload; in verify_peer_auth, bit 0x4 of state+0x4bc4 short-circuits verifyMessagePhase1.
3. grep iked for writes to 0x4bc4: only FwIkeNewPhase1State (zeroing) and processVendorIDPayload.
4. Send IKEv1 Main Mode with VID magic `3c f1 87 b2 47 40 29 ea 46 ac 7f d0 ea f2 89 f5` followed by 4 bytes `00 00 00 04` (byte-swapped into flags).
5. Complete DH (AES-256/SHA1/group 2, hybrid auth 0xFADD), send msg5 with random HASH_I; vulnerable gateway creates phase-1 SA, patched rejects.
6. For full auth: use RSA auth method 3 with ID payload `CN=<username>,OU=users,O=<ICA-O>`, self-signed X.509, 256 random signature bytes, and the VPNExtFeatures VID with bit 0x4.
7. Read ICA O= from gateway's public TLS cert; enumerate usernames via user-lookup oracle; decrypt gateway's final phase-1 message to confirm session.
8. Repeat over TCP 443 using Visitor Mode TCPT framing when UDP 500/4500 filtered.
**How found:** Assumed vpnd held IKEv1 code but found iked (UDP 30500) handles it on R81.10+; diffed correct binary, spotted removed int parameter on process_cert_payloads, traced caller process_auth_pl and verify_peer_auth to flag-gated signature checks, then grepped for writers of state+0x4bc4 and found processVendorIDPayload copying client VID bytes.
**Exploitation:** Attacker needs only a valid username and the ICA organization string (leaked in the gateway's public TLS cert). They present a self-signed cert for a discarded key, a random 256-byte signature, and the VPNExtFeatures VID with bit 0x4 set; the gateway skips both signature and trust-chain checks, resolves the DN to a provisioned user, and grants a phase-1 SA and internal network access. Works over UDP 500/4500 and TCP 443 Visitor Mode across Certificate, Certificate-with-enrollment, and Mixed auth modes.
**Escalation:** Bypass extends from garbage-signature phase-1 acceptance to full user impersonation by supplying a DN matching a provisioned account; username oracle via lookup success/failure; TCP 443 fallback defeats UDP filtering.
**Insight:** When a patch removes a parameter from a validation function, trace every caller and every writer of the state field that gates the check; here a client-supplied Vendor ID payload was the sole non-initializer writer of the auth-flags dword, so the client controlled its own verification policy.

## Proof of concept (copied exactly from the original report)

**Vendor ID handler writing attacker flags dword**

```
int trailing = vid_len - 16; // [0] bytes left after the 16-byte magic
if (trailing <= 3) // need at least 4 trailing bytes, else bail
 return ...;

uint cap = *(uint *)(vid + 16); // [1] the 4 bytes right after the magic
*(uint *)(state + 0x4bc4) = bswap32(cap); // [2] store the attacker's dword as the auth flags
```

**Exploit script run forging cert and signature**

```
$ python3 watchTowr-vs-Check-Point-CVE-2026-50751.py -u watchtowr
[#] CVE-2026-50751 Check Point IKEv1 Remote-Access certificate-auth bypass
[+] Self-signed cert (untrusted); signature will be invalid (no private key)
[#] Connecting via udp ...
[#] Authenticating as 'watchtowr' with the forged certificate + invalid signature...
[#] Decrypting...
[+] Gateway Internal IP: 172.31.255.128
[+] [BYPASSED] Gateway authenticated us as 'watchtowr'. CVE-2026-50751 certificate-authentication bypass confirmed.
```

**Vulnerable process_cert_payloads gate on caller flag**

```
if (process_machine_certs != 0) { // [0] <-- gate is just the passed-in int
 while (seekPayload(0xf6, ...) >= 0) { // machine-cert payloads (Check Point 0xF6)
 processCertPayload(...);
 }
}
return 1;
```

