Bug 2525528 - SELinux denies sshd_session_t name_connect to ephemeral_port_t, breaking SSH dynamic port forwarding
Summary: SELinux denies sshd_session_t name_connect to ephemeral_port_t, breaking SSH ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 44
Hardware: All
OS: All
unspecified
medium
Target Milestone: ---
Assignee: Zdenek Pytela
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2026-08-28 10:59 UTC by Elias
Modified: 2026-09-16 00:54 UTC (History)
8 users (show)

Fixed In Version: selinux-policy-44.9-1.fc44
Clone Of:
Environment:
Last Closed: 2026-09-16 00:54:28 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 3403 0 None open Ssh use cases 2026-09-10 14:02:31 UTC
Red Hat Bugzilla 2523732 0 unspecified CLOSED sshd_session_t enforcement breaks OpenSSH direct-tcpip / ProxyJump forwarding to ssh_port_t 2026-09-21 19:25:37 UTC
Red Hat Bugzilla 2524485 0 unspecified CLOSED SELinux prevents ssh X11 Forwarding due to removal of permissive sshd_session_t domain 2026-08-31 17:18:57 UTC

Description Elias 2026-08-28 10:59:41 UTC
Description of problem:
After updating to selinux-policy-44.7-1.fc44 (which removed the permissive setting for sshd_auth_t and sshd_session_t), SSH dynamic port forwarding (ssh -D) stopped working. This breaks tools that rely on dynamic forwarding, including VS Code's Remote-SSH extension.

Version-Release number of selected component (if applicable):
selinux-policy-44.7-1.fc44 / selinux-policy-targeted-44.7-1.fc44

How reproducible:
Always.

Steps to Reproduce:
1. On Fedora 44 with selinux-policy-targeted-44.7-1 or later, start an SSH connection using dynamic port forwarding: ssh -D <port> <host>
2. Have the remote side attempt to bind/connect out on an ephemeral port (e.g. a remote dev server or, in my case, VS Code Server's own listener) via the forwarded SOCKS tunnel
3. The connection through the tunnel fails with channel <N>: open failed: connect failed: open failed

Actual results:
The forwarded connection is silently blocked at the SELinux layer. sshd itself is correctly configured (AllowTcpForwarding yes, confirmed via sshd -T), and no relevant boolean exists to toggle this (checked getsebool -a | grep ssh).

Expected results:
Dynamic port forwarding should succeed, as it did before this policy update.

Additional info:

AVC denials:
    type=AVC msg=audit(1787912637.360:1469): avc:  denied  { name_connect } for  pid=78097 comm="sshd-session" dest=44717 scontext=system_u:system_r:sshd_session_t:s0-s0:c0.c1023 tcontext=system_u:object_r:ephemeral_port_t:s0 tclass=tcp_socket permissive=0

From selinux-policy-targeted changelog
    - Remove permissive setting for sshd_auth_t and sshd_session_t

Workaround:
    sudo ausearch -m avc -ts recent | audit2allow -M ssh_dynamic_forward
    sudo semodule -i ssh_dynamic_forward.pp

Generated .te file:
    module ssh_dynamic_forward 1.0;
    
    require {
            type sshd_session_t;
            type ephemeral_port_t;
            class tcp_socket name_connect;
    }
    
    #============= sshd_session_t ==============
    
    #!!!! This avc can be allowed using the boolean 'nis_enabled'
    allow sshd_session_t ephemeral_port_t:tcp_socket name_connect;

Comment 1 Edgar Hoch 2026-08-28 12:11:30 UTC
See also bug 2507582.

Comment 2 Fedora Update System 2026-09-14 14:37:40 UTC
FEDORA-2026-1413268892 (selinux-policy-44.9-1.fc44) has been submitted as an update to Fedora 44.
https://bodhi.fedoraproject.org/updates/FEDORA-2026-1413268892

Comment 3 Fedora Update System 2026-09-15 01:42:40 UTC
FEDORA-2026-1413268892 has been pushed to the Fedora 44 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2026-1413268892`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2026-1413268892

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 4 Fedora Update System 2026-09-16 00:54:28 UTC
FEDORA-2026-1413268892 (selinux-policy-44.9-1.fc44) has been pushed to the Fedora 44 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.