Independent analysis by NHI Mgmt GroupSource article: SafeBreach, “Forgotten but Not Gone: Unauthenticated RCEs and Privilege Escalations in Legacy Linux Services” (August 8, 2026)

TL;DR: Three severe flaws in legacy Linux services, including an unauthenticated root path in telnetd and two unauthenticated Samba RCEs, one of which had likely existed for about 25 years, were found by SafeBreach, showing how decades-old trust assumptions still create modern attack paths. Legacy service exposure is an inventory and privilege-governance problem, not just a patching problem.


At a glance

What this is: NHI Mgmt Group's analysis, drawing on SafeBreach's research: SafeBreach identified three severe issues in Telnet and Samba, including a root path in telnetd and two unauthenticated Samba RCEs affecting widely deployed legacy Linux services.

Why it matters: This matters because legacy protocols still sit on enterprise networks and unmanaged infrastructure, so asset visibility, network exposure, and privilege control determine whether decades-old flaws remain reachable.

By the numbers:

  • Samba rated both unauthenticated vulnerabilities the maximum CVSS severity of 10.0.
  • One Samba code path appears to have gone unexamined for roughly 25 years.

Context

Legacy Linux services can persist for years because they solve old interoperability problems, not because they are safe by modern standards. Telnet and Samba are especially risky when they remain embedded in servers, printers, and network appliances that security teams do not fully inventory or routinely harden.

The governance issue is not only vulnerability management. When a service accepts unauthenticated input into a privileged execution path, the real failure is that privilege, authentication, and service exposure were never treated as a single control problem. That is why this research is directly relevant to IAM, PAM, and NHI governance as well as broader infrastructure security.


Key questions

Q: What breaks when legacy services accept untrusted input before authentication?

A: Authentication can be bypassed, privilege boundaries can collapse, and helper processes may inherit attacker-controlled state. In practice, that means a service can turn a local or remote input channel into root-level execution if it was designed to trust environment variables, RPC parameters, or shell-formatted commands from unauthenticated callers.

Q: Why do unauthenticated legacy service flaws remain so dangerous on modern networks?

A: Because exposure and privilege are still linked. If a service like Telnet or Samba remains reachable, an attacker may need no credentials at all once the request crosses into a trusted execution path. The risk is amplified when the service sits on unmanaged infrastructure that inventory and patching processes miss.

Q: What are the signs that a service is mixing request handling with shell execution?

A: Look for code or configuration that passes client-supplied values into command strings, print hooks, helper scripts, or RPC handlers that eventually invoke a shell. The strongest warning sign is inconsistent sanitization across code paths, especially where a service was designed to interoperate with older tools or external commands.

Q: Should teams prioritise service exposure reduction or patching first for legacy Linux protocols?

A: Both matter, but exposure reduction usually buys the fastest risk reduction when the flaw is unauthenticated. If a Telnet or Samba interface is not reachable from untrusted networks, the attack surface shrinks immediately while patching and retirement plans catch up. Governance should treat reachability as part of the fix, not a separate concern.


Technical breakdown

Why unauthenticated environment variables became a root path in telnetd

telnetd accepted environment variables from unauthenticated clients before handing control to login. That mattered because login trusted one of those variables, CREDENTIALS_DIRECTORY, as if it came from systemd and used it to locate a file that could suppress authentication. The bug was not memory corruption; it was a trust boundary failure between client-controlled state and a root-process decision point. Once the inherited environment was treated as authoritative, a low-privilege user could influence a privileged authentication flow. This is a classic example of legacy service design assuming cooperative inputs where modern services would demand explicit validation and provenance.

Practical implication: restrict or eliminate client-controlled environment inheritance before a privileged process makes authentication decisions.

How Samba turned client data into shell execution

Samba exposed RPC and print-related functions that formatted client-supplied values into shell commands. If those values are inserted into a command line without consistent sanitization, a normal parameter becomes executable syntax. In the discovered flaws, the attacker did not need credentials or a local foothold: the vulnerable code paths allowed remote request data to cross directly into command execution. This is why legacy interoperability layers are dangerous when they mix protocol handling, scripting hooks, and shell invocation. The risk is architectural, not merely a bad string-handling bug in one function.

Practical implication: remove shell construction from request paths wherever possible and audit any RPC or print workflow that still shells out.

Why decades-old code paths stay exploitable until someone re-reads them

The research shows that age and deployment breadth can hide attack surface rather than reduce it. A code path that has been present for 25 years may only appear stable because it has not been scrutinized against modern assumptions about trust, privilege, and sanitization. The key failure mode is not that the software is old. It is that old code often predates consistent security engineering, yet continues to run in environments that expect current-grade assurance. That makes full-path review of privileged legacy services necessary, especially where they are reachable over the network or embedded in unmanaged devices.

Practical implication: review legacy services as exposed attack paths, not as settled infrastructure, and assume dormant code may still be reachable.


Threat narrative

Attacker objective: The attacker wants privileged command execution on legacy Linux services, up to root access or unauthenticated remote code execution.

  1. Entry occurs when an unauthenticated client reaches telnetd or Samba RPC functionality exposed on the network or a local system.
  2. Credential and state abuse follows when telnetd inherits attacker-controlled environment variables, or Samba formats attacker-controlled request data into shell commands.
  3. Escalation or execution occurs when the privileged telnet login flow trusts CREDENTIALS_DIRECTORY, or Samba passes injected content into command execution.
  4. Impact is root access on the Telnet path or remote code execution through Samba without requiring authentication.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Legacy service exposure is a governance problem, not just a patching problem. The SafeBreach research shows that unauthenticated input reaching privileged code paths is the real control failure. In practice, the issue spans asset inventory, service exposure, and privileged execution governance at the same time, which is why patching alone often leaves residual reachability. Practitioners should treat legacy protocol exposure as a control-plane issue, not a software-only issue.

Root-path trust in client-controlled state is the named failure mode here. Telnetd trusted environment variables that originated outside the privilege boundary, and Samba trusted request parameters that were later used to build shell commands. That is a governance assumption failure: the code assumed provenance it did not verify. This matters for identity security because privileged processes should never treat unauthenticated client state as an authority signal.

Legacy code becomes dangerous when control inheritance outlives the original security model. Systems built for interoperability in the 1990s and early 2000s often embed shell hooks, delegated commands, and implicit trust in ways modern reviews miss. The article shows that these assumptions can survive for decades when services remain operational but lightly governed. Practitioners should assume any long-lived privileged service may contain a similar hidden trust boundary.

Unauthenticated RCE in legacy services is a privileged access problem in disguise. Once a network-reachable service can translate client input into root-level command execution, the difference between infrastructure security and PAM narrows sharply. That is why least privilege, service hardening, and access scoping need to cover not only humans but also the long-lived service accounts and execution contexts those services depend on. Security teams should review all privileged execution paths that accept external input.

Legacy Linux services need the same scrutiny as newer attack surfaces. The article’s central lesson is not that Telnet and Samba are unusual. It is that widely deployed, ordinary infrastructure can hide severe trust failures precisely because it looks familiar. That should push security programmes toward continuous discovery of exposed services and tighter governance over any component that can execute commands on behalf of a client.

From our research library:

What this signals

Legacy privilege paths create an identity boundary problem as much as a software defect. When a daemon accepts client-controlled state and then acts with elevated authority, the control failure sits at the intersection of authentication, access scoping, and execution provenance. Security teams should map every privileged service that still trusts inputs from unauthenticated callers, because those are the paths most likely to survive routine patching.

Inventory quality now matters more than protocol familiarity. A service can be old, stable, and widely used while still being operationally invisible to scanners or asset owners. That creates a hidden-control gap for PAM and NHI governance whenever a root process, helper script, or delegated command can be influenced by external input. Teams should assume exposure is broader than their monitoring shows until proven otherwise.

Unmanaged legacy devices can preserve attack paths long after desktop and server hardening improves. Printers, appliances, and embedded systems often keep legacy services alive in places security programmes do not review often enough. That makes continuous discovery and removal of unnecessary remote services a standing requirement, not a one-time cleanup exercise.


For practitioners

  • Inventory legacy Telnet and Samba exposure Identify every host, printer, appliance, and server that still exposes Telnet or older Samba builds, including systems outside standard vulnerability scan coverage.
  • Remove unauthenticated client control from privileged flows Where a privileged daemon inherits environment variables or request parameters, block untrusted inheritance and require explicit allowlisting before those values reach login or shell execution.
  • Segment network access to legacy services Restrict which hosts can reach Telnet and Samba RPC interfaces, because both vulnerability classes can be triggered without authentication once exposed.
  • Search for shell-command construction in service hooks Review scripts, print handlers, and RPC integrations for command formatting patterns that turn client input into shell syntax, then refactor away from shell invocation.
  • Retire unsupported legacy protocols Prioritize migration from Telnet to modern remote access alternatives and remove services that persist only for backward compatibility or unmanaged device workflows.

Key takeaways

  • Three severe flaws in Telnet and Samba show how legacy services can still expose unauthenticated root or RCE paths when trust boundaries were designed for a different era.
  • The research highlights an operational blind spot, because hundreds of thousands of devices can still run Telnet while a long-lived Samba code path went unnoticed for roughly 25 years.
  • The most effective control is not just patching, but reducing reachability, removing unnecessary legacy services, and preventing client-controlled state from entering privileged execution paths.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-04 — Insecure AuthenticationTelnetd trusted unauthenticated client-controlled state inside a privileged login flow.
NHI-05 — Overprivileged NHIThe telnet daemon and Samba execution paths let low-trust input influence root-level actions.
Recommendation — Remove unauthenticated client influence from privileged authentication paths and verify input provenance before login runs. Constrain privileged service accounts and helper processes so client input cannot alter elevated execution.
MITRE ATT&CKTA0006; TA0008 — Credential Access; Lateral MovementThe article’s exploit paths hinge on credential and trust boundary abuse followed by privileged execution.
Recommendation — Map exposed Telnet and Samba services to credential access and lateral movement techniques, then hunt for reachable instances.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe vulnerabilities arise where authorization is implied by legacy service behaviour rather than enforced.
Recommendation — Apply PR.AA-05 to ensure entitlements and authorizations block client-driven privilege changes.
CIS Controls v8CIS-5 — Account ManagementThe article shows why unmanaged legacy service accounts and delegated commands need lifecycle control.
Recommendation — Use account management controls to remove or tightly govern legacy service execution accounts and helper hooks.

Key terms

  • Legacy Service Exposure: The presence of old but still reachable services on modern infrastructure. These services often remain because they support compatibility or embedded devices, but they can preserve outdated trust assumptions and privileged execution paths that newer controls were never designed to protect.
  • Unauthenticated Remote Code Execution: A flaw that lets an attacker run code on a target system without first proving who they are. In enterprise applications, this is especially dangerous because the code executes inside a trusted workload context, which can expose data, internal services, and downstream privileges.
  • Privilege Escalation via Trusted State: A failure mode where low-privilege input becomes authoritative inside a privileged process. That trusted state can come from environment variables, configuration hooks, or request parameters, allowing an attacker to move from ordinary access to elevated control.
  • Client-Controlled Environment Inheritance: A design pattern in which a privileged service passes environment variables from an untrusted caller into a child process. If the downstream program trusts those variables, the inherited state can influence authentication, file lookup, or command execution in ways the service did not intend.

Deepen your knowledge

The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management. It helps security and identity practitioners translate governance gaps like this into better operational control.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 11, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org