Skip to content
Welcome To Charanjit Cheema Blog

Welcome To Charanjit Cheema Blog

An Open Source and Cloud Blog

Menu
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
Menu

How to mitigate Linux OpenSSH vulnerability CVE-2023-38408

Posted on July 28, 2023August 1, 2023 by Charanjit Singh

The PKCS#11 feature in ssh-agent in OpenSSH before 9.3p2 has an insufficiently trustworthy search path, leading to remote code execution if an agent is forwarded to an attacker-controlled system. (Code in /usr/lib is not necessarily safe for loading into ssh-agent.) NOTE: this issue exists because of an incomplete fix for CVE-2016-10009. Source Definition: CVE-2023-38408 at MITRE

One should be cautious while using SSH agent forwarding. If possible, refrain the forwarding of SSH (in SSH client) agent to untrusted servers. Considering the potential risks associated with CVE-2023-38408 one should evaluate the security risk and enable the ssh agent forwarding only if target environment like GitHub or remote servers are trustworthy.

Most of Linux distro vendors have not released patches yet for addressing this vulnerability hence there is workaround which I found for mitigating this vulnerability is that to disable the SSH agent forwarding in SSH client Linux machines which is applicable to all Linux distro such as Ubuntu, Red Hat, Suse, CentOS, Oracle Linux machines as OpenSSH is a Posix service for all Linux distros.

By default, SSH agent forwarding is disable in most of Linux OSs, but if you want to check whether ssh agent forwarding is disabled or not run below command for checking it:

root@charanjit-ubuntu:~# ssh -G localhost | grep forwardagent

forwardagent no

root@charanjit-ubuntu:~#

Alternatively you can also run this command echo “$SSH_AUTH_SOCK” to check if ssh agent forwarding is enabled you may find similar output as below in case it is enabled in your Linux server:

$ echo “$SSH_AUTH_SOCK”
# Print out the SSH_AUTH_SOCK variable
> /tmp/…

 

If you find it is enabled change the ForwardAgent value yes to no in file /etc/ssh/ssh_config:

root@charanjit-ubuntu:~# egrep “ForwardAgent” /etc/ssh/ssh_config

ForwardAgent no

root@charanjit-ubuntu:~#

 

Note: This setting will be implemented on the fly, so you need not to restart any services. Also, this setting will be applicable on ssh client service not on ssh server daemon or service. Second thing ensure you should only configure /etc/ssh/ssh_config file not /etc/ssh/sshd_config file as both files usage are different first is used for ssh client configuration and latter used for ssh server configuration.

Loading

  • Author
  • Recent Posts
Charanjit Singh
Follow him
Charanjit Singh
Charanjit is currently working as a Cloud Architect at Mphasis, with 18 years of experience in IT infrastructure projects, implementation, and support. While his main role is as a DevOps engineer, he holds a Cloud Architect position and has strong skills in cloud technologies and automation. His expertise includes Terraform, AWS, Azure DevOps, Azure Cloud, VMware, and Linux systems.

Charanjit is passionate about automating tasks and improving processes. He uses tools like Terraform and Azure DevOps to build and manage cloud infrastructure and streamline deployment. He also enjoys using Shell scripts and Ansible playbooks to make systems run more efficiently.

In his free time, Charanjit enjoys learning about new technologies and sharing his knowledge through his blog. When he’s not working, he likes listening to music, having a cup of coffee, and relaxing in nature.

You can connect with Charanjit on Twitter, Facebook, LinkedIn, or email him at charanjit.cheema@cjcheema.com.
Charanjit Singh
Follow him
Latest posts by Charanjit Singh (see all)
  • How to Deploy Docker Containers with NGINX on AWS EC2 Using Ansible and GitHub Actions - April 26, 2025
  • No More DynamoDB! Use Native S3 locking for Terraform State - February 7, 2025
  • How to Bring and Manage Manually Created AWS Resources Under Terraform Management - January 31, 2025

Like this:

Like Loading...

Related

Leave a ReplyCancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Tags

AWS Cloud Computing Dockers Networking Open Networking OpenSource RHEL-CentOS SDN Server Hardware SLES tcpdump Ubuntu WSL

Follow me @

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 2 other subscribers

Recent Posts

  • How to Deploy Docker Containers with NGINX on AWS EC2 Using Ansible and GitHub Actions
  • No More DynamoDB! Use Native S3 locking for Terraform State
  • How to Bring and Manage Manually Created AWS Resources Under Terraform Management
  • Iterating Cloud Resource Provisioning Using Terraform Count and For_Each Meta-Arguments
  • Terraform and Ansible Collaboration for AWS Cloud Deployment

Recent Comments

  1. Charanjit Singh on Terraform and Ansible Collaboration for AWS Cloud Deployment
  2. christinatodd2020aeaa798563 on Terraform and Ansible Collaboration for AWS Cloud Deployment
  3. Charanjit Singh on How to Set password policy in CentOS or RHEL system
  4. SAURABH on How to recover or rebuild initramfs in CentOS 7 Linux
  5. Sangita on How to Set password policy in CentOS or RHEL system

Archives

  • April 2025
  • February 2025
  • January 2025
  • August 2024
  • July 2024
  • June 2024
  • January 2024
  • August 2023
  • July 2023
  • June 2023
  • May 2023
  • September 2022
  • August 2022
  • July 2020
  • May 2020
  • February 2020
  • November 2019
  • June 2019
  • May 2019
  • March 2019
  • February 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • June 2018
  • May 2018
  • April 2018

Categories

  • Automation
  • Cloud Computing
  • Coding
  • CyberSecurity
  • Networking
  • OpenSource
  • RHEL-CentOS
  • Server Hardware
  • SLES
  • Technical Blog
  • Ubuntu
  • WSL

Blog Stats

  • 18,353 hits
Privacy & Cookies: This site uses cookies. By continuing to use this website, you agree to their use.
To find out more, including how to control cookies, see here: Cookie Policy
  • Home
  • About Me!
  • Way to my Technical Blog
  • Contact me
  • Privacy Policy
© 2025 Welcome To Charanjit Cheema Blog | Powered by Superbs Personal Blog theme
%d