Description of problem: ncurses uses the TERMINFO and HOME environment variables to search for terminfo entries. If there is a bug in parsing or handling (e.g. CVE-2023-29491), it can be exploited for setuid applications. ncurses has configure option --disable-root-environ to not use there variables when running as root. Consider building ncurses with this option to avoid this class of security issues. How reproducible: always Steps to Reproduce: 1. TERMINFO="/tmp/terminfo" strace bash -i -c true |& grep terminfo Actual results: stat("/tmp/terminfo", 0x55b8e99c2900) = -1 ENOENT (No such file or directory) stat("/root/.terminfo", 0x55b8e99c2900) = -1 ENOENT (No such file or directory) stat("/etc/terminfo", {st_mode=S_IFDIR|0755, st_size=6, ...}) = 0 stat("/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=195, ...}) = 0 access("/etc/terminfo/s/screen", R_OK) = -1 ENOENT (No such file or directory) access("/usr/share/terminfo/s/screen", R_OK) = 0 openat(AT_FDCWD, "/usr/share/terminfo/s/screen", O_RDONLY) = 3 Expected results: No access to /tmp/terminfo and /root/.terminfo is observed Additional info: