T09 · Insecure Skill Coding Practices
- Location
references/REFERENCE.md:410- Finding
Pod Port Forwarding May Expose Internal Services on All Network Interfaces
- Content
View full analysis
Vulnerability Details
File Location:
references/REFERENCE.md, line 410
Vulnerability Type: Unsafe network service exposure
Risk Level: MediumVulnerable Code
bash kubectl port-forward pod/POD --address 0.0.0.0 8080:8080 # All IPsTechnical Analysis
The documented command binds the forwarded Kubernetes pod port to
0.0.0.0, causing it to listen on every network interface of the local host. Unlike the safer default loopback binding, this can make an internal workload reachable by other systems on the local network or, depending on routing and firewall configuration, from the Internet.kubectl port-forwarddoes not add application authentication or network access controls. If the forwarded service is an administrative interface, metrics endpoint, debugging service, or unauthenticated internal API, anyone able to connect to the host's port 8080 may interact with it.Attack Path
- An operator follows the documented command to access an internal pod.
kubectlbinds port 8080 to all host interfaces.- The host firewall or surrounding network allows another system to reach that port.
- An attacker discovers or is informed of the exposed port.
- The attacker connects to the forwarded endpoint and interacts directly with the pod service.
- If the service lacks effective authentication, the attacker accesses data or performs operations available through that service.
Impact Assessment
The accessible privileges are determined by the forwarded application. Potential impact includes unauthorized access to internal APIs, administrative dashboards, debugging endpoints, operational metrics, or application data. The exposure remains active while the port-forward process runs and is limited by host firewall rules, network reachability, and application-level authentication.
- Remediation
View remediation
Remediation Suggestions
- Use the default loopback binding or specify it explicitly:
bash kubectl port-forward pod/POD --address 127.0.0.1 8080:8080 - Remove the globally bound example from the general command reference.
- If remote access is necessary, require explicit operator approval and document the associated exposure.
- Restrict access with host firewall rules and trusted source-address allowlists.
- Require strong application authentication and TLS for any service intentionally exposed beyond localhost.
- Stop the port-forward process immediately after the diagnostic or administrative task is complete.
- Use the default loopback binding or specify it explicitly:
