{"id":"CVE-2025-27591","aliases":["CVE-2025-27591","GHSA-9mc5-7qhg-fp3w","RUSTSEC-2025-0149"],"related":[],"kind":"vulnerability","state":"published","title":"Below has Incorrect Permission Assignment for Critical Resource","summary":"A privilege escalation vulnerability existed in the Below service prior to v0.9.0 due to the creation of a world-writable directory at /var/log/below. This could have allowed local unprivileged users to escalate to root privileges through symlink attacks that manipulate files such as /etc/shadow.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"A privilege escalation vulnerability existed in the Below service prior to v0.9.0 due to the creation of a world-writable directory at /var/log/below. This could have allowed local unprivileged users to escalate to root privileges through symlink attacks that manipulate files such as /etc/shadow.","source":"cvelist"},{"lang":"en","text":"### Impact\nA privilege escalation vulnerability existed in the Below service prior to v0.9.0 due to the creation of a world-writable directory at /var/log/below. This could have allowed local unprivileged users to escalate to root privileges through symlink attacks that manipulate files such as /etc/shadow.\n\n### Patches\nhttps://github.com/facebookincubator/below/commit/10e73a21d67baa2cd613ee92ce999cda145e1a83\n\nThis is included in version 0.9.0\n\n### Workarounds\nChange the permission on `/var/log/below` manually\n\n### References\nhttps://www.facebook.com/security/advisories/cve-2025-27591\nhttps://www.cve.org/CVERecord?id=CVE-2025-27591","format":"markdown","source":"ghsa"},{"lang":"en","text":"Below is a tool for recording and displaying system data like\nhardware utilization and cgroup information on Linux.\n\n## Symlink Attack in `/var/log/below/error_root.log`\n\nBelow's systemd service runs with full `root` privileges. It attempts to\ncreate a world-writable directory in `/var/log/below`. Even if the\ndirectory already exists, the Rust code ensures [1] that it receives\nmode 0777 permissions:\n\n```\n    if perm.mode() & 0o777 != 0o777 {\n        perm.set_mode(0o777);\n        match dir.set_permissions(perm) {\n            Ok(()) => {}\n            Err(e) => {\n                bail!(\n                    \"Failed to set permissions on {}: {}\",\n                    path.to_string_lossy(),\n                    e\n                );\n            }\n        }\n    }\n```\n\nThis logic leads to different outcomes depending on the packaging on Linux\ndistributions:\n\n- in openSUSE Tumbleweed the directory was packaged with 01755\n  permissions (below.spec [2] line 73), thus causing the\n  `set_permissions()` call to run, resulting in a directory with mode\n  0777 during runtime.\n- in Gentoo Linux the directory is created with mode 01755 resulting in\n  the same outcome as on openSUSE Tumbleweed (below.ebuild [3]).  Where\n  the 01755 mode is exactly coming from is not fully clear, maybe the\n  `cargo` build process assigns these permissions during installation.\n- in Fedora Linux the directory is packaged with 01777 permissions, thus\n  the `set_permissions()` code will not run, because the `if` condition\n  masks out the sticky bit. The directory stays at mode 01777\n  (rust-below.spec [4]).\n- the Arch Linux AUR package [5] (maybe wrongly) does not pre-create\n  the log directory. Thus the `set_permissions()` code will run and\n  create the directory with mode 0777.\n\nBelow creates a log file in `/var/log/below/error_root.log` and assigns\nmode 0666 to it. This (somewhat confusingly) happens via a `log_dir`\nvariable [6], which has been changed to point to the `error_root.log`\nfile. The 0666 permission assignment to the logfile happens in\n`logging::setup()` [7], also accompanied by a somewhat strange comment\nin the code.\n\nA local unprivileged attacker can stage a symlink attack in this\nlocation and cause an arbitrary file in the system to obtain 0666\npermissions, likely leading to a full local root exploit, if done right,\ne.g. by pointing the symlink to `/etc/shadow`. Even if the file already\nexists it can be removed and replaced by a symlink, because of the\nworld-writable directory permissions. The attack is thus not limited to\nscenarios in which the file has not yet been created by Below.\n\n## Further Issues\n\nEven on Fedora Linux, where `/var/log/below` has \"safe\" 01777\npermissions, there is a time window during which problems can arise. As\nlong as `below.service` has not been started, another local user can\npre-create `/var/log/below/error_root.log` and e.g. place a FIFO special\nfile there. This will pose a local DoS against the below service, since\nit will fail to open the path and thus fail to start.\n\nIf `/var/log/below` were to be deleted for any reason, then Below would\nstill recreate it using the bad 0777 mode permissions, which can also\nhappen on distributions that initially package `/var/log/below` using\npermissions that do not trigger the `set_permissions()` call in Below's\ncode.\n\n[1]: https://github.com/facebookincubator/below/blob/v0.8.1/below/src/main.rs#L379\n[2]: https://build.opensuse.org/projects/openSUSE:Factory/packages/below/files/below.spec?expand=1&rev=5e78e7f743f87bea8648eeee673c649b\n[3]: https://github.com/gentoo/gentoo/blob/master/sys-process/below/below-0.8.1-r1.ebuild#L344\n[4]: https://src.fedoraproject.org/rpms/rust-below/blob/6ae58353b5d12e58462425c20a2aedfbae2e769a/f/rust-below.spec#_108\n[5]: https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=below#n34\n[6]: https://github.com/facebookincubator/below/blob/v0.8.1/below/src/main.rs#L552\n[7]: https://github.com/facebookincubator/below/blob/v0.8.1/below/src/open_source/logging.rs#L68","format":"markdown","source":"rustsec"},{"lang":"es","text":"En el servicio Below existía una vulnerabilidad de escalada de privilegios antes de la versión v0.9.0 debido a la creación de un directorio con permisos de escritura para todo el mundo en /var/log/below. Esto podría haber permitido que usuarios locales sin privilegios escalaran a privilegios de superusuario mediante ataques de enlaces simbólicos que manipulan archivos como /etc/shadow.","source":"nvd"}],"published":"2025-03-11T18:29:21.569Z","modified":"2026-06-17T09:03:52.557Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":6.8,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:L/I:H/A:N","score":6.8,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N","rating":"HIGH"},{"scorer":"RustSec Advisory Database","scheme":"CVSS:4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"}],"cwes":["CWE-732"],"affected":[{"ranges":[{"type":"semver","introduced":"0.0.0","fixed":"0.9.0","status":"affected"}],"vendor":"Meta Platforms, Inc","product":"below","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.9.0"}],"ecosystem":"crates.io","package":"below","purl":"pkg:cargo/below","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.9.0"}],"ecosystem":"crates.io","package":"below","purl":"pkg:cargo/below","source":"rustsec"},{"ranges":[{"status":"affected","fixed":"0.9.0"}],"vendor":"facebook","product":"below","cpe":"cpe:2.3:a:facebook:below:*:*:*:*:*:rust:*:*","source":"nvd"}],"references":[{"url":"https://www.facebook.com/security/advisories/cve-2025-27591","tags":["patch","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/facebookincubator/below/commit/da9382e6e3e332fd2c3195e22f34977f83f0f1f3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"http://www.openwall.com/lists/oss-security/2025/03/12/1","tags":["exploit","mailing-list","web"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/facebookincubator/below/security/advisories/GHSA-9mc5-7qhg-fp3w","tags":["web"],"sources":["ghsa"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27591","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/facebookincubator/below/commit/10e73a21d67baa2cd613ee92ce999cda145e1a83","tags":["web"],"sources":["ghsa"]},{"url":"https://github.com/facebookincubator/below","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0149.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://www.openwall.com/lists/oss-security/2025/03/12/1","tags":["web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/below","tags":["package"],"sources":["rustsec"]}],"credits":[],"assigner":"facebook","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2025-03-21T20:37:38.689Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-27591","url":"https://www.cve.org/CVERecord?id=CVE-2025-27591","licence":"CVE Terms of Use","modified":"2025-03-21T20:38:10.292Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-9mc5-7qhg-fp3w","url":"https://github.com/advisories/GHSA-9mc5-7qhg-fp3w","licence":"CC-BY-4.0","modified":"2026-02-08T01:20:45.748Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0149","url":"https://rustsec.org/advisories/RUSTSEC-2025-0149.html","licence":"CC0-1.0","modified":"2026-02-08T07:26:28.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-27591","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-27591","licence":"Public domain","modified":"2026-06-17T09:03:52.557Z"}],"updatedAt":"2026-11-25T22:58:55.161Z","epss":{"score":0.00372,"percentile":0.33146,"date":"2026-12-01T12:00:22.000Z"}}