LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-13-2024, 08:11 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Rep: Reputation: 177Reputation: 177
How to mitigate SSH Terrapin Prefix Truncation Weakness


Our office subscribes to the CISA Cyber Hygiene Report which is listing our site as having the "SSH Terrapin Prefix Truncation Weakness". I know this is not a super critical vulnerability, but management is anxious about it, especially since Homeland Security it report it to us.

I've found lots of posts describing what it is, but no mitigation other than on RHEL Linux.

Is there something I can do on Slackware 15.0? I'd like to smooth the ruffled feathers.

Last edited by mfoley; 04-13-2024 at 08:13 PM.
 
Old 04-14-2024, 04:23 AM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,794

Rep: Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473Reputation: 1473
15.0 has openssh-9.3p2. Openssh 9.6 and later have fixes for that weakness. https://www.openssh.com/txt/release-9.6
 
1 members found this post helpful.
Old 04-14-2024, 04:26 AM   #3
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 591

Rep: Reputation: Disabled
I went to https://terrapin-attack.com/ and downloaded their vulerability scanner. Slackware 15.0 is vulnerable, Slackware-current is able to mitigate the weakness. But note that a connection set up by a vulnerable client towards a secured SSH server is still vulnerable to a Terrapin attack.
Anyway, the above page also states what you have to remove but is not specific on how to do that:
Code:
disabling the affected chacha20-poly1305@openssh.com encryption and -etm@openssh.com MAC algorithms in the configuration of your SSH server (or client),
and use unaffected algorithms like AES-GCM instead.
Now look at what the sshd in Slackware 15.0 supports:
Code:
# sshd -T |grep -i cipher
ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
# sshd -T |grep -i mac
macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
Compare that to slackware-current:
Code:
# sshd -T  |grep -i cipher
ciphers chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
# sshd -T  |grep -i mac
macs umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
So they both look vulnerable, but the difference is what the vulnerability scanner reports about "Strict key exchange support" which is "true" for Slackware-current but "false" for Slackware 15.0:
Code:
ChaCha20-Poly1305 support:   true
CBC-EtM support:             false

Strict key exchange support: false

The scanned peer is VULNERABLE to Terrapin.
If you want to mitigate your Slackware 15.0 server, then add two lines specifying the Ciphers and MACs your server should support. The values I extracted with "sshd -T" are the built-in defaults.

As an example, add this to the end of /etc/sshd/sshd_config (I simply removed the vulnerable Ciphers and MACs):
Code:
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
MACs umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
Validate the changes you made with "sshd -t".
And then run "/etc/rc.d/rc.sshd restart".
Note that old ssh clients will probably no longer be able to connect to your SSH server now.
 
6 members found this post helpful.
Old 04-14-2024, 01:07 PM   #4
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Windu: Thanks for that information. I've added your suggested lines to sshd_config. Now I get:
Code:
sshd -T | egrep "cipher|mac"
ciphers aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
macs umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
Does that look correct?

I am able to ssh into that host from Slackware 14.2, 15.0 and Windows 11 without problem, so at least the ssh clients I know of will work.
 
Old 04-14-2024, 03:10 PM   #5
Windu
Member
 
Registered: Aug 2021
Distribution: Arch Linux, Debian, Slackware
Posts: 591

Rep: Reputation: Disabled
If you want to know whether you are still vulnerable, you can download the vulnerability scanner (64bit Linux) here: https://github.com/RUB-NDS/Terrapin-...er_Linux_amd64 - make it executable, and then run it as "./Terrapin_Scanner_Linux_amd64 -connect yourhost:yourport"
 
1 members found this post helpful.
Old 04-14-2024, 10:51 PM   #6
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,561

Original Poster
Rep: Reputation: 177Reputation: 177
Thanks! That appears to work. I'm all safe now.
 
  


Reply

Tags
ssh, terrapin, vulnerability



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Error: Invalid prefix for given prefix length tbarre Linux - Newbie 1 02-16-2024 02:07 AM
configure: error: expected an absolute directory name for --prefix: -prefix=/home/jeo Nownuri Linux - Newbie 2 03-28-2015 07:40 AM
wide-dhcpv6 - trying to obtain /60 prefix, "invalid prefix" psycroptic Linux - Server 3 05-26-2014 08:31 AM
Is this a virus or script kiddie trying to find a weakness in my ssh? jimdaworm Linux - Security 23 12-29-2008 09:06 AM
difference b/w AF_ prefix and PF_ prefix related to socket Ashok_mittal Linux - Newbie 1 03-20-2008 04:15 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:23 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration