CWE-227: 7PK - API Abuse
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."
Last updated
Weaknesses in this category
- CWE-242: Use of Inherently Dangerous Function
- CWE-243: Creation of chroot Jail Without Changing Working Directory
- CWE-244: Improper Clearing of Heap Memory Before Release ('Heap Inspection')
- CWE-245: J2EE Bad Practices: Direct Management of Connections
- CWE-246: J2EE Bad Practices: Direct Use of Sockets
- CWE-248: Uncaught Exception
- CWE-250: Execution with Unnecessary Privileges
- CWE-251: Often Misused: String Management
- CWE-252: Unchecked Return Value
- CWE-558: Use of getlogin() in Multithreaded Application
Real-world CVEs
3 recorded CVEs are caused by CWE-227 (7PK - API Abuse). The highest-severity and most recent are shown first. 1 new CWE-227 CVE has been recorded so far in 2026 (1 in 2025).
Frequently asked questions
Common questions about CWE-227.
- What is CWE-227?
- 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."
- What CVEs are caused by CWE-227?
- 3 recorded CVEs are attributed to CWE-227, including CVE-2024-56442, CVE-2023-41293 and CVE-2026-92963.
- Is CWE-227 actively exploited?
- 3 recorded CVEs are caused by CWE-227; none are currently in CISA's KEV catalog of actively exploited flaws.
Sources
References
- MITRE CWE definition (CWE-227) (opens in a new tab)
- CWE-227 vulnerabilities on NVD (opens in a new tab)
- Learn: What is a CWE?
Weakness data is sourced from the MITRE CWE catalog (v4.20). CVE associations are aggregated and kept current by RadicalNotion.AI.