Traversée de chemin dans sudo-rs (CVE-2023-42456)
Résumé
Traversée de chemin dans sudo-rs (CVE-2023-42456). Risque d'opérations non autorisées ou de divulgation. Exploitable via useradd. Atténuation : mise à jour vers 0.2.1 ou plus.
Description d'origine
La description telle que publiée par la source (souvent en anglais).
Impact
An issue was discovered where usernames containing the . and / characters could result in the corruption of specific files on the filesystem. As usernames are generally not limited by the characters they can contain, a username appearing to be a relative path can be constructed. For example we could add a user to the system containing the username ../../../../bin/cp. When logged in as a user with that name, that user could run sudo -K to clear their session record file. The session code then constructs the path to the session file by concatenating the username to the session file storage directory, resulting in a resolved path of /bin/cp. The code then clears that file, resulting in the cp binary effectively being removed from the system.
An attacker needs to be able to login as a user with a constructed username. Given that such a username is unlikely to exist on an existing system, they will also need to be able to create the users with the constructed usernames.
Patches
The bug is fixed in version 0.2.1 of sudo-rs. Sudo-rs now uses the uid for the user instead of their username for determining the filename. Note that an upgrade to this version will result in existing session files being ignored and users will be forced to re-authenticate. It also fully eliminates any possibility of path traversal, given that uids are always integer values.
The issue was corrected in commit bfdbda22968e3de43fa8246cab1681cfd5d5493d.
Source: GitHub Security Advisories (Global) NVD GitHub Advisory
Résumé généré automatiquement
Assemblé par SecPulse à partir des données sources (CVSS, CWE, versions affectées) à l'aide de modèles, sans IA. Vérifiez la description d'origine et les références ci-dessous.
Une vulnérabilité référencée CVE-2023-42456 a été découverte dans sudo-rs.
Des attaquants peuvent cibler un point d'entrée spécifique comme useradd à distance pour détourner le produit.
Risque d'opérations non autorisées ou de divulgation. Score CVSS : 3.3/10.
Action : mettez à jour sudo-rs vers 0.2.1 ou supérieur.
En cas de doute, contactez votre service informatique ou cherchez « sudo-rs CVE-2023-42456 » sur le site de l'éditeur.
CVE-2023-42456 (sudo-rs) — CWE-22 / CVSS v3 3.3
Vecteur d'attaque : local
Surface d'attaque : useradd
Correctif : 0.2.1 — appliquer immédiatement
Contournement : The sudo -K and sudo -k commands can run, even if a user has no sudo access.
Plan : 1) Audit SBOM, 2) Mise à jour staging→prod, 3) Surveillance WAF/proxy sur les endpoints affectés, 4) Recherche d'IOC dans les logs.
Réfs : voir GHSA / avis éditeur / version corrigée liés sur cette page.
Une traversée de chemin (CWE-22) affecte sudo-rs. Les attaquants atteignent le code vulnérable via useradd.
Consultez l'avis de l'éditeur pour les versions affectées de sudo-rs. Surface d'attaque : useradd.
Gravité : Faible (CVSS 3.3/10). Risque d'opérations non autorisées ou de divulgation.
Mettre à jour vers 0.2.1.
Contournement : The sudo -K and sudo -k commands can run, even if a user has no sudo access.
Recherchez dans les logs des requêtes correspondant aux IOC connus de cette CVE. Auditez les SBOM/dépendances.
Actions de réponse
Étapes concrètes et exemples de commandes que les équipes SOC/SRE doivent exécuter dans l'ordre
-
1Identify exposure identify
grep -r 'sudo-rs' . | grep -v node_modulesリポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で
sudo-rsを grep し、稼働しているサービス・バージョンを把握する。 -
2Apply temporary workaround mitigate
The `sudo -K` and `sudo -k` commands can run, even if a user has no sudo access.パッチが適用されるまでの応急処置として、The
sudo -Kandsudo -kcommands can run, even if a user has no sudo access. を実施。回避策の副作用 (機能低下) を確認した上で。 -
3Apply patch patch
Upgrade sudo-rs to 0.2.1ステージング環境で 0.2.1 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。
-
4Post-deployment verification verify
Confirm patched version is live in productionパッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。
Paquets affectés
Références
- advisory nvd.nist.gov
- advisory github.com
- advisory rustsec.org
- package github.com
- package crates.io
- web github.com
- web github.com
- web openwall.com
- web github.com
- web ferrous-systems.com
- web ferrous-systems.com
- web cve.mitre.org