-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathStackTraceExposure.ql
More file actions
24 lines (22 loc) · 913 Bytes
/
StackTraceExposure.ql
File metadata and controls
24 lines (22 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/**
* @name Information exposure through a stack trace
* @description Information from a stack trace propagates to an external user.
* Stack traces can unintentionally reveal implementation details
* that are useful to an attacker for developing a subsequent exploit.
* @kind problem
* @problem.severity error
* @security-severity 5.4
* @precision high
* @id java/stack-trace-exposure
* @tags security
* external/cwe/cwe-209
* external/cwe/cwe-497
*/
import java
import semmle.code.java.dataflow.DataFlow
import semmle.code.java.security.StackTraceExposureQuery
from Expr externalExpr, Expr errorInformation
where
printsStackExternally(externalExpr, errorInformation) or
stringifiedStackFlowsExternally(DataFlow::exprNode(externalExpr), errorInformation)
select externalExpr, "$@ can be exposed to an external user.", errorInformation, "Error information"