CWE-284
The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor....
Precogs AI Insight
"Precogs AI identifies broken access control patterns including IDOR, missing authorization checks, and horizontal privilege escalation."
What is CWE-284 (Improper Access Control)?
The product does not restrict or incorrectly restricts access to a resource from an unauthorized actor.
Vulnerability Insights
Improper Access Control (CWE-284) represents a significant security risk across modern software systems. This weakness enables attackers to exploit access control flaws in applications, potentially leading to unauthorized access, data exfiltration, or remote code execution. Organizations must implement defense-in-depth strategies combining static analysis, runtime monitoring, and binary analysis to detect and mitigate these vulnerabilities.
Impact on Systems
- Horizontal Privilege Escalation: Accessing other users' resources
- Vertical Privilege Escalation: Gaining administrative capabilities
Real-World Attack Scenario
The attacker logs in as a standard user and intercepts the HTTP traffic. They observe that object identifiers (like user IDs or document IDs) are passed sequentially. By incrementing or modifying the ID in subsequent requests, they access resources belonging to other users or administrators because the server fails to verify authorization context.
Code Examples
Vulnerable Implementation
// VULNERABLE: Object-level access check missing
function getProfile(userId) {
return db.find(userId);
}
Secure Alternative
// SECURE: Verifies caller owns the object
function getProfile(userId, activeSession) {
if (activeSession.id !== userId && !activeSession.isAdmin) throw "Unauthorized";
return db.find(userId);
}
Detection with Precogs AI
Precogs AI identifies broken access control patterns including IDOR, missing authorization checks, and horizontal privilege escalation. Our binary analysis engine examines compiled artifacts without requiring source code access, identifying CWE-284 patterns in vendor software, containers, firmware, and third-party libraries.
Remediation
Implement proper access control controls following secure coding guidelines. Use automated scanning tools like Precogs AI to continuously monitor for CWE-284 vulnerabilities across your software supply chain. Apply the principle of least privilege and validate all inputs from untrusted sources.