CWE-684: Incorrect Provision of Specified Functionality

Description

The code does not function according to its published specifications, potentially leading to incorrect usage.

Submission Date :

April 11, 2008, midnight

Modification Date :

2023-10-26 00:00:00+00:00

Organization :

MITRE
Extended Description

When providing functionality to an external party, it is important that the product behaves in accordance with the details specified. When requirements of nuances are not documented, the functionality may produce unintended behaviors for the caller, possibly leading to an exploitable state.

Example Vulnerable Codes

Example - 1

In the following snippet from a doPost() servlet method, the server returns "200 OK" (default) even if an error occurs.


// // Something that may throw an exception.// 
...
logger.error("Caught: " + t.toString());return;try {} catch (Throwable t) {}

Example - 2

In the following example, an HTTP 404 status code is returned in the event of an IOException encountered in a Java servlet. A 404 code is typically meant to indicate a non-existent resource and would be somewhat misleading in this case.


// // something that might throw IOException// 
...response.sendError(SC_NOT_FOUND);try {} catch (IOException ioe) {}

Visit http://cwe.mitre.org/ for more details.

© cvefeed.io
Latest DB Update: Nov. 21, 2024 22:26