CWE-749: Exposed Dangerous Method or Function
The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.
Last updated
Overview
This weakness can lead to a wide variety of resultant weaknesses, depending on the behavior of the exposed method. It can apply to any number of technologies and approaches, such as ActiveX controls, Java functions, IOCTLs, and so on. The exposure can occur in a few different ways: The function/method was never intended to be exposed to outside actors. The function/method was only intended to be accessible to a limited set of actors, such as Internet-based access from a single web site.
Real-world CVEs
195 recorded CVEs are caused by CWE-749 (Exposed Dangerous Method or Function), including 4 in CISA's KEV (Known Exploited Vulnerabilities) catalog. KEVs are shown first. 66 new CWE-749 CVEs have been recorded so far in 2026 (37 in 2025).
- CVE-2010-0738CISA KEVCritical · CVSS 10.0 · EPSS 99th2010-04-28
- CVE-2010-1428CISA KEVHigh · CVSS 8.7 · EPSS 99th2010-04-28
- CVE-2006-1547CISA KEV
Improper Input Validation in Apache Struts
High · CVSS 8.7 · EPSS 99th2006-03-30 - CVE-2018-19322CISA KEVHigh · CVSS 8.5 · EPSS 79th2018-12-21
- CVE-2026-30957
OneUptime Synthetic Monitor RCE via exposed Playwright browser object
Critical · CVSS 10.0 · EPSS 71th2026-03-10 - CVE-2026-30921
OneUptime Synthetic Monitor RCE via exposed Playwright browser object
Critical · CVSS 10.0 · EPSS 42th2026-03-09 - CVE-2022-31491Critical · CVSS 10.0 · EPSS 57th2025-08-22
- CVE-2023-40151
Red Lion Controls Sixnet RTU Exposed Dangerous Method Or Function
Critical · CVSS 10.0 · EPSS 67th2023-11-21 - CVE-2026-109412Critical · CVSS 9.9 · EPSS 59th2026-10-13
- CVE-2026-89110
Broken Access Control in SAP NetWeaver Visual Composer
Critical · CVSS 9.9 · EPSS 35th2026-10-13 - CVE-2026-55454
Appsmith: Caddy admin API exposed without authentication
Critical · CVSS 9.9 · EPSS 49th2026-06-24 - CVE-2019-18342Critical · CVSS 9.9 · EPSS 82th2019-12-12
Showing 12 of 195 recorded CWE-749 CVEs. Get an alert for each new one, with AI-written analysis and fixes.
Monitor these CVEsCommon consequences
What can happen when CWE-749 is exploited.
Gain Privileges or Assume Identity, Read Application Data, Modify Application Data, Execute Unauthorized Code or Commands, Other
Affects: Integrity, Confidentiality, Availability, Access Control, Other
Exposing critical functionality essentially provides an attacker with the privilege level of the exposed functionality. This could result in the modification or exposure of sensitive data or possibly even execution of arbitrary code.
How it happens
When it is introduced
Typically introduced during these phases of the software lifecycle.
How to prevent it
Practical mitigations for CWE-749, grouped by where in the lifecycle they apply.
If you must expose a method, make sure to perform input validation on all arguments, limit access to authorized parties, and protect against all possible vulnerabilities.
Identify all exposed functionality. Explicitly list all functionality that must be exposed to some user or set of users. Identify which functionality may be:
Ensure that the implemented code follows these expectations. This includes setting the appropriate access modifiers where applicable (public, private, protected, etc.) or not marking ActiveX controls safe-for-scripting.
- accessible to all users
- restricted to a small set of privileged users
- prevented from being directly accessible at all
How to detect it
Automated Static Analysis
Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
Effectiveness: High
Code examples
MITRE examples of the weakness in code.
In the following Java example the method removeDatabase will delete the database with the name specified in the input parameter.
Vulnerable example
public void removeDatabase(String databaseName) {
try {
Statement stmt = conn.createStatement();Safe example
private void removeDatabase(String databaseName) {
try {
Statement stmt = conn.createStatement();The method in this example is declared public and therefore is exposed to any class in the application. Deleting a database should be considered a critical operation within an application and access to this potentially dangerous method should be restricted. Within Java this can be accomplished simply by declaring the method private thereby exposing it only to the enclosing class as in the following example.
These Android and iOS applications intercept URL loading within a WebView and perform special actions if a particular URL scheme is used, thus allowing the Javascript within the WebView to communicate with the application:
Vulnerable example
// Android
if (url.substring(0,14).equalsIgnoreCase("examplescheme:")){
if(url.substring(14,25).equalsIgnoreCase("getUserInfo")){
writeDataToView(view, UserData);
return true;Vulnerable example
// iOS
NSURL *URL = [exRequest URL];
NSString *functionString = [URL resourceSpecifier];
// Make data available back in webview.Attack input
window.location = examplescheme://method?parameter=valueThis application uses a WebView to display websites, and creates a Javascript interface to a Java object to allow enhanced functionality on a trusted website:
Vulnerable example
public class WebViewGUI extends Activity {
WebView mainWebView;
super.onCreate(savedInstanceState);
JavaScriptInterface () {}
return currentUser.Info();Attack input
<script>
userInfoObject.getClass().forName('android.telephony.SmsManager').getMethod('getDefault',null).sendTextMessage(attackNumber, null, attackMessage, null, null);After Android 4.2, only methods annotated with @JavascriptInterface are available in JavaScript, protecting usage of getClass() by default, as in this example:
Vulnerable example
final class JavaScriptInterface {
JavaScriptInterface () { }
return currentUser.Info();Attack input
<script>
var info = window.userInfoObject.getUserInfo();Illustrative examples
Real CVEs that MITRE cites as examples of this weakness.
- CVE-2007-6382 — arbitrary Java code execution via exposed method
- CVE-2007-1112 — security tool ActiveX control allows download or upload of files
Attack patterns
CAPEC attack patterns that exploit this weakness.
Frequently asked questions
Common questions about CWE-749.
- What is CWE-749?
- The product provides an Applications Programming Interface (API) or similar interface for interaction with external actors, but the interface includes a dangerous method or function that is not properly restricted.
- What CVEs are caused by CWE-749?
- 195 recorded CVEs are attributed to CWE-749, including CVE-2010-0738, CVE-2010-1428 and CVE-2006-1547. 4 are listed in CISA's Known Exploited Vulnerabilities (KEV) catalog.
- How do you prevent CWE-749?
- If you must expose a method, make sure to perform input validation on all arguments, limit access to authorized parties, and protect against all possible vulnerabilities.
- How is CWE-749 detected?
- Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)
- What are the consequences of CWE-749?
- Exploiting CWE-749 can lead to: Gain Privileges or Assume Identity, Read Application Data, Modify Application Data, Execute Unauthorized Code or Commands, Other.
- Is CWE-749 actively exploited?
- Yes. 4 CWE-749 vulnerabilities are in CISA's KEV catalog of actively exploited flaws, out of 195 recorded CVEs.
Sources
References
- MITRE CWE definition (CWE-749) (opens in a new tab)
- CWE-749 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.
Track CWE-749 CVEs
Get an alert when a new CWE-749 CVE affects your products, with AI-written analysis and remediation steps.