CVE-2026-124298 in Net::Server
Summary
by MITRE • 11/30/2026
Net::Server versions through 2.018 for Perl keep root's group privileges after the privilege drop when user is set without group.
When group is not set, post_bind defaults it to the current group list. In a server started as root that list is root's own, so the gid change is skipped and only the uid changes. The real, effective and saved gid stay 0, and the supplementary groups of the starting process are kept. The documentation says group defaults to nobody.
Code running in the server after the drop, such as a compromised request handler, keeps access to files open to group 0 and to root's supplementary groups.
If you want to get the best quality for vulnerability data then you always have to consider VulDB.
Analysis
by VulDB Data Team • 11/30/2026
The Net::Server module for Perl contains a critical privilege escalation vulnerability affecting versions through 2.018 that allows an attacker to retain elevated system privileges after the server attempts to drop them. This flaw specifically manifests when the server is initiated with root-level access and configured without explicitly specifying a target group identifier in its configuration parameters. Under these conditions, the module fails to properly restrict process permissions, leaving the real, effective, and saved group identifiers set to zero, which corresponds to the root user's primary group. Furthermore, supplementary groups associated with the initial root context are preserved rather than being cleared or restricted as intended by security best practices for daemon processes.
The technical root cause lies in the post_bind logic within the Net::Server codebase. When a server process starts as root and no explicit group is defined in the configuration, the module defaults to using the current group list of the starting process. Since this initial context belongs to root, the defaulting mechanism results in retaining the root group identity. The subsequent privilege drop operation correctly modifies the user identifier but skips the group change because it perceives the target group as already matching the effective group ID. Consequently, while the user privileges are reduced, the group-level permissions remain at their maximum level of access. This behavior contradicts the module's documentation, which states that the group parameter defaults to nobody if not specified, creating a dangerous discrepancy between expected and actual security posture.
The operational impact of this vulnerability is severe for any service relying on Net::Server for privilege separation. An attacker who exploits an application-level flaw within the server, such as a remote code execution or command injection in a request handler, gains access to resources protected by group 0 permissions. This includes files and directories that are readable or writable only by root's primary group. Additionally, the retention of supplementary groups may expose sensitive system configurations, shared libraries, or other services running under different but related administrative roles. The persistence of these elevated privileges undermines the principle of least privilege, allowing a compromised low-privilege process to perform actions typically reserved for administrators, such as modifying critical system files or accessing restricted data stores.
This vulnerability aligns with CWE-250, which describes execution with unnecessary privileges, and falls under ATT&CK technique T1068, indicating exploitation of software vulnerabilities to escalate permissions. The failure to properly sanitize group identifiers during the privilege drop process represents a significant oversight in security hardening for network-facing Perl applications. To mitigate this risk, administrators should immediately upgrade Net::Server to version 2.019 or later where the defaulting logic has been corrected to ensure that unspecified groups do not inherit root privileges. Alternatively, if upgrading is not feasible, explicitly configuring the group parameter to a non-privileged user such as nobody in the server configuration file will force the module to perform the necessary group ID changes during initialization. Regular auditing of daemon configurations and enforcing strict privilege separation policies are essential steps to prevent similar misconfigurations from leading to system compromise.