Block LDAP from the internet until your domain controllers are patched
LDAP is how computers, programs and users ask Active Directory who is who. It runs on every domain controller and has no business being reachable from the internet. This month Microsoft fixed a critical flaw in Windows LDAP that needs no password at all. The patch is the fix. While you roll it out, a few firewall rules make sure nobody on the internet can even knock.
- What: Windows LDAP - Lightweight Directory Access Protocol Remote Code Execution Vulnerability, an out-of-bounds write, CVSS 9.8, rated Critical. Per Microsoft, an unauthenticated attacker could run code in the context of the LDAP service through a specially crafted set of LDAP calls over the network – no user account and no user action needed.
- Exploited: not at release. Microsoft marks it "not publicly disclosed", "not exploited" and "Exploitation Less Likely". That can change quickly once a patch has been studied, so do not wait for the first attacks.
- Fix: released on Patch Tuesday, 10 November 2026, in the Windows cumulative updates. Microsoft lists Windows Server 2016, 2019, 2022 and 2025 and supported Windows 10 and 11 versions as affected – the ones that matter most are your domain controllers.
- Sources: Microsoft Security Update Guide · CVE record · November 2026 Patch Tuesday overview
- Patch your domain controllers first – that is the only real fix. Then every other Server and PC.
- Check exposure: no port forwarding, no public address and no open cloud security group for LDAP (389, 636, 3268, 3269).
- Block LDAP from public addresses with Windows Firewall on every domain controller, so a router or cloud mistake does not open it later.
- Roll it out by Group Policy to the Domain Controllers OU.
- Remember the inside: the rule stops the internet, not a compromised PC in your own network. That is why the patch cannot wait.
1. Which ports are LDAP?
- 389 TCP – LDAP (also with StartTLS), and 389 UDP – connectionless LDAP, which Windows clients use to find a domain controller.
- 636 TCP – LDAP over TLS (LDAPS).
- 3268 TCP and 3269 TCP – the Global Catalog, plain and over TLS.
Every domain controller listens on these ports, and so does a Server with AD LDS (Active Directory Lightweight Directory Services). Inside your network they are needed all the time – logons, Group Policy, Exchange, file Servers, printers and many programs use them. From the internet they are needed practically never.
2. The patch is the primary fix
- Install the November 2026 cumulative update on every domain controller, one at a time, so the domain keeps running. Then on every other Server and PC.
- The KB number for each Windows version is in the Security Update Guide entry. Check what is installed with
Get-HotFix | Sort-Object InstalledOn -Descending | Select-Object -First 5. - A firewall rule does not replace the patch: an attacker who is already inside your network – for example through a phished PC (see ClickFix 2.0) – reaches your domain controllers over LDAP anyway.
3. Check whether LDAP is reachable from the internet
- Router and edge firewall: look for port forwardings (NAT) or allow rules for 389, 636, 3268 or 3269. There should be none.
- Cloud domain controllers (Azure, AWS, other hosters): check the network security group / security group of each one. A domain controller with a public address and "allow from any" is the classic mistake.
- On each domain controller, in PowerShell as administrator, see what listens and who the built-in rules allow:
The built-in Active Directory Domain Services rules allow LDAP from Any address. That is normal – and why a router or cloud mistake is enough to expose it.Get-NetTCPConnection -State Listen -LocalPort 389,636,3268,3269 | Select-Object LocalAddress, LocalPort, OwningProcess Get-NetFirewallRule -Direction Inbound -Enabled True -Action Allow | Where-Object { $_.DisplayGroup -like 'Active Directory Domain Services*' } | Get-NetFirewallAddressFilter | Select-Object InstanceID, RemoteAddress - From outside: on a computer that is not in your network (for example a laptop on a phone hotspot or a small cloud VM), test your public address:
Expected:Test-NetConnection -ComputerName 203.0.113.10 -Port 389 Test-NetConnection -ComputerName 203.0.113.10 -Port 636TcpTestSucceeded : Falsefor every LDAP port. With nmap:nmap -Pn -p 389,636,3268,3269 203.0.113.10andnmap -Pn -sU -p 389 203.0.113.10. - Look at what already arrived: switch on logging of allowed connections for a short time and look for public addresses on the LDAP ports (Event ID 5156 explains how without flooding the log).
4. Block LDAP from the internet with Windows Firewall
Close it at the edge first. Then add a rule on each domain controller as a second layer, so that a forgotten port forwarding, a new cloud rule or a hosting change does not expose LDAP again.
The important detail: in Windows Firewall, a block rule always wins over an allow rule (Microsoft: rule precedence). A block on 389 from everywhere would break your own domain. So the block rule lists only public addresses, leaving out the private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback, link-local and 100.64.0.0/10 (carrier-grade NAT, also used by some VPNs).
PowerShell (Windows Server 2012 and later)
In PowerShell as administrator, on the domain controller:
$public = @(
'1.0.0.0-9.255.255.255',
'11.0.0.0-100.63.255.255',
'100.128.0.0-126.255.255.255',
'128.0.0.0-169.253.255.255',
'169.255.0.0-172.15.255.255',
'172.32.0.0-192.167.255.255',
'192.169.0.0-223.255.255.255',
'2000::/3'
)
New-NetFirewallRule -DisplayName 'Block LDAP from the internet (TCP 389, 636, 3268, 3269)' `
-Direction Inbound -Action Block -Protocol TCP -LocalPort 389,636,3268,3269 `
-RemoteAddress $public -Profile Any `
-Description 'Keeps LDAP and the Global Catalog closed to the internet. LAN, VPN and private ranges are not affected.'
New-NetFirewallRule -DisplayName 'Block LDAP from the internet (UDP 389)' `
-Direction Inbound -Action Block -Protocol UDP -LocalPort 389 `
-RemoteAddress $public -Profile Any `
-Description 'Keeps connectionless LDAP closed to the internet. LAN, VPN and private ranges are not affected.'
The IPv4 ranges are everything from 1.0.0.0 to 223.255.255.255 except the private, loopback, link-local and carrier-grade NAT ranges. 2000::/3 is all global IPv6 unicast; IPv6 link-local (fe80::/10) and unique local addresses (fc00::/7) stay open.
Your own sites use public addresses? If a branch office or VPN reaches the domain controllers from public address space, leave exactly those ranges out of $public – an allow rule would not override the block.
netsh (any Windows version, including Server 2008 R2)
netsh advfirewall firewall add rule name="Block LDAP from the internet (TCP 389, 636, 3268, 3269)" dir=in action=block protocol=TCP localport=389,636,3268,3269 profile=any remoteip=1.0.0.0-9.255.255.255,11.0.0.0-100.63.255.255,100.128.0.0-126.255.255.255,128.0.0.0-169.253.255.255,169.255.0.0-172.15.255.255,172.32.0.0-192.167.255.255,192.169.0.0-223.255.255.255,2000::/3
netsh advfirewall firewall add rule name="Block LDAP from the internet (UDP 389)" dir=in action=block protocol=UDP localport=389 profile=any remoteip=1.0.0.0-9.255.255.255,11.0.0.0-100.63.255.255,100.128.0.0-126.255.255.255,128.0.0.0-169.253.255.255,169.255.0.0-172.15.255.255,172.32.0.0-192.167.255.255,192.169.0.0-223.255.255.255,2000::/3
Remove them again with netsh advfirewall firewall delete rule name="..." and the same name.
Click by click (wf.msc)
- Press Windows+R, type
wf.msc, Enter. Select Inbound Rules › New Rule. - Custom › All programs › Protocol TCP, Local port Specific Ports: 389, 636, 3268, 3269.
- Scope: Which remote IP addresses › These IP addresses › add each range from the list above (This IP address range).
- Block the connection › all three profiles › give it a clear name. Repeat for UDP 389.
5. Roll it out with Group Policy
- In Group Policy Management, create a GPO (e.g. Firewall - Block LDAP from internet) and link it to the Domain Controllers OU (and to Servers with AD LDS).
- Edit it: Computer Configuration › Policies › Windows Settings › Security Settings › Windows Defender Firewall with Advanced Security › Windows Defender Firewall with Advanced Security › Inbound Rules, and create both rules as in the click-by-click steps.
- Or write the rules straight into the GPO from PowerShell, using the
$publiclist from above:New-NetFirewallRule -PolicyStore 'corp.example.com\Firewall - Block LDAP from internet' ` -DisplayName 'Block LDAP from the internet (TCP 389, 636, 3268, 3269)' -Direction Inbound -Action Block ` -Protocol TCP -LocalPort 389,636,3268,3269 -RemoteAddress $public -Profile Any New-NetFirewallRule -PolicyStore 'corp.example.com\Firewall - Block LDAP from internet' ` -DisplayName 'Block LDAP from the internet (UDP 389)' -Direction Inbound -Action Block ` -Protocol UDP -LocalPort 389 -RemoteAddress $public -Profile Any - Run
gpupdate /forceon one domain controller, check that logons, Group Policy and replication still work, then let it reach the others.
6. Check that it works
- Confirm the rules are active on each domain controller:
Get-NetFirewallRule -DisplayName 'Block LDAP from the internet*' | Select-Object DisplayName, Enabled, Direction, Action, PrimaryStatus - Repeat the test from outside (section 3): every LDAP port must fail.
- Inside:
nltest /dsgetdc:corp.example.comandTest-NetConnection -ComputerName dc1.corp.example.com -Port 389from a PC in the office and over VPN must still succeed.
7. Caveats: what can break
- Cloud services that query your Active Directory over the internet (some VPN services, SaaS logins with "LDAP authentication", hosted mail filters): this rule stops them, and it should. Use the vendor's connector agent or a VPN instead, or, if there is no other way, leave the vendor's documented address ranges out of the block list – and know that you then depend on the patch.
- Branch offices or VPNs with public address space: leave those exact ranges out of the block list.
- Inside your network the rule does nothing, by design. A compromised PC can still reach LDAP on your domain controllers. Patch, and where you can, limit which subnets may reach the domain controllers at all.
- Other domain controller ports (Kerberos 88, RPC 135, SMB 445, DNS 53) should not be reachable from the internet either – see the Windows Server hardening checklist.
8. Where Coinetic AI Security helps while you patch
Coinetic AI Security manages the built-in Windows Firewall – no driver, next to Defender or any EDR. It does not patch Windows and does not fix CVE-2026-119958; it helps you keep the door closed and see who knocks:
- See every port and who can reach it: the Open Ports page shows each listening port, the program behind it and who can reach it through the firewall; the security check tells you when something new is open to the internet.
- IP groups and port groups: put your domain controllers, your own networks and the LDAP ports in groups and use them in rules, instead of typing ranges into every rule.
- See every connection: the live firewall log shows each connection attempt with address, owner and country; right-click one to Make a rule matching this packet, Edit the matching rule or Ban this IP. The Overview shows the attacks blocked today and the service most of them tried.
- Attacker bans: addresses that scan your ports, knock again and again or guess passwords on RDP, Windows logons, SQL Server, VPN and other services are banned automatically. The Coinetic network list blocks attacker addresses seen by other Coinetic customers before they reach you.
- Under Attack mode: by hand or automatically, it closes the admin doors – RDP, SSH, WinRM, SQL Server, SMB / RPC – to the internet while LAN, VPN, web and mail keep running. LDAP is not on that list: the block rule above is what keeps LDAP closed.
- Firewall change watch: if another program or person removes or weakens your block rule, you are told which program changed which rule; a switched-off firewall is switched back on.
- Ask AI (Pro + AI): right-click a log line and ask, e.g. “Did anyone from the internet try ports 389 or 636 on this Server this week?” – answered from this computer's own Coinetic data.
Download Coinetic AI Security, install, done. 30 days free with all features, no payment details. From $20 per computer per year.
More guides: all Coinetic guides.
Frequently asked
Is CVE-2026-119958 being exploited?
Not when Microsoft released the fix on 10 November 2026: it was marked as not exploited and not publicly disclosed. A critical flaw that needs no password is a likely target once attackers have studied the patch, so treat it as urgent anyway.
Does the firewall rule replace the patch?
No. It keeps attackers on the internet away from LDAP. An attacker inside your network still reaches it. Patch, and use the rule as a second layer.
Will the rule break logons over VPN?
Not if your VPN clients get private addresses (10.x, 172.16-31.x, 192.168.x or 100.64.x). Those ranges are left out of the block list.
Do PCs need the rule too?
Microsoft lists Windows 10 and 11 as affected too, so PCs need the November update like everything else. The firewall rule matters most on domain controllers and Servers with AD LDS, which listen for LDAP all the time.
This guide is general information, provided "as is" without warranty, and we accept no liability for its use to the maximum extent permitted by law; see sections 7 and 8 of the license agreement. Test every change on one computer first.
Coinetic AI Security - https://coinetic.io