1203
CWE-501: Trust Boundary Violation
Weakness ID : 501
Structure : Simple
Abstraction : Base
Description
The product mixes trusted and untrusted data in the same data structure or structured message.
Extended Description
A trust boundary can be thought of as line drawn through a program. On one side of the line,
data is untrusted. On the other side of the line, data is assumed to be trustworthy. The purpose
of validation logic is to allow data to safely cross the trust boundary - to move from untrusted to
trusted. A trust boundary violation occurs when a program blurs the line between what is trusted
and what is untrusted. By combining trusted and untrusted data in the same data structure, it
becomes easier for programmers to mistakenly trust unvalidated data.
Relationships
The table(s) below shows the weaknesses and high level categories that are related to this
weakness. These relationships are defined as ChildOf, ParentOf, MemberOr and give insight to
similar items that may exist at higher and lower levels of abstraction. In addition, relationships such
as PeerOf and CanAlsoBe are defined to show similar weaknesses that may want to be explored.
Relevant to the view "Research Concepts" (CWE-1000)
Nature Type ID Name Page
ChildOf 664 Improper Control of a Resource Through its Lifetime 1454
Relevant to the view "Software Development" (CWE-699)
Nature Type ID Name Page
MemberOf 265 Privilege Issues 2316
Applicable Platforms
Language : Not Language-Specific (Prevalence = Undetermined)
Common Consequences
Scope Impact Likelihood
Access Control Bypass Protection Mechanism
Detection Methods
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
Demonstrative Examples
Example 1:
The following code accepts an HTTP request and stores the username parameter in the HTTP
session object before checking to ensure that the user has been authenticated.
Example Language: Java (Bad)
usrname = request.getParameter("usrname");
CWE Version 4.14
CWE-502: Deserialization of Untrusted Data
CWE-502: Deserialization of Untrusted Data