CWE-267 Base Incomplete

Privilege Defined With Unsafe Actions

This vulnerability occurs when a system grants a user, role, or process a specific permission that can be misused to perform dangerous, unintended actions. The permission itself is correctly…

Definition

What is CWE-267?

This vulnerability occurs when a system grants a user, role, or process a specific permission that can be misused to perform dangerous, unintended actions. The permission itself is correctly assigned, but its scope is too broad or allows for unsafe operations.
At its core, this weakness is about over-privilege. A system might correctly identify that a user needs to edit files, but if the associated 'edit' permission also allows them to overwrite critical system files or execute code, the privilege is dangerously defined. Developers often make this mistake by using coarse-grained permissions that bundle safe and unsafe actions together, or by not considering all the destructive ways a seemingly benign right could be exploited. To prevent this, implement the principle of least privilege by defining permissions based on specific, safe actions rather than broad capabilities. Audit your authorization logic to ensure each granted right cannot be chained or used in an unexpected context to cause harm. Security testing should explicitly check if assigned privileges can be leveraged to bypass security controls or perform actions outside the user's intended role.
Auswirkungen in der Praxis

Real-world CVEs caused by CWE-267

  • Roles have access to dangerous procedures (Accessible entities).

  • Untrusted object/method gets access to clipboard (Accessible entities).

  • Gain privileges using functions/tags that should be restricted (Accessible entities).

  • Traceroute program allows unprivileged users to modify source address of packet (Accessible entities).

  • Bypass domain restrictions using a particular file that references unsafe URI schemes (Accessible entities).

  • Script does not restrict access to an update command, leading to resultant disk consumption and filled error logs (Accessible entities).

  • "public" database user can use stored procedure to modify data controlled by the database owner (Unsafe privileged actions).

  • User with capability can prevent setuid program from dropping privileges (Unsafe privileged actions).

Wie Angreifer es ausnutzen

Angreiferpfad Schritt für Schritt

  1. 1

    Identifiziere einen Codepfad, der nicht vertrauenswürdige Eingaben ohne Validierung verarbeitet.

  2. 2

    Erzeuge eine Payload, die das unsichere Verhalten auslöst — Injection, Traversal, Overflow oder Logik-Missbrauch.

  3. 3

    Liefere die Payload über einen normalen Request aus und beobachte die Reaktion der Anwendung.

  4. 4

    Iteriere, bis die Antwort Daten preisgibt, Angreifer-Code ausführt oder Berechtigungen eskaliert.

Verwundbares Codebeispiel

Vulnerable Java

This code intends to allow only Administrators to print debug information about a system.

Verwundbar Java
public enum Roles {
  	ADMIN,USER,GUEST
  }
  public void printDebugInfo(User requestingUser){
  		if(isAuthenticated(requestingUser)){
  				switch(requestingUser.role){
  						case GUEST:
  							System.out.println("You are not authorized to perform this command");
  							break;
  						default:
  							System.out.println(currentDebugState());
  							break;
  				}
  		}
  		else{
  			System.out.println("You must be logged in to perform this command");
  		}
  }
Sicheres Codebeispiel

Secure pseudo

Sicher pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Präventions-Checkliste

How to prevent CWE-267

  • Architecture and Design / Operation Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software.
  • Architecture and Design / Operation Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need to run as the database administrator, especially in day-to-day operations.
Erkennungssignale

How to detect CWE-267

SAST High

Führe statische Analyse (SAST) auf der Codebasis aus und suche im Datenfluss nach dem unsicheren Muster.

DAST Moderate

Führe dynamische Application-Security-Tests gegen den Live-Endpoint aus.

Runtime Moderate

Beobachte Runtime-Logs auf ungewöhnliche Exception-Traces, fehlerhafte Eingaben oder Versuche, Autorisierung zu umgehen.

Code review Moderate

Code Review: Markiere jeden neuen Code, der Eingaben von dieser Oberfläche ohne validierte Framework-Helper verarbeitet.

Plexicus Auto-Fix

Plexicus erkennt CWE-267 automatisch und öffnet in unter 60 Sekunden einen Fix-PR.

Codex Remedium scannt jeden Commit, identifiziert genau diese Schwachstelle und liefert einen reviewer-ready Pull Request mit dem Patch. Keine Tickets. Keine Hand-offs.

Häufig gestellte Fragen

Frequently asked questions

Was ist CWE-267?

This vulnerability occurs when a system grants a user, role, or process a specific permission that can be misused to perform dangerous, unintended actions. The permission itself is correctly assigned, but its scope is too broad or allows for unsafe operations.

Wie gravierend ist CWE-267?

MITRE hat für diese Schwachstelle keine Exploit-Wahrscheinlichkeit veröffentlicht. Behandle sie als mittlere Auswirkung, bis dein Threat Model anderes belegt.

Welche Sprachen oder Plattformen sind von CWE-267 betroffen?

MITRE hat für diese CWE keine betroffenen Plattformen spezifiziert — sie kann in den meisten Anwendungs-Stacks auftreten.

Wie kann ich CWE-267 verhindern?

Very carefully manage the setting, management, and handling of privileges. Explicitly manage trust zones in the software. Run your code using the lowest privileges that are required to accomplish the necessary tasks [REF-76]. If possible, create isolated accounts with limited privileges that are only used for a single task. That way, a successful attack will not immediately give the attacker access to the rest of the software or its environment. For example, database applications rarely need…

Wie erkennt und behebt Plexicus CWE-267?

Die SAST-Engine von Plexicus erkennt die Datenfluss-Signatur von CWE-267 bei jedem Commit. Bei einem Treffer öffnet unser Codex-Remedium-Agent einen Fix-PR mit korrigiertem Code, Tests und einer einzeiligen Zusammenfassung für den Reviewer.

Wo erfahre ich mehr über CWE-267?

MITRE veröffentlicht die kanonische Definition unter https://cwe.mitre.org/data/definitions/267.html. Für ergänzende Hinweise kannst du auch die OWASP- und NIST-Dokumentation heranziehen.

Verwandte Schwachstellen

Weaknesses related to CWE-267

CWE-269 Parent

Improper Privilege Management

This vulnerability occurs when an application fails to correctly manage user permissions, allowing someone to perform actions or access…

CWE-250 Sibling

Execution with Unnecessary Privileges

This vulnerability occurs when software runs with higher permissions than it actually needs to perform its tasks. This excessive privilege…

CWE-266 Sibling

Incorrect Privilege Assignment

This vulnerability occurs when a system mistakenly grants a user, process, or entity a specific permission or privilege they should not…

CWE-268 Sibling

Privilege Chaining

Privilege chaining occurs when an attacker combines two separate permissions or capabilities, neither of which is dangerous on its own, to…

CWE-270 Sibling

Privilege Context Switching Error

This vulnerability occurs when an application fails to properly manage user permissions while moving between different security contexts,…

CWE-271 Sibling

Privilege Dropping / Lowering Errors

This vulnerability occurs when a system or process fails to reduce its elevated permissions before transferring control of a resource to a…

CWE-274 Sibling

Improper Handling of Insufficient Privileges

This vulnerability occurs when an application fails to properly manage situations where it lacks the necessary permissions to execute an…

CWE-648 Sibling

Incorrect Use of Privileged APIs

This vulnerability occurs when software incorrectly uses functions that require special permissions. Attackers can exploit these mistakes…

CWE-623 Child

Unsafe ActiveX Control Marked Safe For Scripting

This vulnerability occurs when an ActiveX control designed for limited use is incorrectly flagged as safe for scripting, allowing web…

Bereit, wenn du es bist

Schluss mit dem Bezahlen pro Entwickler.
Schließ den Kreislauf.

Plexicus ist die KI-native ASPM, die scannt, filtert, fixt, pentestet und erklärt — autonom. Unbegrenzte Entwickler, unbegrenzte Repos, Fair-Use-KI-Aktionen. Echter kostenloser Tarif, €269/mo jährlich, wenn du bereit bist.