unsuccessful cascadereconnects spawns crash and securityhole
Posted: Sat Oct 22, 2016 1:41 am
Hi everyone,
I discovered the following issue:
Unsuccessful cascade reconnects will spawn vpnservice crash/restart, and opens up a security gap.
When links stays up (no reconnects needed) or short interuptions (eg reboot), link and service is 100% stable.
We successfully installed softether vpnserver (linux ARM eabi version of 24/4/16) on two clean "pi" devices (one bananapi, and one raspi3) and they can both serve vpn-sessions just fine.
Between the two devices (geographically separated) there is a cascade connection, which connects from "banana" to "raspberry".
The banana has two virtualhubs, one for incoming vpn connections, and one for only the cascade.
Both hubs also have their own bridged tapdevice.
The "raspberry" has four hubs, of which one is for the cascade.
"Banana's" cascaded virtualhub connects to this "raspberry" virtualhub.
This works GREAT, thanks to softhether functionality. Connections get picked up automatically, dhcp addresses are successfully distributed. Also after reboots etc. Real resilient.
Problem arises on BANANA, when for some reason banana cannot "see" raspberry for a FEW HOURS over the cascade.... ("raspberry" has no apparent problem, so far as we can see now)
1)After a few hours of unsuccessful connections retries, the vpnserver service (re)starts itself every few seconds, and
2) if this keeps going on, at some point the vpnserver looses it's config and reverts to default.
During this entire period the vpnservice keeps trying to restart, and is unresponsive (for incoming vpn connections).
If you restart (powerdown/powerup) the "banana" device completely, it starts vpnserver successfully again, but with DEFAULT settings.
From which point on EVERYBODY with a softether servermanager, can connect to your device and choose a new administrator pw.
From then on, he/she has FULL access to your network!!!
Needless to say: This is VERY BAD!! (understatement)
Any use of standard softether ports in this scenario is "security-suicide".
If you for some reason need p443, your are pretty much sc****ed....
(but we DO need it unfortunately)
At the end of this post, I will include snippets of the log that will clearify it some more.
So the problem is twofold:
-The restarts after prolonged unsuccessful reconnects (WHY??).
-And the change to DEFAULT.
The latter may be caused by the automatic config-restore function build in softether which doesn't have enough time to finish due to the continuous restarts.
Might be easily disabled (by "bool DontBackupConfig false" ??? please advise), or circumvented by removing write privileges on the .config file (not really desirable)
But the underlying issue (the first issue, aka the "constant service restarts"), I cannot fix myself. It seems to be a bug.
There is also no way to reduce the frequency of cascade reconnections (greyed out) to reduce the chance that this will happen (this is possible in the softether"client" version)
Please advise on creating a SAFE and STABLE situation in case of prolonged interrupted periods.....
Thank You.
/edit: found in syslog a lot of these:
Oct 19 23:24:05 bananapi kernel: [352255.490810] lowmemorykiller: Killing 'vpnserver' (21982), adj 800,
Oct 19 23:24:05 bananapi kernel: [352255.490818] to free 12304kB on behalf of 'kswapd0' (26) because
Oct 19 23:24:05 bananapi kernel: [352255.490822] cache 44616kB is below limit 65536kB for oom_score_adj 12
Oct 19 23:24:05 bananapi kernel: [352255.490827] Free memory is -38424kB above reserved
Oct 19 23:24:07 bananapi kernel: [352256.712735] lowmemorykiller: Killing 'vpnserver' (22085), adj 800,
Oct 19 23:24:07 bananapi kernel: [352256.712742] to free 12628kB on behalf of 'kswapd0' (26) because
Oct 19 23:24:07 bananapi kernel: [352256.712747] cache 43588kB is below limit 65536kB for oom_score_adj 12
Oct 19 23:24:07 bananapi kernel: [352256.712752] Free memory is -37216kB above reserved
Seems like a MASSIVE vpnserver memory leak while trying to do reconnect (since the device normally only needs about 80MB to run all programs including vpnserver (out of a total 1024MB)).
Kernel is trying to survive, and kills "vpnserver", which accounts for the constant restarts.
So the underlying problem changes from "why restart" to "why memoryleak"?
Softether devellopers???? Anyone??
[attachment=0]vpnlog.txt[/attachment]
I discovered the following issue:
Unsuccessful cascade reconnects will spawn vpnservice crash/restart, and opens up a security gap.
When links stays up (no reconnects needed) or short interuptions (eg reboot), link and service is 100% stable.
We successfully installed softether vpnserver (linux ARM eabi version of 24/4/16) on two clean "pi" devices (one bananapi, and one raspi3) and they can both serve vpn-sessions just fine.
Between the two devices (geographically separated) there is a cascade connection, which connects from "banana" to "raspberry".
The banana has two virtualhubs, one for incoming vpn connections, and one for only the cascade.
Both hubs also have their own bridged tapdevice.
The "raspberry" has four hubs, of which one is for the cascade.
"Banana's" cascaded virtualhub connects to this "raspberry" virtualhub.
This works GREAT, thanks to softhether functionality. Connections get picked up automatically, dhcp addresses are successfully distributed. Also after reboots etc. Real resilient.
Problem arises on BANANA, when for some reason banana cannot "see" raspberry for a FEW HOURS over the cascade.... ("raspberry" has no apparent problem, so far as we can see now)
1)After a few hours of unsuccessful connections retries, the vpnserver service (re)starts itself every few seconds, and
2) if this keeps going on, at some point the vpnserver looses it's config and reverts to default.
During this entire period the vpnservice keeps trying to restart, and is unresponsive (for incoming vpn connections).
If you restart (powerdown/powerup) the "banana" device completely, it starts vpnserver successfully again, but with DEFAULT settings.
From which point on EVERYBODY with a softether servermanager, can connect to your device and choose a new administrator pw.
From then on, he/she has FULL access to your network!!!
Needless to say: This is VERY BAD!! (understatement)
Any use of standard softether ports in this scenario is "security-suicide".
If you for some reason need p443, your are pretty much sc****ed....
(but we DO need it unfortunately)
At the end of this post, I will include snippets of the log that will clearify it some more.
So the problem is twofold:
-The restarts after prolonged unsuccessful reconnects (WHY??).
-And the change to DEFAULT.
The latter may be caused by the automatic config-restore function build in softether which doesn't have enough time to finish due to the continuous restarts.
Might be easily disabled (by "bool DontBackupConfig false" ??? please advise), or circumvented by removing write privileges on the .config file (not really desirable)
But the underlying issue (the first issue, aka the "constant service restarts"), I cannot fix myself. It seems to be a bug.
There is also no way to reduce the frequency of cascade reconnections (greyed out) to reduce the chance that this will happen (this is possible in the softether"client" version)
Please advise on creating a SAFE and STABLE situation in case of prolonged interrupted periods.....
Thank You.
/edit: found in syslog a lot of these:
Oct 19 23:24:05 bananapi kernel: [352255.490810] lowmemorykiller: Killing 'vpnserver' (21982), adj 800,
Oct 19 23:24:05 bananapi kernel: [352255.490818] to free 12304kB on behalf of 'kswapd0' (26) because
Oct 19 23:24:05 bananapi kernel: [352255.490822] cache 44616kB is below limit 65536kB for oom_score_adj 12
Oct 19 23:24:05 bananapi kernel: [352255.490827] Free memory is -38424kB above reserved
Oct 19 23:24:07 bananapi kernel: [352256.712735] lowmemorykiller: Killing 'vpnserver' (22085), adj 800,
Oct 19 23:24:07 bananapi kernel: [352256.712742] to free 12628kB on behalf of 'kswapd0' (26) because
Oct 19 23:24:07 bananapi kernel: [352256.712747] cache 43588kB is below limit 65536kB for oom_score_adj 12
Oct 19 23:24:07 bananapi kernel: [352256.712752] Free memory is -37216kB above reserved
Seems like a MASSIVE vpnserver memory leak while trying to do reconnect (since the device normally only needs about 80MB to run all programs including vpnserver (out of a total 1024MB)).
Kernel is trying to survive, and kills "vpnserver", which accounts for the constant restarts.
So the underlying problem changes from "why restart" to "why memoryleak"?
Softether devellopers???? Anyone??
[attachment=0]vpnlog.txt[/attachment]