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.
http://seclists.org/oss-sec/2018/q1/38
http://www.securityfocus.com/bid/102525
http://www.securitytracker.com/id/1040162
https://access.redhat.com/errata/RHSA-2018:0805
https://security.netapp.com/advisory/ntap-20190404-0003/
https://usn.ubuntu.com/3534-1/
https://usn.ubuntu.com/3536-1/
https://www.exploit-db.com/exploits/43775/
https://www.exploit-db.com/exploits/44889/
https://www.halfdog.net/Security/2017/LibcRealpathBufferUnderflow/
Source: MITRE
Published: 2018-01-31
Updated: 2019-10-03
Type: CWE-787
Base Score: 7.2
Vector: AV:L/AC:L/Au:N/C:C/I:C/A:C
Impact Score: 10
Exploitability Score: 3.9
Severity: HIGH
Base Score: 7.8
Vector: CVSS:3.0/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Impact Score: 5.9
Exploitability Score: 1.8
Severity: HIGH