CWE-732: Incorrect Permission Assignment for Critical Resource
Incorrect Permission Assignment for Critical Resource
Weakness ID: 732 (Weakness Class)
Status: Draft
Description
Description Summary
The software specifies permissions for a security-critical
resource in a way that allows that resource to be read or modified by unintended
actors.
Extended Description
When a resource is given a permissions setting that provides access to a
wider range of actors than required, it could lead to the disclosure of
sensitive information, or the modification of that resource by unintended
parties. This is especially dangerous when the resource is related to
program configuration, execution or sensitive user data.
Time of Introduction
Architecture and Design
Implementation
Installation
Operation
Applicable Platforms
Languages
All
Likelihood of Exploit
Medium to High
Potential Mitigations
Phase
Description
Architecture and Design
When using a critical resource such as a configuration file, check to
see if the resource has insecure permissions (such as being modifiable
by any regular user), and generate an error or even exit the software if
there is a possibility that the resource could have been modified by an
unauthorized party.
Architecture and Design
Divide your application into anonymous, normal, privileged, and
administrative areas. Reduce the attack surface by carefully defining
distinct user groups, privileges, and/or roles. Map these against data,
functionality, and the related resources. Then set the permissions
accordingly. This will allow you to maintain more fine-grained control
over your resources.
Implementation
During program startup, explicitly set the default permissions or
umask to the most restrictive setting possible. Also set the appropriate
permissions during program installation. This will prevent you from
inheriting insecure permissions from any user who installs or runs the
program.
System Configuration
For all configuration files, executables, and libraries, make sure
that they are only readable and writable by the software's
administrator.
Documentation
Do not suggest insecure configuration changes in your documentation,
especially if those configurations can extend to resources and other
software that are outside the scope of your own software.
Installation
Do not assume that the system administrator will manually change the
configuration to the settings that you recommend in the manual.
Testing
Use 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. These may be more
effective than strictly automated techniques. This is especially the
case with weaknesses that are related to design and business
rules.
Testing
Use monitoring tools that examine the software's process as it
interacts with the operating system and the network. This technique is
useful in cases when source code is unavailable, if the software was not
developed by you, or if you want to verify that the build phase did not
introduce any new weaknesses. Examples include debuggers that directly
attach to the running process; system-call tracing utilities such as
truss (Solaris) and strace (Linux); system activity monitors such as
FileMon, RegMon, Process Monitor, and other Sysinternals utilities
(Windows); and sniffers and protocol analyzers that monitor network
traffic.
Attach the monitor to the process and watch for library functions or
system calls on OS resources such as files, directories, and shared
memory. Examine the arguments to these calls to infer which permissions
are being used.
Note that this technique is only useful for permissions issues related
to system resources. It is not likely to detect application-level
business rules that are related to permissions, such as if a user of a
blog system marks a post as "private," but the blog system inadvertently
marks it as "public."
Testing
System Configuration
Ensure that your software runs properly under the Federal Desktop Core
Configuration (FDCC) or an equivalent hardening configuration guide,
which many organizations use to limit the attack surface and potential
risk of deployed software.
The relationships between privileges, permissions, and actors (e.g. users
and groups) need further refinement within the Research view. One
complication is that these concepts apply to two different pillars, related
to control of resources (CWE-664) and protection mechanism failures
(CWE-396).
Content History
Submissions
Submission Date
Submitter
Organization
Source
2008-09-08
Internal CWE Team
new weakness-focused entry for Research
view.
Modifications
Modification Date
Modifier
Organization
Source
2009-01-12
CWE Content Team
MITRE
Internal
updated Description, Likelihood of Exploit, Name,
Potential Mitigations, Relationships
2009-03-10
CWE Content Team
MITRE
Internal
updated Potential Mitigations,
Related Attack Patterns