CWE Reference
CWE-346: Origin Validation Error
Official CWE-346 CWE context with Glexia analysis, remediation guidance, related CVEs, and ATT&CK context.
Release 4.20weaknessDraft
Glexia's Take
CWE-346: Origin Validation Error
Origin Validation Error represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.
Executive Impact
- Access Control,Other: Gain Privileges or Assume Identity,Varies by Context: An attacker can access any functionality that is inadvertently accessible to the source.
Developer Pattern
CWE-346 is the kind of defect developers can usually prevent with explicit validation, safer framework defaults, and tests that exercise hostile input or unsafe state transitions.
Confidence
high confidence from CWE-346, 4.20.
Official CWE Definition
CWE-346: Origin Validation Error
The product does not properly verify that the source of data or communication is valid.
Developer And Remediation Guidance
How teams prevent and detect this weakness
Causes
- This Android application will remove a user account when it receives an intent to do so: 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.
- 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: A call into native code can then be initiated by passing parameters within the URL:,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.
Remediation
- Use safe APIs
- Centralize the control
- Add regression tests
- Review logs and telemetry for attempted abuse
Detection
- 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.)
Mappings
Related CVEs, CWEs, and ATT&CK context
Related CWEs
- CWE-1385: Missing Origin Validation in WebSockets
- CWE-284: Improper Access Control
- CWE-345: Insufficient Verification of Data Authenticity
- CWE-345: Insufficient Verification of Data Authenticity
- CWE-352: Cross-Site Request Forgery (CSRF)
- CWE-384: Session Fixation
- CWE-451: User Interface (UI) Misrepresentation of Critical Information
- CWE-940: Improper Verification of Source of a Communication Channel
ATT&CK Relevance
ATT&CK relevance is shown only when reviewed or responsibly inferred.