File tree Expand file tree Collapse file tree
java/ql/src/experimental/Security/CWE/CWE-073 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ class InjectFilePathConfig extends TaintTracking::Configuration {
2525
2626 override predicate isSink ( DataFlow:: Node sink ) {
2727 sink .asExpr ( ) = any ( PathCreation p ) .getAnInput ( ) and
28- not sink instanceof SanitizedNode
28+ not sink instanceof NormalizedPathNode
2929 }
3030
3131 override predicate isSanitizer ( DataFlow:: Node node ) {
Original file line number Diff line number Diff line change @@ -174,12 +174,10 @@ private class UrlDecodeSanitizer extends MethodAccess {
174174 }
175175}
176176
177- /** A sanitized node that is protected against path traversal vulnerabilities. */
178- abstract class SanitizedNode extends DataFlow:: Node { }
179-
180- class NodeWithPathNormalizer extends SanitizedNode {
181- NodeWithPathNormalizer ( ) {
182- DataFlow:: localExprFlow ( this .asExpr ( ) , any ( PathNormalizeSanitizer ma ) )
177+ /** A node with path normalization. */
178+ class NormalizedPathNode extends DataFlow:: Node {
179+ NormalizedPathNode ( ) {
180+ TaintTracking:: localExprTaint ( this .asExpr ( ) , any ( PathNormalizeSanitizer ma ) )
183181 }
184182}
185183
@@ -188,8 +186,8 @@ private class PathDataModel extends SummaryModelCsv {
188186 override predicate row ( string row ) {
189187 row =
190188 [
191- "java.nio.file;Paths;true;get;;;Argument[0];ReturnValue;value " ,
192- "java.nio.file;Path;true;normalize;;;Argument[-1];ReturnValue;value "
189+ "java.nio.file;Paths;true;get;;;Argument[0];ReturnValue;taint " ,
190+ "java.nio.file;Path;true;normalize;;;Argument[-1];ReturnValue;taint "
193191 ]
194192 }
195193}
You can’t perform that action at this time.
0 commit comments