File tree Expand file tree Collapse file tree
python/ql/src/experimental
Security-new-dataflow/CWE-022 Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ private predicate crossoverNode(DataFlow::Node n) {
2424 */
2525private newtype TCustomPathNode =
2626 Config1Node ( DataFlow:: PathNode node1 ) { not crossoverNode ( node1 .getNode ( ) ) } or
27- Config2Node ( DataFlow2:: PathNode node1 ) { not crossoverNode ( node1 .getNode ( ) ) } or
28- CrossoverNode ( DataFlow:: Node e ) { crossoverNode ( e ) }
27+ Config2Node ( DataFlow2:: PathNode node2 ) { not crossoverNode ( node2 .getNode ( ) ) } or
28+ CrossoverNode ( DataFlow:: Node node ) { crossoverNode ( node ) }
2929
3030/**
3131 * A class representing the set of all the path nodes in either config.
Original file line number Diff line number Diff line change 11/**
2+ * @name Uncontrolled data used in path expression
3+ * @description Accessing paths influenced by users can allow an attacker to access unexpected resources.
4+ * @kind path-problem
5+ * @problem.severity error
6+ * @sub-severity high
7+ * @precision high
8+ * @id py/path-injection
9+ * @tags correctness
10+ * security
11+ * external/owasp/owasp-a1
12+ * external/cwe/cwe-022
13+ * external/cwe/cwe-023
14+ * external/cwe/cwe-036
15+ * external/cwe/cwe-073
16+ * external/cwe/cwe-099
17+ *
218 * The query detects cases where a user-controlled path is used in an unsafe manner,
319 * meaning it is not both normalized and _afterwards_ checked.
420 *
723 * This is easily detected by using normalization as a sanitizer.
824 *
925 * 2. The file path is normalized at least once, but never checked afterwards.
10- * This is detected by finding the earliest normalization and then ensure that
26+ * This is detected by finding the earliest normalization and then ensuring that
1127 * no checks happen later. Since we start from the earliest normalization,
1228 * we know that the absence of checks means that no normalization has a
1329 * check after it. (No checks after a second normalization would be ok if
1834 * as a `Sanitizer`. That means that only some dataflow paths out of a check will be removed,
1935 * and so identifying the last check is not possible simply by finding a dataflow path from it
2036 * to a sink.
21- *
22- * @name Uncontrolled data used in path expression
23- * @description Accessing paths influenced by users can allow an attacker to access unexpected resources.
24- * @kind path-problem
25- * @problem.severity error
26- * @sub-severity high
27- * @precision high
28- * @id py/path-injection
29- * @tags correctness
30- * security
31- * external/owasp/owasp-a1
32- * external/cwe/cwe-022
33- * external/cwe/cwe-023
34- * external/cwe/cwe-036
35- * external/cwe/cwe-073
36- * external/cwe/cwe-099
3737 */
3838
3939import python
Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ module Path {
8686 /** Provides a class for modeling new path normalization APIs. */
8787 module PathNormalization {
8888 /**
89- * A data-flow node that performs path normlization . This is often needed in oder
89+ * A data-flow node that performs path normalization . This is often needed in order
9090 * to safely access paths.
9191 */
9292 abstract class Range extends DataFlow:: Node { }
You can’t perform that action at this time.
0 commit comments