Category: 7PK - API Abuse

Draft
Summary

This category represents one of the phyla in the Seven Pernicious Kingdoms vulnerability classification. It includes weaknesses that involve the software using an API in a manner contrary to its intended use. According to the authors of the Seven Pernicious Kingdoms, "An API is a contract between a caller and a callee. The most common forms of API misuse occurs when the caller does not honor its end of this contract. For example, if a program does not call chdir() after calling chroot(), it violates the contract that specifies how to change the active root directory in a secure fashion. Another good example of library abuse is expecting the callee to return trustworthy DNS information to the caller. In this case, the caller misuses the callee API by making certain assumptions about its behavior (that the return value can be used for authentication purposes). One can also violate the caller-callee contract from the other side. For example, if a coder subclasses SecureRandom and returns a non-random value, the contract is violated."

Membership
IDNameDescription
CWE-242Use of Inherently Dangerous FunctionThe product calls a function that can never be guaranteed to work safely.
CWE-243Creation of chroot Jail Without Changing Working DirectoryThe product uses the chroot() system call to create a jail, but does not change the working directory afterward. This does not prevent access to files outside of the jail.
CWE-244Improper Clearing of Heap Memory Before Release ('Heap Inspection')Using realloc() to resize buffers that store sensitive information can leave the sensitive information exposed to attack, because it is not removed from memory.
CWE-245J2EE Bad Practices: Direct Management of ConnectionsThe J2EE application directly manages connections, instead of using the container's connection management facilities.
CWE-246J2EE Bad Practices: Direct Use of SocketsThe J2EE application directly uses sockets instead of using framework method calls.
CWE-248Uncaught ExceptionAn exception is thrown from a function, but it is not caught.
CWE-250Execution with Unnecessary PrivilegesThe product performs an operation at a privilege level that is higher than the minimum level required, which creates new weaknesses or amplifies the consequences of other weaknesses.
CWE-252Unchecked Return ValueThe product does not check the return value from a method or function, which can prevent it from detecting unexpected states and conditions.
CWE-558Use of getlogin() in Multithreaded ApplicationThe product uses the getlogin() function in a multithreaded context, potentially causing it to return incorrect values.
CWE-700Seven Pernicious KingdomsThis view (graph) organizes weaknesses using a hierarchical structure that is similar to that used by Seven Pernicious Kingdoms.
CWE-251Often Misused: String ManagementFunctions that manipulate strings encourage buffer overflows.
Vulnerability Mapping Notes
Usage: Prohibited
Reasons: Category
Rationale:
This entry is a Category. Using categories for mapping has been discouraged since 2019. Categories are informal organizational groupings of weaknesses that can help CWE users with data aggregation, navigation, and browsing. However, they are not weaknesses in themselves.
Comment:
See member weaknesses of this category.