CWE-862 Class Incomplete High likelihood

Missing Authorization

This vulnerability occurs when an application fails to verify whether a user has permission to access specific data or execute certain actions before allowing the request to proceed.

Definition

What is CWE-862?

This vulnerability occurs when an application fails to verify whether a user has permission to access specific data or execute certain actions before allowing the request to proceed.
Missing authorization is a common security flaw where an application assumes a user's identity (authentication) is enough to grant access, skipping the crucial step of checking their specific privileges. Think of it like having a key to enter a building (authentication) but then being able to walk into any office or safe without further checks. This allows attackers, including other authenticated users, to access data or perform functions they shouldn't, such as viewing another user's private information, modifying account settings, or deleting critical resources. To prevent this, developers must implement a consistent and robust authorization layer that validates permissions for every request involving sensitive resources or actions. This involves defining clear roles and permissions, checking them against the requested operation and the target data (e.g., ensuring User A can only edit their own profile, not User B's), and centralizing these checks to avoid inconsistencies. Relying solely on UI element hiding is insufficient, as direct API calls or modified requests can easily bypass such superficial controls.
Vulnerability Diagram CWE-862
Missing Authorization user A logged in GET /orders/42 handler isAuthenticated ✓ // no owner check return Order.find(42) order #42 belongs to B A reads B's data IDOR / BOLA Authentication is enforced; per-resource ownership check is missing.
Real-world impact

Real-world CVEs caused by CWE-862

  • chatbot Wordpress plugin does not perform authorization on a REST endpoint, allowing retrieval of an API key

  • AI-enabled WordPress plugin has a missing capability check for a particular function, allowing changing public status of posts

  • Go-based continuous deployment product does not check that a user has certain privileges to update or create an app, allowing adversaries to read sensitive repository information

  • Web application does not restrict access to admin scripts, allowing authenticated users to reset administrative passwords.

  • Web application stores database file under the web root with insufficient access control (CWE-219), allowing direct request.

  • Terminal server does not check authorization for guest access.

  • System monitoring software allows users to bypass authorization by creating custom forms.

  • Content management system does not check access permissions for private files, allowing others to view those files.

How attackers exploit it

Step-by-step attacker path

  1. 1

    This function runs an arbitrary SQL query on a given database, returning the result of the query.

  2. 2

    While this code is careful to avoid SQL Injection, the function does not confirm the user sending the query is authorized to do so. An attacker may be able to obtain sensitive employee information from the database.

  3. 3

    The following program could be part of a bulletin board system that allows users to send private messages to each other. This program intends to authenticate the user before deciding whether a private message should be displayed. Assume that LookupMessageObject() ensures that the $id argument is numeric, constructs a filename based on that id, and reads the message details from that file. Also assume that the program stores all private messages for all users in the same directory.

  4. 4

    While the program properly exits if authentication fails, it does not ensure that the message is addressed to the user. As a result, an authenticated attacker could provide any arbitrary identifier and read private messages that were intended for other users.

  5. 5

    One way to avoid this problem would be to ensure that the "to" field in the message object matches the username of the authenticated user.

Vulnerable code example

Vulnerable PHP

This function runs an arbitrary SQL query on a given database, returning the result of the query.

Vulnerable PHP
function runEmployeeQuery($dbName, $name){
  	mysql_select_db($dbName,$globalDbHandle) or die("Could not open Database".$dbName);
```
//Use a prepared statement to avoid CWE-89* 
  	$preparedStatement = $globalDbHandle->prepare('SELECT * FROM employees WHERE name = :name');
  	$preparedStatement->execute(array(':name' => $name));
  	return $preparedStatement->fetchAll();}
  
   */.../* 
  
  $employeeRecord = runEmployeeQuery('EmployeeDB',$_GET['EmployeeName']);
Secure code example

Secure pseudo

Secure 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.
Prevention checklist

How to prevent CWE-862

  • Architecture and Design Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role.
  • Architecture and Design Ensure that access control checks are performed related to the business logic. These checks may be different than the access control checks that are applied to more generic resources such as files, connections, processes, memory, and database records. For example, a database may restrict access for medical records to a specific database user, but each record might only be intended to be accessible to the patient and the patient's doctor [REF-7].
  • Architecture and Design Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, consider using authorization frameworks such as the JAAS Authorization Framework [REF-233] and the OWASP ESAPI Access Control feature [REF-45].
  • Architecture and Design For web applications, make sure that the access control mechanism is enforced correctly at the server side on every page. Users should not be able to access any unauthorized functionality or information by simply requesting direct access to that page. One way to do this is to ensure that all pages containing sensitive information are not cached, and that all such pages restrict access to requests that are accompanied by an active and authenticated session token associated with a user who has the required permissions to access that page.
  • System Configuration / Installation Use the access control capabilities of your operating system and server environment and define your access control lists accordingly. Use a "default deny" policy when defining these ACLs.
Detection signals

How to detect CWE-862

Automated Static Analysis Limited

Automated static analysis is useful for detecting commonly-used idioms for authorization. A tool may be able to analyze related configuration files, such as .htaccess in Apache web servers, or detect the usage of commonly-used authorization libraries. Generally, automated static analysis tools have difficulty detecting custom authorization schemes. In addition, the software's design may include some functionality that is accessible to any user and does not require an authorization check; an automated technique that detects the absence of authorization may report false positives.

Automated Dynamic Analysis

Automated dynamic analysis may find many or all possible interfaces that do not require authorization, but manual analysis is required to determine if the lack of authorization violates business logic.

Manual Analysis Moderate

This weakness can be detected using tools and techniques that require manual (human) analysis, such as penetration testing, threat modeling, and interactive tools that allow the tester to record and modify an active session. Specifically, manual static analysis is useful for evaluating the correctness of custom authorization mechanisms.

Manual Static Analysis - Binary or Bytecode SOAR Partial

According to SOAR [REF-1479], the following detection techniques may be useful: ``` Cost effective for partial coverage: ``` Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies

Dynamic Analysis with Automated Results Interpretation SOAR Partial

According to SOAR [REF-1479], the following detection techniques may be useful: ``` Cost effective for partial coverage: ``` Web Application Scanner Web Services Scanner Database Scanners

Dynamic Analysis with Manual Results Interpretation SOAR Partial

According to SOAR [REF-1479], the following detection techniques may be useful: ``` Cost effective for partial coverage: ``` Host Application Interface Scanner Fuzz Tester Framework-based Fuzzer

Plexicus auto-fix

Plexicus auto-detects CWE-862 and opens a fix PR in under 60 seconds.

Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.

Frequently asked questions

Frequently asked questions

What is CWE-862?

This vulnerability occurs when an application fails to verify whether a user has permission to access specific data or execute certain actions before allowing the request to proceed.

How serious is CWE-862?

MITRE rates the likelihood of exploit as High — this weakness is actively exploited in the wild and should be prioritized for remediation.

What languages or platforms are affected by CWE-862?

MITRE lists the following affected platforms: AI/ML, Web Server, Database Server.

How can I prevent CWE-862?

Divide the product into anonymous, normal, privileged, and administrative areas. Reduce the attack surface by carefully mapping roles with data and functionality. Use role-based access control (RBAC) [REF-229] to enforce the roles at the appropriate boundaries. Note that this approach may not protect against horizontal authorization, i.e., it will not protect a user from attacking others with the same role. Ensure that access control checks are performed related to the business logic. These…

How does Plexicus detect and fix CWE-862?

Plexicus's SAST engine matches the data-flow signature for CWE-862 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.

Where can I learn more about CWE-862?

MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/862.html. You can also reference OWASP and NIST documentation for adjacent guidance.

Related weaknesses

Weaknesses related to CWE-862

CWE-285 Parent

Improper Authorization

This vulnerability occurs when an application fails to properly verify whether a user has permission to access specific data or perform…

CWE-1230 Sibling

Exposure of Sensitive Information Through Metadata

This vulnerability occurs when an application protects the primary source of sensitive data but fails to secure the metadata derived from…

CWE-1256 Sibling

Improper Restriction of Software Interfaces to Hardware Features

This vulnerability occurs when a system's software interfaces to hardware features—like power, clock, or performance management—are not…

CWE-1297 Sibling

Unprotected Confidential Information on Device is Accessible by OSAT Vendors

This vulnerability occurs when a semiconductor chip does not properly secure sensitive data, making it accessible to third-party…

CWE-1328 Sibling

Security Version Number Mutable to Older Versions

This vulnerability occurs when a hardware system's security version number can be changed, allowing an attacker to downgrade or roll back…

CWE-552 Sibling

Files or Directories Accessible to External Parties

This vulnerability occurs when an application exposes files or directories to users who shouldn't have access to them.

CWE-732 Sibling

Incorrect Permission Assignment for Critical Resource

This vulnerability occurs when a system grants overly permissive access to a sensitive resource, allowing unauthorized users or processes…

CWE-863 Sibling

Incorrect Authorization

This vulnerability occurs when an application checks if a user is allowed to perform an action or access data, but the check is flawed or…

CWE-926 Sibling

Improper Export of Android Application Components

This vulnerability occurs when an Android app makes a component (like an Activity, Service, or Content Provider) available to other apps…

Ready when you are

Don't Let Security
Weigh You Down.

Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.