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
2323 */
2424module ExceptionInformationExposureConfig implements DataFlow:: ConfigSig {
2525 predicate isSource ( DataFlow:: Node source ) {
26- exists ( Expr exceptionExpr |
26+ exists ( Expr expr |
2727 // 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
2932 |
3033 // Expr has type `System.Exception`.
31- exceptionExpr .getType ( ) .( RefType ) .getABaseType * ( ) instanceof SystemExceptionClass and
34+ expr .getType ( ) .( RefType ) .getABaseType * ( ) instanceof SystemExceptionClass and
3235 // 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 ( ) |
3637 enclosingCallable .getDeclaringType ( ) .getABaseType * ( ) instanceof SystemExceptionClass
3738 )
3839 )
You can’t perform that action at this time.
0 commit comments