CWE-862 – Missing Authorization

Read Time:4 Minute, 5 Second

Description

The software does not perform an authorization check when an actor attempts to access a resource or perform an action.

An access control list (ACL) represents who/what has permissions to a given object. Different operating systems implement (ACLs) in different ways. In UNIX, there are three types of permissions: read, write, and execute. Users are divided into three classes for file access: owner, group owner, and all other users where each class has a separate set of rights. In Windows NT, there are four basic types of permissions for files: “No access”, “Read access”, “Change access”, and “Full control”. Windows NT extends the concept of three types of users in UNIX to include a list of users and groups along with their associated permissions. A user can create an object (file) and assign specified permissions to that object.

Modes of Introduction:

– Architecture and Design

Likelihood of Exploit: High

 

Related Weaknesses

CWE-285
CWE-284

 

Consequences

Confidentiality: Read Application Data, Read Files or Directories

An attacker could read sensitive data, either by reading the data directly from a data store that is not restricted, or by accessing insufficiently-protected, privileged functionality to read the data.

Integrity: Modify Application Data, Modify Files or Directories

An attacker could modify sensitive data, either by writing the data directly to a data store that is not restricted, or by accessing insufficiently-protected, privileged functionality to write the data.

Access Control: Gain Privileges or Assume Identity, Bypass Protection Mechanism

An attacker could gain privileges by modifying or reading critical data directly, or by accessing privileged functionality.

 

Potential Mitigations

Phase: Architecture and Design

Effectiveness:

Description: 

Phase: Architecture and Design

Effectiveness:

Description: 

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].

Phase: Architecture and Design

Effectiveness:

Description: 

Phase: Architecture and Design

Effectiveness:

Description: 

Phase: System Configuration, Installation

Effectiveness:

Description: 

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.

CVE References

 

  • CVE-2009-3168
    • Web application does not restrict access to admin scripts, allowing authenticated users to reset administrative passwords.
  • CVE-2009-3597
    • Web application stores database file under the web root with insufficient access control (CWE-219), allowing direct request.
  • CVE-2009-2282
    • Terminal server does not check authorization for guest access.
  • CVE-2008-5027
    • System monitoring software allows users to bypass authorization by creating custom forms.
  • CVE-2009-3781
    • Content management system does not check access permissions for private files, allowing others to view those files.
  • CVE-2008-6548
    • Product does not check the ACL of a page accessed using an “include” directive, allowing attackers to read unauthorized files.
  • CVE-2009-2960
    • Web application does not restrict access to admin scripts, allowing authenticated users to modify passwords of other users.
  • CVE-2009-3230
    • Database server does not use appropriate privileges for certain sensitive operations.
  • CVE-2009-2213
    • Gateway uses default “Allow” configuration for its authorization settings.
  • CVE-2009-0034
    • Chain: product does not properly interpret a configuration option for a system group, allowing users to gain privileges.
  • CVE-2008-6123
    • Chain: SNMP product does not properly parse a configuration option for which hosts are allowed to connect, allowing unauthorized IP addresses to connect.
  • CVE-2008-7109
    • Chain: reliance on client-side security (CWE-602) allows attackers to bypass authorization using a custom client.
  • CVE-2008-3424
    • Chain: product does not properly handle wildcards in an authorization policy list, allowing unintended access.
  • CVE-2005-1036
    • Chain: Bypass of access restrictions due to improper authorization (CWE-862) of a user results from an improperly initialized (CWE-909) I/O permission bitmap
  • CVE-2008-4577
    • ACL-based protection mechanism treats negative access rights as if they are positive, allowing bypass of intended restrictions.
  • CVE-2007-2925
    • Default ACL list for a DNS server does not set certain ACLs, allowing unauthorized DNS queries.
  • CVE-2006-6679
    • Product relies on the X-Forwarded-For HTTP header for authorization, allowing unintended access by spoofing the header.
  • CVE-2005-3623
    • OS kernel does not check for a certain privilege before setting ACLs for files.
  • CVE-2005-2801
    • Chain: file-system code performs an incorrect comparison (CWE-697), preventing default ACLs from being properly applied.
  • CVE-2001-1155
    • Chain: product does not properly check the result of a reverse DNS lookup because of operator precedence (CWE-783), allowing bypass of DNS-based access restrictions.
  • CVE-2020-17533
    • Chain: unchecked return value (CWE-252) of some functions for policy enforcement leads to authorization bypass (CWE-862)

CWE-86 – Improper Neutralization of Invalid Characters in Identifiers in Web Pages

Read Time:1 Minute, 13 Second

Description

The software does not neutralize or incorrectly neutralizes invalid characters or byte sequences in the middle of tag names, URI schemes, and other identifiers.

Some web browsers may remove these sequences, resulting in output that may have unintended control implications. For example, the software may attempt to remove a “javascript:” URI scheme, but a “java%00script:” URI may bypass this check and still be rendered as active javascript by some browsers, allowing XSS or other attacks.

Modes of Introduction:

– Implementation

Likelihood of Exploit:

 

Related Weaknesses

CWE-79
CWE-184
CWE-436

 

Consequences

Confidentiality, Integrity, Availability: Read Application Data, Execute Unauthorized Code or Commands

 

Potential Mitigations

Phase: Implementation

Effectiveness:

Description: 

Phase: Implementation

Effectiveness: Defense in Depth

Description: 

To help mitigate XSS attacks against the user’s session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user’s session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XMLHTTPRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.

CVE References

 

  • CVE-2004-0595
    • XSS filter doesn’t filter null characters before looking for dangerous tags, which are ignored by web browsers. Multiple Interpretation Error (MIE) and validate-before-cleanse.

CWE-85 – Doubled Character XSS Manipulations

Read Time:1 Minute, 38 Second

Description

The web application does not filter user-controlled input for executable script disguised using doubling of the involved characters.

Modes of Introduction:

– Implementation

Likelihood of Exploit:

 

Related Weaknesses

CWE-79
CWE-675

 

Consequences

Confidentiality, Integrity, Availability: Read Application Data, Execute Unauthorized Code or Commands

 

Potential Mitigations

Phase: Implementation

Effectiveness:

Description: 

Resolve all filtered input to absolute or canonical representations before processing.

Phase: Implementation

Effectiveness:

Description: 

Carefully check each input parameter against a rigorous positive specification (allowlist) defining the specific characters and format allowed. All input should be neutralized, not just parameters that the user is supposed to specify, but all data in the request, including tag attributes, hidden fields, cookies, headers, the URL itself, and so forth. A common mistake that leads to continuing XSS vulnerabilities is to validate only fields that are expected to be redisplayed by the site. We often encounter data from the request that is reflected by the application server or the application that the development team did not anticipate. Also, a field that is not currently reflected may be used by a future developer. Therefore, validating ALL parts of the HTTP request is recommended.

Phase: Implementation

Effectiveness:

Description: 

Phase: Implementation

Effectiveness:

Description: 

With Struts, write all data from form beans with the bean’s filter attribute set to true.

Phase: Implementation

Effectiveness: Defense in Depth

Description: 

To help mitigate XSS attacks against the user’s session cookie, set the session cookie to be HttpOnly. In browsers that support the HttpOnly feature (such as more recent versions of Internet Explorer and Firefox), this attribute can prevent the user’s session cookie from being accessible to malicious client-side scripts that use document.cookie. This is not a complete solution, since HttpOnly is not supported by all browsers. More importantly, XMLHTTPRequest and other powerful browser technologies provide read access to HTTP headers, including the Set-Cookie header in which the HttpOnly flag is set.

CVE References

 

Read Time:54 Second

Description

The program allocates or initializes a resource such as a pointer, object, or variable using one type, but it later accesses that resource using a type that is incompatible with the original type.

Modes of Introduction:

– Implementation

Likelihood of Exploit:

 

Related Weaknesses

CWE-704
CWE-704
CWE-119

 

Consequences

Availability, Integrity, Confidentiality: Read Memory, Modify Memory, Execute Unauthorized Code or Commands, DoS: Crash, Exit, or Restart

When a memory buffer is accessed using the wrong type, it could read or write memory out of the bounds of the buffer, if the allocated buffer is smaller than the type that the code is attempting to access, leading to a crash and possibly code execution.

 

Potential Mitigations

CVE References

 

  • CVE-2010-4577
    • Type confusion in CSS sequence leads to out-of-bounds read.
  • CVE-2011-0611
    • Size inconsistency allows code execution, first discovered when it was actively exploited in-the-wild.
  • CVE-2010-0258
    • Improperly-parsed file containing records of different types leads to code execution when a memory location is interpreted as a different object than intended.