Base · Medium

CWE-306: Missing Authentication for Critical Function

The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.

CWE-306 · Base Level ·17 CVEs ·5 Mitigations

Description

The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.

Potential Impact

Access Control, Other

Gain Privileges or Assume Identity, Varies by Context

Demonstrative Examples

In the following Java example the method createBankAccount is used to create a BankAccount object for a bank management application.
Bad
public BankAccount createBankAccount(String accountNumber, String accountType,String accountName, String accountSSN, double balance) {
                     
                        BankAccount account = new BankAccount();account.setAccountNumber(accountNumber);account.setAccountType(accountType);account.setAccountOwnerName(accountName);account.setAccountOwnerSSN(accountSSN);account.setBalance(balance);
                           return account;
                     }
However, there is no authentication mechanism to ensure that the user creating this bank account object has the authority to create new bank accounts. Some authentication mechanisms should be used to verify that the user has the authority to create bank account objects.
The following Java code includes a boolean variable and method for authenticating a user. If the user has not been authenticated then the createBankAccount will not create the bank account object.
Good
private boolean isUserAuthentic = false;
                     
                     // authenticate user,
                     
                     
                     // if user is authenticated then set variable to true
                     
                     
                     // otherwise set variable to false
                     public boolean authenticateUser(String username, String password) {...}
                     public BankAccount createNewBankAccount(String accountNumber, String accountType,String accountName, String accountSSN, double balance) {
                        BankAccount account = null;
                           if (isUserAuthentic) {account = new BankAccount();account.setAccountNumber(accountNumber);account.setAccountType(accountType);account.setAccountOwnerName(accountName);account.setAccountOwnerSSN(accountSSN);account.setBalance(balance);}return account;
                     }
In 2022, the OT:ICEFALL study examined products by 10 different Operational Technology (OT) vendors. The researchers reported 56 vulnerabilities and said that the products were "insecure by design" [REF-1283]. If exploited, these vulnerabilities often allowed adversaries to change how the products operated, ranging from denial of service to changing the code that the products executed. Since these products were often used in industries such as power, electrical, water, and others, there could even be safety implications.
Multiple vendors did not use any authentication for critical functionality in their OT products.
In 2021, a web site operated by PeopleGIS stored data of US municipalities in Amazon Web Service (AWS) Simple Storage Service (S3) buckets.
Bad
A security researcher found 86 S3 buckets that could be accessed without authentication (CWE-306) and stored data unencrypted (CWE-312). These buckets exposed over 1000 GB of data and 1.6 million files including physical addresses, phone numbers, tax documents, pictures of driver's license IDs, etc. [REF-1296] [REF-1295]
While it was not publicly disclosed how the data was protected after discovery, multiple options could have been considered.
Good
The sensitive information could have been protected by ensuring that the buckets did not have public read access, e.g., by enabling the s3-account-level-public-access-blocks-periodic rule to Block Public Access. In addition, the data could have been encrypted at rest using the appropriate S3 settings, e.g., by enabling server-side encryption using the s3-bucket-server-side-encryption-enabled setting. Other settings are available to further prevent bucket data from being leaked. [REF-1297]

Mitigations & Prevention

Architecture and Design

Divide the software into anonymous, normal, privileged, and administrative areas. Identify which of these areas require a proven user identity, and use a centralized authentication capability. Identify all potential communication channels, or other means of interaction with the software, to ensure that all channels are appropriately protected, including those channels that are assumed to be accessible only by authorized parties. Developers sometimes perform authentication at

Architecture and Design

For any security checks that are performed on the client side, ensure that these checks are duplicated on the server side, in order to avoid CWE-602. Attackers can bypass the client-side checks by modifying values after the checks have been performed, or by changing the client to remove the client-side checks entirely. Then, these modified values would be submitted to the server.

Architecture and Design

Where possible, avoid implementing custom, "grow-your-own" authentication routines and consider using authentication capabilities as provided by the surrounding framework, operating system, or environment. These capabilities may avoid common weaknesses that are unique to authentication; support automatic auditing and tracking; and make it easier to provide a clear separation between authentication tasks and authorization tasks. In environments such as the World Wide Web, the

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 libraries with authentication capabilities such as OpenSSL or the ESAPI Authenticator [REF-45].

ImplementationSystem ConfigurationOperation

When storing data in the cloud (e.g., S3 buckets, Azure blobs, Google Cloud Storage, etc.), use the provider's controls to require strong authentication for users who should be allowed to access the data [REF-1297] [REF-1298] [REF-1302].

Detection Methods

  • Manual Analysis — 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 eval
  • Automated Static Analysis Limited — Automated static analysis is useful for detecting commonly-used idioms for authentication. A tool may be able to analyze related configuration files, such as .htaccess in Apache web servers, or detect the usage of commonly-used authentication libraries. Generally, automated stati
  • Manual Static Analysis - Binary or Bytecode SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:
  • Dynamic Analysis with Automated Results Interpretation SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:
  • Dynamic Analysis with Manual Results Interpretation SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:
  • Manual Static Analysis - Source Code SOAR Partial — According to SOAR [REF-1479], the following detection techniques may be useful:

Real-World CVE Examples

CVE IDDescription
CVE-2024-11680File-sharing PHP product does not check if user is logged in during requests for PHP library files under an includes/ directory, allowing configuration changes, code execution, and other impacts.
CVE-2022-31260Chain: a digital asset management program has an undisclosed backdoor in the legacy version of a PHP script (CWE-912) that could allow an unauthenticated user to export metadata (CWE-306)
CVE-2022-29951TCP-based protocol in Programmable Logic Controller (PLC) has no authentication.
CVE-2022-29952Condition Monitor firmware uses a protocol that does not require authentication.
CVE-2022-30276SCADA-based protocol for bridging WAN and LAN traffic has no authentication.
CVE-2022-30313Safety Instrumented System uses proprietary TCP protocols with no authentication.
CVE-2022-30317Distributed Control System (DCS) uses a protocol that has no authentication.
CVE-2021-21972Chain: Cloud computing virtualization platform does not require authentication for upload of a tar format file (CWE-306), then uses .. path traversal sequences (CWE-23) in the file to access unexpecte
CVE-2020-10263Bluetooth speaker does not require authentication for the debug functionality on the UART port, allowing root shell access
CVE-2021-23147WiFi router does not require authentication for its UART port, allowing adversaries with physical access to execute commands as root
CVE-2021-37415IT management product does not perform authentication for some REST API requests, as exploited in the wild per CISA KEV.
CVE-2020-13927Default setting in workflow management product allows all API requests without authentication, as exploited in the wild per CISA KEV.
CVE-2002-1810MFV. Access TFTP server without authentication and obtain configuration file with sensitive plaintext information.
CVE-2008-6827Agent software running at privileges does not authenticate incoming requests over an unprotected channel, allowing a Shatter" attack.
CVE-2004-0213Product enforces restrictions through a GUI but not through privileged APIs.

Showing 15 of 17 observed examples.

Taxonomy Mappings

  • PLOVER: — No Authentication for Critical Function
  • Software Fault Patterns: SFP31 — Missing authentication
  • ISA/IEC 62443: Part 4-2 — Req CR 1.1
  • ISA/IEC 62443: Part 4-2 — Req CR 1.2
  • ISA/IEC 62443: Part 4-2 — Req CR 2.1
  • ISA/IEC 62443: Part 4-1 — Req SR-2
  • ISA/IEC 62443: Part 4-1 — Req SVV-3

Frequently Asked Questions

What is CWE-306?

CWE-306 (Missing Authentication for Critical Function) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Base-level weakness. The product does not perform any authentication for functionality that requires a provable user identity or consumes a significant amount of resources.

How can CWE-306 be exploited?

Attackers can exploit CWE-306 (Missing Authentication for Critical Function) to gain privileges or assume identity, varies by context. This weakness is typically introduced during the Architecture and Design, Architecture and Design, Operation phase of software development.

How do I prevent CWE-306?

Key mitigations include: Divide the software into anonymous, normal, privileged, and administrative areas. Identify which of these areas require a proven user identity, and use a centralized authentication capability.

What is the severity of CWE-306?

CWE-306 is classified as a Base-level weakness (Medium abstraction). It has been observed in 17 real-world CVEs.