Category Archives: Hardening and Mitigations

SSL VPN security enhancement idea – Reduce the gateway attack surface by allowing access only to pre-approved DDNS clients

(Hi there readers – If you know anyone who works for an SSL VPN vendor – in development, product management and so on, please send them a link to this post, hoping this idea will gain attention, acceptance, and eventually will come to life, hence enhance security for all of us)

The Hebrew version of this post can be found here.

TL;DR / Summary

This is an idea I came up with, to enhance the security of SSL VPN, by reducing the SSL VPN server attack surface, by adding Dynamic DNS (DDNS) client to the SSL VPN client endpoint, hence configuring the server side to allow only networking-pre-approved sources to even communicate with the SSL VPN server component of the gateway in the first place, based on FQDN values of the DDNS clients, hence blocking, up front, most of the internet from even communicating with the SSL VPN server, hence greatly reducing its attack surface.

Thinking about it further – the above principle is good for any server element who needs to accept incoming traffic non-fixed source IP(s) – be it a web server, an SSH server and so on

I tried so find solutions that use the above principle, but I didn’t find any.

From what I have found – all uses of a DDNS client are for the benefit of systems that operate in as a server, meaning they listen for client-initiated incoming traffic, in order to provide service to clients, so that clients can find them and reach them, even if the IP address of these systems changes.

There are security gateway products who support using FQDN as an object in their Firewall rules, which means the above idea can be technically realized already now, but I think it will be hard to manage it all this way, and it will not scale. I think this needs a more systematic solution, to also handle the client side and DDNS server side, so I think vendors should incorporate it as part of their relevant products and services, to be able to be managed properly by customers.


Background

I noticed that in the recent time there are many incidents in which SSL VPN components of security gateways are breached successfully, due to various reasons, mostly due to software vulnerabilities of the gateway’s software.

Vulnerabilities are inevitable, it will always happen, as we cannot guarantee bulletproof, 100 percent secure, software.

Also, SSL VPN, as a concept, is mostly used to grant secure access from the Internet in to local, private, internal networks, so it has to be open to the whole (or most) of the internet, as the organization cannot know in advance from which source IP addresses the clients will initiate communicate to the gateway, and as also some of the client endpoints change their source  IP from time to time, for various reasons (Their ISP changed their allocated IP, they travel in train and change cellular networks when they cross to another country, and so on).

So, I thought, we have here an enormous attack surface at the gateway side, constantly open to all of the Internet, so no wonder it is successfully breached so much.
I though to myself: There should be a better, more secure, way to do it.

Here are several news articles about mostly recent SSL VPN vulnerabilities and breaches (sorted from newest to older):

2025, August
Fortinet SSL VPNs Hit by Global Brute-Force Wave Before Attackers Shift to FortiManager
https://thehackernews.com/2025/08/fortinet-ssl-vpns-hit-by-global-brute.html

2025, August
SonicWall Investigating Potential SSL VPN Zero-Day After 20+ Targeted Attacks Reported
https://thehackernews.com/2025/08/sonicwall-investigating-potential-ssl.html

2025, April
Ivanti has recently patched a critical severity vulnerability found in its Connect Secure (ICS) VPN appliances which was allegedly being abused in the wild by Chinese state-sponsored actors
https://www.techradar.com/pro/security/ivanti-patches-serious-connect-secure-flaw

2025, March
VPN Vulnerabilities Become a Primary Weapon for Threat Actors Targeting Organizations
https://gbhackers.com/vpn-vulnerabilities-become-a-primary-weapon/

2025, January
Ivanti Connect Secure VPN Targeted in New Zero-Day Exploitation
https://cloud.google.com/blog/topics/threat-intelligence/ivanti-connect-secure-vpn-zero-day

2024, February
Exploitation Observed: Ivanti Connect Secure — CVE-2023-46805 and CVE-2024-21887
https://www.akamai.com/blog/security-research/ivanti-january-rce-cve-zero-day-exploitation-observed

2023, July
Researchers Develop Exploit Code for Critical Fortinet VPN Bug
Some 340,000 FortiGate SSL VPN appliances remain exposed to the threat more than three weeks after Fortinet released firmware updates to address the issue
https://www.darkreading.com/vulnerabilities-threats/researchers-develop-exploit-code-for-critical-fortinet-bug

2022, December
Fortinet Warns of Active Exploitation of New SSL-VPN Pre-auth RCE Vulnerability
https://thehackernews.com/2022/12/fortinet-warns-of-active-exploitation.html


The suggested solution (High level)

The core concept for using DDNS is that if we wish to grant secure access to clients that we cannot know in advance what is their source IP and even if we know it at some point – it can change at any time, because it is not a fixed VPN connection, with fixed client IP, so we use the DDNS system to have a trusted fixation layer (made of the FQDN’s domain and DDNS server), which we trust to authenticate the client device – hence we are willing to allow the first networking level access to an unknown-in-advance client IPs, but ones that have a preliminary required software (the DDNS client) and was authenticated (even if just a device was verified, not a human) at a system we trust (The DDNS server system).

The idea is to limit who has access to the SSL VPN server side, based on the following high-level concept:

  • SSL VPN Client side
    • The clients who wish to access and use the SSL VPN server – will have, as part of their SSL VPN client software (and possibly as part of their EDR client software), a Dynamic DNS (DDNS) client component
    • The DDNS client will communicate securely with its DDNS server (I guess over HTTPS), authenticate to it, and send to the DDNS server its client identity and public IP address (which the DDNS server can also fetch by itself, from the network session). This should be done every time the public IP of the client changes, to verify the DDNS server and the gateway always get the current IP of the client
      • The DDNS client software must of course be secured – The client’s DDNS server credentials should be encrypted locally; communication to the DDNS server needs to be encrypted and authenticated, DNS queries better be encrypted using DoH (DNS over HTTPS); protected from tampering and so on

 

  • SSL VPN server side (the organizational security gateway)
    • The gateway will, constantly and ad-hoc when needed, run reverse (PTR) DNS queries against the same DDNS server/system as the SSL VPN client use, to fetch the current IP addresses of relevant SSL VPN clients
    • The gateway will have a firewall rule, related to the SSL VPN activity, who allows access to it from the internet, based not on numeric source IPs, but rather on FQDN names that the DDNS server controls and manages, the ones attached to its clients (desired with wildcard support, for better configuration flexibility)
      • For example, the Firewall rule’s allowed source object will be *.vpn-allowed.firm.com, and any IP that is resolved to matching FQDN, will be allowed (e.g., johndoe.vpn.firm.com or serioussam.vpn.firm.com)

 

  • Session
    • The client will initiate an https-based SSL VPN session to the gateway
    • The gateway will receive the first packet of the TCP handshake session (with the SYN flag) and will check the value of the incoming source IP, based on the above SSL VPN access firewall rule
    • This source IP will be evaluated (best using a DNS PTR resolving (hence IP to FQDN) against the DDNS server or, less desired, as its data may not be up-to-date, locally against a pre-fetched cache)
      • Timeouts and invalidation of non-active DDNS client’s is highly desired, to prevent granting access to unauthorized clients who accepted the original IP if the real client is not using that IP anymore, for any reason
    • If there is a match – the client will be allowed to continue with the session – to complete the TCP handshake, set the TLS session, authenticate and then establish the SSL VPN connection
    • If there is no match – the firewall rule evaluation process will continue to the rest of the firewall’s rules, ideally eventually reaching the last rule, the cleanup / deny-all rule, which will drop the communication, hence blocking any further communication from the client side to the SSL VPN server, which actually means blocking any source IP that does not currently has a currently active allowed DDNS client ID, which is probably most of the Internet, which means most of the opportunistic attackers

 

Added possible points:

  • The DDNS server system
    • I think it is desired not to use a DDNS server system that is part of the gateway, the SSL VPN server device – as it is exposing the device to the whole Internet using an extra web/DNS server interface, which is against what we try to achieve here in the first place
    • Also, I think it is less desired to use 3rd party DDNS system/service, unless it is a very secure one
    • Ideally the DDNS system will be a cloud service by the same vendor of the security gateway’s vendor, to hopefully achieve more compatibility, interoperability, and security
  • Of course, this concept adds to the current way of things – more complexity, management, and the need for hardening, but I think the added security worth it

Zero trust features that can be added as well:

  • Applying IP reputation – to either block access up front, or instead adding more security checks or limitations to the session
  • Dropping the session if the public IP of the client changed during an active session, forcing the client to start a new session from the beginning
  • Blocking clients if their public IP is changing too fast/often or their public IP is not reported within a timely manner (if there is a technical demand from the DDNS logic for recuring scheduled updates from the DDNS client to its server)
  • Checking local settings like if the client is set as router (IP Forwarding), the use of a proxy, the use of another VPN in parallel, and so on (although this slides more towards an EDR functionality)

That’s all, folks. I hope you liked it, and if you did – please spread the word, and the link to this post, to relevant people who can bring this concept to life.

Microsoft Office 365 blocking access to sites with digital certificate issues – is not working

Dig this – a bonus for you, my loyal readers… 🙂

Do not click on this link – https://2.21.143.74. It is the IP address of microsoft.com (the IP itself is of Akamai). Copy it to a clean Word document or clean Excel worksheet (make sure the apps are using the latest version of 365). Make sure the text becomes a link. Click on the link. A warning message will appear as in the attached image, stating that there is no match between the site you requested (because you requested an IP address) and the name of the site for which the certificate is intended (microsoft.com).

If you click “No” or the “X” button for closing the warning message window or even typing the keyboard combination of Alt+F4 to close the Word/Excel app – the link will open anyway … only killing the Winword.exe process for Word or Excel.exe for Excel – will cause the link not to open…

Also notice that the default focus in the warning window is on the “No” button, so a user’s automatic action (hitting “Enter” or “Space” on the keyboard or clicking the mouse main button, if the cursor feature of “Snap to default” is enabled) will cause the site to be opened instead of avoiding the site. That means that this protection does not work.

I contacted the MSRC with the above information, and they responded as follows:

Hello Eitan,
Thank you for submitting this issue to MSRC. We determined that while the issue you reported is valid, it does not meet our the bar for immediate servicing. That being said, this submission has been flagged for future review by the product team as an opportunity to improve the security of the affected product. We do not have a timeline for when this review will occur, and will not be able to provide status for this issue moving forward.

How to protect yourself from the Samsung keyboard vulnerability in Android devices

A few weeks ago, on June 2015, the mobile devices security company “NowSecure”, has published a post about a vulnerability they have found, titled “Remote Code Execution as System User on Samsung Phones Summary”, discovered by its researcher, Mr. Ryan Welton.
This research was also marked using two official vulnerability identifications of CVE-2015-4640 and CVE-2015-4641.

On the above blog post the company wrote “Unfortunately, the flawed keyboard app can’t be uninstalled or disabled”.
I believe this is not fully correct as the relevant Android service of the this keyboard can be disabled if the device is rooted.

In the rest of this post I will show you how to do just that.

***
Disclaimer:
Following are the steps of how to work-around the vulnerabilities mentioned in the post blog of “NowSecure” – but the fact it worked for me does not necessarily means it will work for you or that it won’t harm your device and/or data.
I will have NO responsibility NOR liability for the following steps, if you will perform the following steps – it will be on your own personal responsibility and liability.
***

There is a workaround, which means it is not fixing the problem and the relevant software is still vulnerable, it is just that we will make sure the relevant software will not load into the device memory, so attackers will not be able to exploit this vulnerability.

***
The following procedure requires a root access for the device.
***

The concept outline is:
1. Installing another Android keyboard software
2. Making the new keyboard app the device active keyboard
3. Disabling the Samsung keyboard (including across device reboots)

This replaces the vulnerable keyboard with a (probably…) non-vulnerable keyboard and blocking the vulnerable keyboard from loading into memory, so it cannot be exploited.

First of all – make a full backup of the target Android device! And save the backup output OUTSIDE the device itself!

1. Make sure you have a root access on your Android device.
The free app of “Root Checker” may help you verify this.
If you do not have root access – the decision if and how to get root access is up to you to decide as it has many and serious implication on your device operation, maybe even its warranty – further beyond this workaround.
See the following two articles discussing the advantages and disadvantage of rooting and Android device:
a. Rooted vs. Unrooted Android: Your Best Arguments
b. To Root or Not to Root

2. Install an alternate free keyboard, like the “Google Keyboard”.
Here are some recommendations (not by me) for other alternate keyboards apps.

3. Make the non-Samsung keyboard the active system keyboard
The steps to do this may change from Android version to another, but you can get a hint in the following articles:
a. How to replace your Android or iOS keyboard
b. Type in style: How to change your Android keyboard

4. Reboot the device and make sure that the new keyboard app is the active keyboard and that it is working properly (say, do a Google search)

5. Install the free app of “Disable Service”. I installed and used it and it worked fine for me.

6. Disable the “Samsung Keyboard” app using the following steps:
a. Open the “Disable Service” app and choose the “System” tab on the right side of the app interface
b. Find the app named “Samsung Keyboard” (the actual name (partial or complete) of the app may be different as it may be written using the interface language of your phone) and choose it
(you can easily find the “Samsung Keyboard” app using the “Disable Service” app search option (the magnifier icon at the top-left side of its interface) – just type there “samsung”)
c. Un-check all the check boxes of the sub-items listed, the ones which the “Samsung Keyboard” is attached to. Once you un-check an item it will be disabled and its text color will turn from white to red.
You will probably be prompted, using a pop-up window, to grant the “Disable Service” app a root access – you HAVE to approve this request for this procedure to succeed (the pop-up window will enable you to limit this access for only 15 minutes. You can do this as well, as you suppose to complete the whole procedure within a few minutes)
d. That’s it – exit the app
e. To verify that the “Samsung Keyboard” is disabled – return to the Android keyboard selection section, as mentioned in step number 3 above and make sure that there is no item of “Samsung Keyboard” listed

In case you wish to re-enable the Samsung keyboard, use the following steps:

a. Open the “Disable Service” app and choose the “System” tab on the right side of the app interface
b. Find the app named “Samsung Keyboard” (the actual name (partial or complete) of the app may be different as it may be written using the interface language of your phone) and choose it
(you can easily find the “Samsung Keyboard” app using the “Disable Service” app search option (the magnifier icon at the top-left side of its interface) – just type there “samsung”)
c. Check/Select all the check boxes at the list you will be presented with. Once you check/select an item it will be enabled and its text color will turn from red to white.
You will probably be prompted, using a pop-up window, to grant the “Disable Service” app a root access – you HAVE to approve this request for this procedure to succeed (the pop-up window will enable you to limit this access for only 15 minutes. You can do this as well, as you suppose to complete this procedure within a few minutes)
d. Exit the app
e. To verify that the “Samsung Keyboard” is enabled – return to the Android keyboard selection section, as mentioned in step number 3 above and make sure that an item of “Samsung Keyboard” is listed there

The above procedure is meant for most folks as it easy and less prone to cause any harm – most folks should use it.

The following procedure will give the same result but it is intended for more technically experienced folks as it is more prone for possible mistakes and damage, as it is using low-level operating system commands. Use it only if are very technically knowledgeable about the low-system-levels of Android.

Perform steps 1 to 4 the same as mentioned above.
From step 5 and forward use the following steps:

5. Install a shell/terminal emulator like the free app of “Terminal Emulator for Android”, which I tested and found it to work fine and easy.

a. Open the “Terminal Emulator for Android” app and at the command line type the text “su” (without the quotes. su means “super user”, which is what we call “root” mode) and hit the “Enter” key, found on the edge of the lower-right corner of the app’s online keyboard. It looks like a thin line with large arrow-head that is pointing to the left
b. You will probably be prompted, using a pop-up window, to grant the “Terminal Emulator for Android” app a root access – you HAVE to approve this request for this procedure to succeed (the pop-up window will enable you to limit this access for only 15 minutes, you can do this as well, as you suppose to complete this procedure within a few minutes)
c. You will be returned to the command line. Notice that the sign at the right side of the line’s initials is changed from the dollar sign, “$”, to be the sign of “#”, which symbols you are now in “root” mode.

***Be very careful here as you can make real damage using the root mode***

d. Type the following line exactly, and once you completed writing it – press the “Enter” key:
pm disable com.sec.android.inputmethod

If all is fine you will be replied with a message of:
Package com.sec.android.inputmethod new state: disabled

e. Exit the app by clicking on the “X” sign on the app’s upper-right corner

To enable back the Samsung keyboard using the same app:

Do most of the same steps as mentioned above using the “Terminal Emulator for Android” app, but for step “d” change the command to be:
d. Type the following line exactly, and once you completed writing it – press the “Enter” key:
pm enable com.sec.android.inputmethod

If all is fine you will be replied with a message of:
Package com.sec.android.inputmethod new state: enabled

e. Exit the app by clicking on the “X” sign on the app’s upper-right corner

.

That is all. I hope this post will assist you in protecting yourselves from this vulnerability.

Cheers!

Eitan Caspi

.