pam_econf's Relative Search Path Put Local Configuration Back in Play
Privileged programs often inherit the current working directory even when they reject untrusted environment variables. CVE-2026-137898 shows why that inherited path still matters. When Linux-PAM is built with libeconf and its vendor directory is unconfigured, the pam_econf handler misinterpreted the search path and looked for configuration relative to the current working directory.
The local attack path
A local unprivileged user places crafted environment configuration files in a world-writable directory. If an administrator runs a privileged command such as sudo from that directory, the handler loads the malicious variables into the privileged process. The result can be local privilege escalation.
This is not a remote web flaw, and it is not a generic flaw in every PAM installation. The CVE requires a build with libeconf integration and an unconfigured vendor directory. Red Hat states that its standard Enterprise Linux releases are not affected because their Linux-PAM packages do not use the vulnerable libeconf integration. Red Hat Hardened Images are listed as affected in the CVE record.
Why relative configuration is dangerous here
The privilege transition changes the trust level of the same process. Before sudo, an environment file in the current directory may be ordinary user data. After sudo, that data affects authentication or session policy in a root process. The working directory was user-controlled across that transition.
The bug is rated Important by Red Hat with CVSS 3.1 at 7.3. The vector is local, requires low privileges and user interaction, and produces high confidentiality, integrity, and availability impact. The user interaction condition is operationally concrete: an administrator has to run a privileged command from the attacker-controlled directory.
Remediation
Apply the vendor update for affected builds and distributions. The Linux-PAM pull request referenced by the CVE is the upstream patch source. Do not infer safety from the package name alone. Inventory needs to capture build options, libeconf integration, vendor-directory configuration, and the distribution backport state.
Where a patch is not yet deployed, prevent privileged commands from resolving configuration relative to the caller's working directory. Run administrative commands from a trusted directory, remove world-writable execution paths from administrative workflows, and use sudo controls that set a fixed working directory where supported. These are compensating controls, not a substitute for the build fix.
Verification
On a disposable affected host, create a test directory writable by a low-privilege user and place non-secret fixture configuration there. Run an approved privileged test command from that directory and confirm that the patched handler does not load the fixture. Review the build configuration and package changelog to confirm that the fix is actually present.
Do not place real credentials or production policy in the test fixture. Log the privileged command, current working directory, configuration lookup decision, and package build identity. If the lookup path is not exposed in logs, the inventory and patch record become the primary evidence.
The CVE has a narrow build condition, but narrow conditions can disappear in custom images and vendor rebuilds. The response should verify the binary's build features rather than relying only on a distribution-level statement.
Top comments (0)