---
title: "HOST-SSH-007 SSH Forwarding Features Enabled"
canonical: https://openvapt.com/checks/HOST-SSH-007.html
html: https://openvapt.com/checks/HOST-SSH-007.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-14
version: 0.1.0-alpha.6
---

# HOST-SSH-007 SSH Forwarding Features Enabled

Checks effective SSH Match contexts for TCP, agent, tunnel and gateway forwarding.

- Domain: Server
- Severity: Medium
- Control category: Secure Configuration
- Fix effort: low
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:C/C:L/I:L/A:N`
- CIS Controls v8: 4.1
- NIST CSF 2.0: PR.PS-01
- CWE: CWE-441
- NIST SP 800-53 Rev. 5: AC-4, CM-7
- Benchmark topic: SSH server configuration: forwarding (topic only, no benchmark text)

## Why It Matters

Forwarding can turn an SSH account into a route to protected services or expose a user's authentication agent.

## How It Detects

Evaluates sshd -T for root and an unprivileged user from loopback and a representative remote address. Fails when TCP or agent forwarding is enabled (both default to yes), PermitTunnel is yes, point-to-point or ethernet, or GatewayPorts is yes or clientspecified (the defaults for the last two are no). A risky value set inside a Match block in the config files fails as a conditional finding, with the Match condition in the evidence.

## How to Fix

Set AllowTcpForwarding no, AllowAgentForwarding no, PermitTunnel no and GatewayPorts no globally or in every applicable Match block, then reload sshd.

## How to Verify

```
Run sshd -T -C user=nobody,host=localhost,addr=192.0.2.1 and confirm each forwarding option is no.
```

## Learn the Theory

- [P2 SSH Security](https://openvapt.com/academy/p2.md)

## References

- [OpenBSD, sshd_config(5) manual page](https://man.openbsd.org/sshd_config)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/host/ssh_forwarding.go

Run it: `openvapt scan --only HOST-SSH-007`. Read it offline: `openvapt explain HOST-SSH-007`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/HOST-SSH-007.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
