Katalog CWE

CWE-272 · Słabość

Least Privilege Violation

Abstrakcja
Bazowa
Status
Niekompletny
Dodano
19 lipca 2006
Ostatnia zmiana
9 września 2025

Podatności CVE z tą słabościąPełny wpis na cwe.mitre.org ↗

Opis

The elevated privilege level required to perform operations such as chroot() should be dropped immediately after the operation is performed.

Skutki

  • Access Control, Confidentiality

    Gain Privileges or Assume Identity; Read Application Data; Read Files or Directories

    An attacker may be able to access resources with the elevated privilege that could not be accessed with the attacker's original privileges. This is particularly likely in conjunction with another flaw, such as a buffer overflow.

Zapobieganie

  • Architecture and Design, Operation

    Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.

  • Architecture and Design · Separation of Privilege

    Follow the principle of least privilege when assigning access rights to entities in a software system.

  • Architecture and Design · Separation of Privilege

    Compartmentalize the system to have "safe" areas where trust boundaries can be unambiguously drawn. Do not allow sensitive data to go outside of the trust boundary and always be careful when interfacing with a compartment outside of the safe area.

    Ensure that appropriate compartmentalization is built into the system design, and the compartmentalization allows for and reinforces privilege separation functionality. Architects and designers should rely on the principle of least privilege to decide the appropriate time to use privileges and the time to drop privileges.

Słabość nadrzędna

Kiedy powstaje

Dotyczy

Not Language-Specific

Uwagi

CWE-271, CWE-272, and CWE-250 are all closely related and possibly overlapping. CWE-271 is probably better suited as a category.

If system privileges are not dropped when it is reasonable to do so, this is not a vulnerability by itself. According to the principle of least privilege, access should be allowed only when it is absolutely necessary to the function of a given system, and only for the minimal necessary amount of time. Any further allowance of privilege widens the window of time during which a successful exploitation of the system will provide an attacker with that same privilege. If at all possible, limit the allowance of system privilege to small, simple sections of code that may be called atomically.

When a program calls a privileged function, such as chroot(), it must first acquire root privilege. As soon as the privileged operation has completed, the program should drop root privilege and return to the privilege level of the invoking user.

Źródła

  1. Seven Pernicious Kingdoms: A Taxonomy of Software Security Errors — Katrina Tsipenyuk, Brian Chess, Gary McGraw, NIST, 2005
  2. State-of-the-Art Resources (SOAR) for Software Vulnerability Detection, Test, and Evaluation — Gregory Larsen, E. Kenneth Hong Fong, David A. Wheeler, Rama S. Moorthy, 2014

Wpis z katalogu CWE 4.20.