cbcvebase.
CVE-2018-1000001
published 2018-01-31

CVE-2018-1000001: In glibc 2.26 and earlier there is confusion in the usage of getcwd() by realpath() which can be used to write before the destination buffer leading to a…

PriorityP277high7.8CVSS 3.0
AVLACLPRLUINSUCHIHAH
ITWEXPLOITVulnCheck KEV
Exploited in the wild
EPSS
13.37%
96.0th percentile
In glibc 2.26 and earlier there is confusion in the usage of getcwd() by realpath() which can be used to write before the destination buffer leading to a buffer underflow and potential code execution.

Affected

21 ranges
VendorProductVersion rangeFixed in
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
canonicalubuntu_linux
debianglibc< glibc 2.26-4 (bookworm)glibc 2.26-4 (bookworm)
eglibceglibc>= 0 < 2.19-0ubuntu6.142.19-0ubuntu6.14
gnuglibc<= 2.26
gnuglibc>= 0 < 2.26-42.26-4
gnuglibc>= 0 < 2.26-42.26-4
gnuglibc>= 0 < 2.26-42.26-4
gnuglibc>= 0 < 2.26-42.26-4
gnuglibc>= 0 < 2.23-0ubuntu102.23-0ubuntu10
musl-libcmusl>= 0 < 0.9.15-1ubuntu0.1~esm10.9.15-1ubuntu0.1~esm1
musl-libcmusl>= 0 < 1.1.9-1ubuntu0.1~esm21.1.9-1ubuntu0.1~esm2
redhatenterprise_linux_desktop
redhatenterprise_linux_server
redhatenterprise_linux_server_aus
redhatenterprise_linux_server_eus
redhatenterprise_linux_server_tus
redhatenterprise_linux_workstation
redhatvirtualization_host

Detection & IOCsextracted from sources · hover to see the quote

filenameRationalLove.c
filenameRationalLove
pathdata/exploits/cve-2018-1000001/
commandgcc -w -o #{path} #{path}.c
commandecho '#{payload_path} & exit' | #{@executable_path}
commandldd --version
bytes
\x06\x00\x00\x00\x24\x00\x00\x00\x3e\x00\x00\x00\x7f\xb9\x08\x00\x4f\x86\x09\x00
  • Detect exploit compilation or execution of RationalLove binary dropped in writable directories (e.g. /tmp). Look for hidden filenames matching random alphanumeric patterns prefixed with '.' spawned from a shell or meterpreter session.
  • Monitor for unprivileged processes invoking 'umount' with an unusually large argument list including '/' repeated multiple times and 'LABEL=' strings of incrementing length — a hallmark of the RationalLove stack-spray technique.
  • Alert on processes setting LC_ALL=C.UTF-8 while spawning umount with a large number of AANGUAGE= environment variables — the exploit uses 256 such variables for stack spraying.
  • Detect creation of user namespaces by unprivileged users (clone_flags including CLONE_NEWUSER|CLONE_NEWNS). The exploit requires /proc/sys/kernel/unprivileged_userns_clone=1 and fails without it.
  • Monitor for gcc compilation of a .c file immediately followed by chmod +x and execution of the resulting binary from /tmp or another world-writable directory — consistent with live-compile exploit delivery.
  • Look for processes reading /proc/<pid>/cwd where the target pid belongs to a namespaced process, combined with subsequent realpath() calls — indicative of the exploit's CWD manipulation phase.
  • Flag glibc versions matching '2.23-0ubuntu' or '2.24-11+deb9' via ldd --version output in process execution logs — these are the only versions with known working offsets in the exploit.
  • ·Exploitation requires unprivileged user namespaces to be enabled (kernel parameter not on by default). On RHEL 7.4 the vulnerability exists but is not exploitable with default kernel settings.
  • ·RHEL 6 with its default kernel is not exploitable because the kernel does not violate glibc's getcwd() assumption; containers on RHEL 6 running on a host kernel >= 2.6.36 may be vulnerable.
  • ·The Metasploit module only has working offsets for two specific glibc builds (2.23-0ubuntu9 and 2.24-11+deb9u1); other distributions require new offset parameters to be added to osSpecificExploitDataList.
  • ·A reboot is required after patching to fully apply the fix on Ubuntu systems.

CVSS provenance

nvdv3.07.8HIGHCVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
nvdv2.07.2HIGHAV:L/AC:L/Au:N/C:C/I:C/A:C
osv9.8CRITICAL
vulncheck7.8HIGH
vendor_ubuntu9.8CRITICAL
vendor_debian7.8HIGH
vendor_redhat7.8HIGH
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.