File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
csharp/ql/src/Security Features/CWE-209 Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -23,16 +23,17 @@ import ExceptionInformationExposure::PathGraph
23
23
*/
24
24
module ExceptionInformationExposureConfig implements DataFlow:: ConfigSig {
25
25
predicate isSource ( DataFlow:: Node source ) {
26
- exists ( Expr exceptionExpr |
26
+ exists ( Expr expr |
27
27
// Writing an exception directly is bad
28
- source .asExpr ( ) = exceptionExpr
28
+ source .asExpr ( ) = expr
29
+ or
30
+ // Writing a property of an exception is bad
31
+ source .asExpr ( ) .( PropertyAccess ) .getQualifier ( ) = expr
29
32
|
30
33
// Expr has type `System.Exception`.
31
- exceptionExpr .getType ( ) .( RefType ) .getABaseType * ( ) instanceof SystemExceptionClass and
34
+ expr .getType ( ) .( RefType ) .getABaseType * ( ) instanceof SystemExceptionClass and
32
35
// And is not within an exception callable.
33
- not exists ( Callable enclosingCallable |
34
- enclosingCallable = exceptionExpr .getEnclosingCallable ( )
35
- |
36
+ not exists ( Callable enclosingCallable | enclosingCallable = expr .getEnclosingCallable ( ) |
36
37
enclosingCallable .getDeclaringType ( ) .getABaseType * ( ) instanceof SystemExceptionClass
37
38
)
38
39
)
You can’t perform that action at this time.
0 commit comments