Trust Boundary Violation
Description
A trust boundary can be thought of as a 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.
Examples
Insecure Code
scala
request.setAttribute("userInput", request.getParameter("userInput"))Secure Code
scala
String userInput = request.getParameter("userInput"); if (validateInput(userInput)) { request.setAttribute("userInput", userInput); }Remediation
Validate user input data before setting it as an attribute or putting a value in the request to prevent trust boundary violations.
Rule Details
| Field | Value |
|---|---|
| ID | CODE-0014 |
| Category | Web |
| Severity | MEDIUM |
| CWE | CWE-501 |
| Confidence | MEDIUM |
| Impact | MEDIUM |
| Likelihood | MEDIUM |
| Exploitability | MODERATE |
| Tags | trust boundary, validation |
| OWASP | N/A |