CWE-346: Origin Validation Error

Export to Word

Description

The product does not properly verify that the source of data or communication is valid.

Extended Description

N/A


ThreatScore

Threat Mapped score: 1.8

Industry: Finiancial

Threat priority: P4 - Informational (Low)


Observed Examples (CVEs)

Related Attack Patterns (CAPEC)


Attack TTPs

Malware

APTs (Intrusion Sets)

Modes of Introduction

Phase Note
Architecture and Design N/A
Implementation REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Common Consequences

Potential Mitigations

Applicable Platforms


Demonstrative Examples

Intro: This Android application will remove a user account when it receives an intent to do so:

Body: 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.

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); } }

Intro: 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:

Body: A call into native code can then be initiated by passing parameters within the URL:

// Android @Override public boolean shouldOverrideUrlLoading(WebView view, String url){ if (url.substring(0,14).equalsIgnoreCase("examplescheme:")){ if(url.substring(14,25).equalsIgnoreCase("getUserInfo")){ writeDataToView(view, UserData); return false; } else{ return true; } } }

Notes

← Back to CWE list