Run static analysis (SAST) on the codebase looking for the unsafe pattern in the data flow.
Improper Verification of Source of a Communication Channel
This vulnerability occurs when an application accepts incoming communication requests without properly checking where they originate from, allowing potentially malicious sources to establish a…
What is CWE-940?
Real-world CVEs caused by CWE-940
-
DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning
-
DNS server can accept DNS updates from hosts that it did not query, leading to cache poisoning
-
DNS server caches glue records received from non-delegated name servers
Step-by-step attacker path
- 1
This Android application will remove a user account when it receives an intent to do so:
- 2
This application does not check the origin of the intent, thus allowing any malicious application to remove a user. Always check the origin of an intent, or create an allowlist of trusted applications using the manifest.xml file.
- 3
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:
- 4
A call into native code can then be initiated by passing parameters within the URL:
- 5
Because the application does not check the source, a malicious website loaded within this WebView has the same access to the API as a trusted site.
Vulnerable Java
This Android application will remove a user account when it receives an intent to do so:
IntentFilter filter = new IntentFilter("com.example.RemoveUser");
MyReceiver receiver = new MyReceiver();
registerReceiver(receiver, filter);
public class DeleteReceiver extends BroadcastReceiver {
@Override
public void onReceive(Context context, Intent intent) {
int userID = intent.getIntExtra("userID");
destroyUserData(userID);
}
} A call into native code can then be initiated by passing parameters within the URL:
window.location = examplescheme://method?parameter=value Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} How to prevent CWE-940
- Architecture and Design Use a mechanism that can validate the identity of the source, such as a certificate, and validate the integrity of data to ensure that it cannot be modified in transit using an Adversary-in-the-Middle (AITM) attack. When designing functionality of actions in the URL scheme, consider whether the action should be accessible to all mobile applications, or if an allowlist of applications to interface with is appropriate.
How to detect CWE-940
Run dynamic application security testing against the live endpoint.
Watch runtime logs for unusual exception traces, malformed input, or authorization bypass attempts.
Code review: flag any new code that handles input from this surface without using the validated framework helpers.
Plexicus auto-detects CWE-940 and opens a fix PR in under 60 seconds.
Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.
Frequently asked questions
What is CWE-940?
This vulnerability occurs when an application accepts incoming communication requests without properly checking where they originate from, allowing potentially malicious sources to establish a connection.
How serious is CWE-940?
MITRE has not published a likelihood-of-exploit rating for this weakness. Treat it as medium-impact until your threat model proves otherwise.
What languages or platforms are affected by CWE-940?
MITRE lists the following affected platforms: Mobile.
How can I prevent CWE-940?
Use a mechanism that can validate the identity of the source, such as a certificate, and validate the integrity of data to ensure that it cannot be modified in transit using an Adversary-in-the-Middle (AITM) attack. When designing functionality of actions in the URL scheme, consider whether the action should be accessible to all mobile applications, or if an allowlist of applications to interface with is appropriate.
How does Plexicus detect and fix CWE-940?
Plexicus's SAST engine matches the data-flow signature for CWE-940 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.
Where can I learn more about CWE-940?
MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/940.html. You can also reference OWASP and NIST documentation for adjacent guidance.
Weaknesses related to CWE-940
Improper Restriction of Communication Channel to Intended Endpoints
This vulnerability occurs when a system opens a communication channel for a sensitive task but fails to properly verify that it's actually…
Sensitive Cookie with Improper SameSite Attribute
This vulnerability occurs when a sensitive cookie does not have a secure SameSite attribute configured, leaving it exposed to cross-site…
Reliance on IP Address for Authentication
This vulnerability occurs when a system uses a client's IP address as the sole or primary method to verify their identity.
Improper Validation of Certificate with Host Mismatch
This vulnerability occurs when an application accepts a valid SSL/TLS certificate without properly verifying that it actually belongs to…
Channel Accessible by Non-Endpoint
This vulnerability occurs when a system fails to properly verify who is on the other end of a communication link or to secure the channel…
Unprotected Primary Channel
This vulnerability occurs when an application exposes a privileged administrative interface or restricted functionality through a primary…
Unprotected Alternate Channel
This vulnerability occurs when an application secures its main communication path but leaves a backup or alternative channel with weaker…
Incorrectly Specified Destination in a Communication Channel
This vulnerability occurs when an application establishes an outgoing communication channel but fails to correctly define or enforce the…
Permissive Cross-domain Security Policy with Untrusted Domains
This vulnerability occurs when a web application's cross-domain security policy, like a Content Security Policy (CSP), explicitly allows…
Don't Let Security
Weigh You Down.
Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.